Linux: How to disable/enable journaling on an ext4 filesystem

How to disable enable journaling

Sometimes you may be required to disable journaling to improve performance. Here is the steps to disable journaling on ext4 file system (e.g. /dev/sda2).

STEP 1: Unmount the file system partition journaling you want to disable

Use the following command to unmount the partition on /dev/sda2 (let’s say it’s /var):

#umount /var

STEP 2: Disable journaling for the file system

Use the following command to disable journaling for an ext4 file system:

#tune4fs -O ^has_journal /dev/sda2

 STEP 3: Perform a file system check

Use the following command to perform a file system check. This is not strictly required, but is recommended for checking file system integrity after disabling journaling:

#e4fsck –f /dev/sda2

STEP 4: Reboot

You may use the following command to reboot the Linux OS:

#shutdown –r now

STEP 5: Verify that the file system has journaling disabled and the partition is mounted

After the host has rebooted, you may use the following commands to check if journaling is disabled for the filesystem and the partition is mounted:

#dmesg | grep EXT4

Expected output similar to: EXT4-fs (dm-3): mounted filesystem without journal

#df -h