EXT3 twickes


ext3 has 3 journal modes, Journal, Ordered, and Writeback (slowest to fastest) All it takes is a command by tune2fs.

 tune2fs -o journal_data_writeback /dev/sda1

This added journal_data_writeback to the default ext3 mount options for that partition. So if ext3 is mounted without options saying otherwise, or specifically with the option 'defaults', it will use writeback.

To get rid of that option, just add ^ before the option

 tune2fs -o ^journal_data_writeback /dev/sda1

Just remember not to have two journal options as default.

Note: the writeback journal is not very reliable and you may lose important data in a power outage. Check the man page of tune2fs for more information.

Reserved blocks percentage

According to the manual, reserved blocks are designed to keep your system from failing when you run out of space. Its reserves space for privileged processes such as daemons that start during init 3 and the reserved space can also prevent the filesystem from fragmenting as it fills up.

On large partitions such as 300gb, however, the default 5% reserved space can be 15gb, which is quite a lot of space.

You can use the following command to reduce it to 3%, which is a bit more logical on larger filesystems.

 tune2fs -m3 /dev/sda1

Remember, you don't want to remove the reserved blocks entirely, just reduce it to gain back unused space for unprivileged data.

dir_index: Use hashed b-trees to speed up lookups in large directories.

You can enable it with this command.

tune2fs -O dir_index /dev/sda1

Thats not enough however, you must run e2fsck on the partition with the -D parameter to optimize the directories for dir_index.

To do this, you must unmount it, or remount as read only. If you are using the partition and can't unmount it, switch to init 1 and run

 umount /dev/sda1

If this is your root partition, this will remount it as read only - otherwise it will be completely unmounted. You can then proceed to running

 e2fsck -Df /dev/sda1

and then


fsck timers

ext3 disk checks are long and usually uneventful. By default ext3 is scheduled for a full disk check quite often (about 32 mounts or a few weeks to a few months, based on how often you reboot your system).

Time dependent fsck flags generally are less reliable, you can reset your CMOS on your bios or a power outage might mess with it. It's just too easy to change the time and completely void the persistence of the time based fscking.

To disable time dependent fscking, you would run something like this:

 tune2fs -i0 /dev/sda1

number of mounts is more accurate, so there is no need to change the defaults (32), but if you did, this would be an example for 100 mounts.

 tune2fs -c100 /dev/sda1

check ext3 configuration The configuration of an ext* partition can be checked with the -l (L) switch.

 tune2fs -l /dev/sda1 

The most useful tweak you can perform is the way that directory indexes are scanned when looking for files. This is controlled by the option “dir_index”. By default this wouldn't be enabled but you can add it by running:

mine:~# tune2fs -O dir_index /dev/sda1

Once you've done this you'll be able to see the updated filesystem flags which are in use:

mine:~# tune2fs -l /dev/sda1 | grep features
Filesystem features:      has_journal resize_inode dir_index filetype needs_recovery sparse_super large_file

An entry in the fstab file usually looks something like this:

/dev/sda1       /               ext3    defaults,errors=remount-ro,noatime,nodiratime 0       1
linux/ext3.txt · Last modified: 2009/07/23 15:32 by
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0 ipv6 ready