Saturday, October 31, 2015

Remove journal from ext4 for DISK IO enhancement

10:40 PM Posted by Dilli Raj Maharjan No comments

Journaling Filesystem

journaling filesystem is a filesystem that maintains a special file called a journal that is used to repair any inconsistencies that occur as the result of an improper shutdown of a computer. Such shutdowns are usually due to an interruption of the power supply or to a software problem that cannot be resolved without a rebooting.


To enhance Disk IO performance we may need to disable file system journaling. Ext4 with disabled journal is faster in comparison to ext4 with journal option and is appropriate for less critical system as MySQL replication slave database. In my case I have multiple MySQL replication slaves and I have used ext4 partition with journal disabled on data partition where MySQL datadir resides. Follow step below to disable journaling from ext4 filesystem.


Unmount the partition on which we wish to disable the journaling.

Here we are about to disable journal from the partition /data with device file /dev/sdb1 where MySQL database resides.

umount /data













Verify journaling option exists on the partition. While execution command below we can notice has_journal on Filesystem features: at 6th row.

dumpe2fs /dev/sdb1 |more


Disable journaling with the command below.

tune2fs -O ^has_journal /dev/sdb1





Check the file system status with the command. The command below will scan the file system for any errors.


fsck.ext4 -f /dev/sdb1









Check for file system journaling option. We can noticed has_journal has been disappeared from Filesystem features. 

dumpe2fs /dev/sdb1 |more


For more performance improvement add following options on /etc/fstab.

/dev/sdb1 /data ext4 defaults,noatime,nodiratime 0 0 


Now mount the partition with following option.

mount /data














Finally start mysql services.

/etc/init.d/mysql start





0 comments:

Post a Comment