Cheap RAID options for Gnu/Linux

I’m a fan of Gnu/Linux software RAID. I think it makes sense as an option for anyone who wants cheap RAID. Inexpensive RAID cards or the RAID options found on many motherboards do not offer performance or manageability benefits over software RAID. One benefit about GNU/Linux software RAID is that it is far more portable than hardware RAID solutions. That is, you can actually move the disks to another machine without migrating a RAID card or worrying about RAID compatibility.

I’ve been helping people implement software RAID solutions for desktops and servers running Ubuntu. I thought it might be nice to have a summary of what the various options entail. For the purpose of this I decided to set some restrictions:

  1. Disk utilization must not be less than 50%.
  2. Only options involving 4 or fewer disks.
Option Disks Space (in Disks) Utilization Disk Failures Read Speed Write Speed
RAID 1 2 1 50% 1 2x 1x
RAID 5 3 2 66% 1 3x 1x
RAID 10 3 1.5 50% 1 3x 1.5x
RAID 5 4 3 75% 1 4x 1x
RAID 6 4 2 50% 2 4x 1x
RAID 10 4 2 50% 1 4x 2x

Notes

  • RAID 1 has a nice benefit that either drive should be able to be placed in a new computer and booted up or taken offline for backups/snapshots.
  • RAID 1 is also the only RAID setup that a /boot partition can reside on.
  • RAID 10 is a Gnu/Linux software RAID mode that is not exactly the same as RAID 1+0 RAID 0+1. However it is far easier to configure, high performing, and supports odd numbers of drives and thus quite suitable to desktop systems and smaller servers.
  • RAID 5 and RAID 6 suffer from what is know as the “write hole”. This is an issue that can cause disk corruption when there is a sudden power failure when the array has a failed disk (or a disk fails after a power failure but before the reconstruction is completed).
  • RAID 10 using the “near” layout and 4 disks should have a 66% chance of surviving 2 disk failures. As the number of disks increases in a RAID10 array increases so does the chance of surviving a second disk failure though this is certainly not a fact to build a reliable system on.
  • While GNU/Linux RAID arrays can recover from an unclean shutdown (a power failure or a kernel panic) they add no additional guarantee of data integrity to the filesystem. In other words if preserving data integrity in the event of an unclean shutdown then choosing the right file system is important regardless of RAID.

    Recommendations

Well, if one’s budget is only for 2 disks than RAID 1 is the only solution.

For 3-4 disks the options seem to be between performance or disk space or redundancy:

  • if you want better performance but less disk space then go with RAID 10
  • if you want more disk space but worse performance then choose RAID 5
  • if your system must survive 2 disk failures of 4 disks then choose RAID 6
Creative Commons License Except where otherwise noted, content on this site is licensed under a Creative Commons by-nc-sa 3.0 License