Tuning ext2 Filesystems
As I mentioned in the previous section, tune2fs can configure variables associated with an already initialized ext2 filesystem. In addition, there are a number of other tactics that you can use to improve the performance of an ext2 partition: software-RAID-specific options for mke2fs, mount options, and filesystem attributes.
Reserved space
ext2 sets aside a fixed amount of space, by default, for the super-user. This reserved space is supposed to ensure that essential processes, usually running with a UID or GID of root, are able to continue writing data, even after the filesystem becomes full for normal users. In practice, nonprivileged users and processes are often able to unintentionally bypass this safeguard, so it’s not really a reliable security mechanism.
By default, 5 percent of the total disk space is reserved when an ext2 filesystem is created. Using the -m flag, users can adjust this percentage to meet their needs. An integer value between 1 and 100 must be used. In this example, 10 percent of the total disk space is reserved:
# mke2fs -m 10 /dev/md0
It might also be useful to change the user who is allowed to write data to the reserved disk space. Since security is such a well-publicized issue these days, many programs no longer run as root. Therefore, you might find it useful to allow the user account under which your database runs, for instance, to have access to the reserved areas on certain partitions. Use the tune2fs command to modify the reserved ...
Get Managing RAID on Linux now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.