What is the difference between disabling journal on ext4 file system using:

tune2fs -O ^has_journal /dev/sda1

and using data=writeback when mounting? I thought ext4 - journal = ext2. means when we remove journal from a ext4 file system, it is automatically converted to ext2(thus we can not benefit from other ext4 features)

1 Answer
1

The two are in no way equivalent. Disabling the journal does exactly that: turns journaling off. Setting the journal mode to writeback, on the other hand, turns off certain guarantees about file data while assuring metadata consistency through journaling.

The data=writeback option in man(8) mount says:

Data ordering is not preserved - data may be written into the main
filesystem after its metadata has been committed to the journal. This is
rumoured to be the highest- throughput option. It guarantees internal
filesystem integrity, however it can allow old data to appear in files
after a crash and journal recovery.

Setting data=writeback may make sense in some circumstances when throughput is more important than file contents. Journaling only the metadata is a compromise that many filesystems make, but don't disable the journal entirely unless you have a very good reason.