
I am a long-time fan of Linux software RAID. But in reading an online discussion which happened to mention variations in actual sizes of storage devices (disks or flash) of supposedly identical capacity, I realized that there is yet another advantage of Linux software RAID: the fact that it can build arrays out of disk partitions, not necessarily entire disks.
This means you can create the partitions to be a standard size, slightly smaller than the maximum capacity of the disk. (Each disk will have just one partition on it, the rest of the disk being unused.) Then if you have to replace a failed disk, you can create a new partition of the same size on the replacement.
Otherwise, if you use the entire disk, you run the risk that the new disk is a bit smaller than the old one, and trying to add it to the RAID container may fail.
This is true, however all modern RAID controllers have a mechanism to achieve the same goal. LSI refers to this as “size coercion”, and enabling it limits disks to the next lowest round half gigabyte: # /opt/MegaRAID/MegaCli/MegaCli64 -pdlist -a0 | grep -i Coer Non Coerced Size: 3.637 TB [0x1d1b0beb0 Sectors] Coerced Size: 3.637 TB [0x1d1b00000 Sectors] non-coerced size: 7812988592*512 / (1024*1024*1024) 3725.52327 coerced size: 7812939776 sectors *512 bytes/sector / (1024*1024*1024)bytes 3725.50000 Yes, it’s still technically possible to have some “larger” disks to have exactly 0x1d1b00000 sectors and an errant “smaller” disk to have one fewer, which would still break in this case - but the chances of that happening are vanishingly low. I like linux mdraid, but there are a number of situations in which good quality hardware RAID is vastly superior (performance being the main one). The kinds of issues that people seem to have with hardware RAID either stem from using poor quality components ( fake raid, motherboard hardware raid, low-end RAID controllers which are really just slightly smart HBAs etc), or from not having support contracts on hardware (and running into issues like “my RAID controller died and I couldn’t find the right replacement model so I couldn’t recover the array"). If you’re in a situation where your options are motherboard RAID vs linux software RAID, or using hardware RAID without support contracts or cold spares and don’t want to/can’t recover from backup, then mdraid might well be the best option.