Mater artium necessitas

Archive for October, 2010

In the previous article, I showed how to improve the performance of an existing file server by tweaking ext3 and mount settings.
We can also take advantage of the availability of the now stable ext4 file system to further improve our file server performance.

Some distribution, in particular RedHat/CentOS 5, do not allow us to select ext4 as a formatting option during setup of the machine, so you will initially have to use ext3 as file system (on top of LVM preferably for easy extensibility).

A small digression on partitioning

Remember to create separate partitions for your file data: do not mix OS files with data files, they should live on different partitions.
In an enterprise environment, a minimal partition configuration for a file server could look like:

Hardware:

2x 160GB HDD for the OS

4x 2TB HDD for the data

The 160GB drives could be used as such:

200MB RAID1 partition over the 2 drives for /boot

2GB RAID1 partition over the 2 drives for swap

all remaining space as a RAID1 partition over the 2 drives for /
Note though that it is generally recommended to create additional partitions to further contain /tmp and /var.

The 2TB drives could be used like this:

all space as RAID6 over all drives (gives us 4TB of usable space) for /data

alternatively, all space as RAID5 over all drives (gives us 6TB of usable space)
The point of using RAID6 is that it gives better redundancy than RAID5, so you can safely add more drives later without increasing the risk of failure of the whole array (which is not true of RAID5).

Moving to ext4

If you are upgrading an existing system, backup first!

Let’s say that your /data partition is an LVM volume under /dev/VolGroup01/LogVol00.
First, make sure we have the ext4 tools installed on our machine, then unmount the partition to upgrade:

Important notes

The mounting options we use are somewhat a bit risky if your system is not adequately protected by a UPS.
If your system crashes due to a power failure, you are more likely to lose data using these options than using the safer defaults.
At any rate, you must have a proper backup strategy in place to safeguard data, regardless of what could damage them (hardware failure or user error).