Hardware vs. Software RAID

April 22nd, 2008

This article came up in my Planet SysAdmin feed talking about Linux software RAID and LVM. I’ve been using software RAID more recently and it’s fine for simple cases but there are many situations where having a hardware RAID card just makes things easier.

For example, I have a machine with 7 500G drives. Ideally, I want a 24G root filesystem, 4G swap and the rest for LVM, all striped using RAID 5 to maximize the space for LVM. It’s simple with a hardware RAID card: just put the 7 drives in an array and divvy up the single large device you get in Linux. One partition for the root, another for swap and a third for LVM.

With software RAID, this doesn’t seem to exactly possible. The big problem is that grub can’t boot from RAID 5 devices. To work around that, I ended up having to create partitions for the root, swap and LVM on the first two drives and create single large LVM partitions on the rest. I created two RAID 1 devices (which grub can boot) using the root and swap partitions on the first two drives and a RAID 5 for LVM using the third partitions on the first two drives and the only partitions on the remaining drives. But I lost 113G in LVM space since the partitions used to make up the LVM RAID 5 were smaller on the first two drives.

I guess I could create a RAID 1 of the smaller LVM partitions on the first two drives, a RAID 5 of the all-disk partitions on the rest of the drives and use both as PVs in my VG. Seems pretty complex, though, and I’d still lose some space.

On the other hand, software RAID definitely has advantages in that it works the same way on any machine. I get really annoyed with some hardware RAID cards and their silly limits: no more than X drives in an array, no arrays larger than Y, etc.). Software RAID in Linux also provides consistent notification methods.

Leave a Reply