Some thoughts on partitioning schemes, RAID, and filesystems

If one were to rank computer issues subject to intense debate, how to partition a hard disk would certainly be high on the list. I’ve always tried to give a lot of thought to the partitioning scheme I’ve used for servers. In those cases I’m often trying to come up with something that will be a standard for some period of time. With desktops the issue is not so important because rarely will a mistake be a problem. So here are some schemes that have appealed to me recently.

Desktops

I’ve never had RAID on the desktop though I suppose someday maybe RAID 1 might be in order. Mostly I want to avoid running out of space. I’ve never found myself to really need to partitioning flexibility of LVM. On the other hand, if I chose to use LVM maybe I would find uses that would prove beneficial.

  • 1 big partition formatted with ext3 and using a swap file or dynamic swap
    • This is the simplest possible setup and wins points just for that. It maximizes available space and enabled the user to dynamically trade-off swap space for disk space.
  • 1 big partition assign to LVM and 2 logical partitions, 1 for swap and 1 for root
    • This adds an additional layer but also adds flexibility if one wanted to carve off another partition for some reason it could be done (assuming you left some space available to do so).
  • Any of the server configurations

Servers

I tend to like keeping the number of physical partitions below 3 to keep the number of software RAID devices down. I figure a system that’s going to have lots of partitions just needs to have LVM.

  • /boot (ext3, 256MB), root (ext3, 10-20GB), rest as LVM
    • I have yet to do a recover process on an LVM volume so I really don’t know if it would present additional problems. To be on the safe side this setup keeps the root partition as ext3 and additional partitions can be carved from LVM.
  • /boot (ext3, 256MB), rest as LVM
    • If I were to trust LVM with the root partition I would use this scheme because it would enable snapshots of the root partition and in a RAID setup it would keep the number of RAID devices to 2.

I used to avoid LVM and create physical swap partitions but now I’m finding those decisions to be sub-optimal. I used to also sometimes create a large data partition, sometimes fully encrypted. Now I feel in such a case it is better to use LVM, and then create a large partition there if needed. It’s important to remember that a lot of the filesystems don’t scale particularly well to large devices and therefor more smaller partitions can have better performance so long as they can be grown to avoid the problem of running out of space.

RAID

I think RAID 1 is a minimum for servers and an option for desktops. With RAID 1 you lose half the space but given the acceptance of that I think with more disks RAID 10 is the way to go. You lose half the space but gain performance compared with RAID 5 or RAID 6. I’m sure there are cases where RAID 5 or RAID 6 are the most appropriate but I would tend to choose RAID 10 if possible.

Filesystems

Another topic of much debate is what filesystem to use. I’ve benchmarked and experimented with both xfs and jfs as an alternative to ext3 and I’ve found myself coming back to ext3. I’ve had serious problems including data loss with xfs. I think the rules with xfs are 1) don’t use it on a 32-bit architecture, 2) don’t use it on large volumes because running a repair might become impossible. Of course, now all of my systems that are being deployed are 64-bit and with LVM I have more control over the volume size. In some recent benchmarks xfs had the fastest transfer rates but problems with seek performance. In contrast, jfs seems to have really fast seeks times but slow sequential write rates. I think jfs is overlooked but is actually a fairly solid and fast filesystem.

However, I continue to choose ext3 because of its compatibility. Everything for Linux is tested on ext3 and I’ve never been bitten with a product that doesn’t support ext3 the way I have with xfs. In some recent benchmarks, even though ext3 was generally behind both xfs and jfs in a lot of tests, ext3 was actually fastest when it came to making a backup, which is one of the most IO intense operations that occurs. And since it occurs nightly I wanted to pick the filesystem which was fastest. And I found it to be ext3.

Creative Commons License Except where otherwise noted, content on this site is licensed under a Creative Commons by-nc-sa 3.0 License