tune2fs command is one of the advanced unix commands which allows you to adjust various tunable parameters of the ext2/ext3 filesystems. Naturally, it also helps you confirm the existing parameters configured for your filesystems.
Confirm current filesystem parameters with tune2fs
The tunefs -l command will show you all the information contained in a filesystem’s superblock. Here’s how it typically looks:
Reserved space on a Unix filesystem
By default, every filesystem in Unix has some space reserved for the superuser (root). This means that no regular Unix user can fill your filesystem up to 100%, and so it’s always going to have enough free space to continue normal function.
As a standard, each filesystem has 5% of space reserved in this way. If you look at the above output, you may notice the following lines there, which regulate the space reservation:
Compared to the overall filesystem block count:
this 249036 reserve is exactly 5%. The uid and gid confirm the Unix user id and Unix group id of the user who will be allowed to tap into the reserved space. As I said earlier, it’s root.
If you have root access on your system, you can alter this reserved space allocation for any filesystem using tune2fs -m parameter, by specifying the percentage of the space to be reserved.
Here’s how we change the default reserve to be 6% of the overall filesystem size:
And here we change it back. Note how the number of block corresponding to 5% is exactly the figure we’ve seen earlier – 249036 blocks:
Default block size for a filesystem
If you ever want to confirm the block size of any filesystem, tune2fs will help you do just that:
From this example, you can see that the default block size for the filesystem on /dev/sda1 partition is 4096 bytes, or 4k. That’s the default block size for ext3 filesystem.