Writeback Journalling

ext3 and ext4 have 3 ways of journalling data: writeback, ordered and journal modes. By default most distros use ordered. However in most cases writeback mode will give faster performance. So I'll show you how to switch over. Check out a more detailed explanation of these journalling options.

Warning: Writeback mode is not as safe as the other 2. If your computer should suddenly lose power, recently modified files may become corrupted. But if you have an uninterrupted power supply or use a laptop this is pretty safe. In either case, I've lost power twice without a single corruption.

Open up your /etc/fstab file and insert data=writeback flags to those partitions that you want to change.

UUID=1720446b-eb15-4af6-94c4-1aa40e959b29 / ext4 defaults,noatime,data=writeback 0 1

If you've changed your /boot partition to writeback mode edit your /boot/grub/menu.lst. Add rootflags=data=writeback to the kernel options of both your normal and recovery kernel lines.

Now the next time you boot, the partitions you've changed will be in writeback mode. To change over without a reboot, make very sure you know where each partition is located (try using the df tool). Replace the highlighted text with your partition location(s).

sudo tune2fs -o journal_data_writeback /dev/sda3


Post a Comment