Combine several disks to be faster, safer or both: striping, mirroring and parity.
RAID joins several physical disks into one logical disk. Depending on the level, it makes the disk faster, safer, or both.
A single disk will fail one day. RAID (Redundant Array of Independent Disks) is a way to put several disks together, so that the computer sees one big disk and the disks share the work and the risk.
There are three building blocks. Striping cuts data into small stripes and writes them to the disks in turn, so a big read or write uses all disks together. Mirroring writes the same data to two or more disks. Parity stores an extra block per row of data, computed with XOR. If one block in the row is lost, XOR-ing the others gives it back.
| Level | How it works | Usable space (N disks) | Failures survived | Good for |
|---|---|---|---|---|
| RAID 0 | Striping only | All N disks | None. One failure loses everything. | Speed, when the data can be recreated |
| RAID 1 | Mirroring (2 or more copies) | One disk's worth (1 of N) | N − 1 disks | Boot disks, small and important volumes |
| RAID 5 | Stripes with 1 parity block per row, spread over all disks | N − 1 disks (needs 3 or more) | 1 disk | General storage, read-heavy data |
| RAID 6 | Stripes with 2 parity blocks per row | N − 2 disks (needs 4 or more) | Any 2 disks | Large arrays where a second failure is a real risk |
| RAID 10 | Mirrored pairs, then striped across the pairs | Half of the disks | 1 per mirror pair (never both disks of one pair) | Databases, anything needing speed and safety |
| Kind | Who does the work | Good and bad |
|---|---|---|
| Hardware RAID | A dedicated controller card | Takes work off the CPU and may have a battery-backed cache. But the controller is itself a part that can fail, and the array may only be readable on a similar controller. |
| Software RAID | The operating system | Flexible and cheap, with no special card. It uses some CPU, and you rely on the operating system for the setup. |
Stripes plus one parity block per row (the XOR of the data blocks). Any one lost disk can be rebuilt from the others.
Capacity and survival rules follow the standard definitions of each level. Real controllers differ in details (stripe size, hot spares, rebuild order). RAID protects against disk failure only: it does not protect against deleted files, bugs, a failed controller or a fire, so you still need backups.
| Term | Meaning in easy words |
|---|---|
| RAID | Redundant Array of Independent Disks: several disks used together as one |
| Striping | Splitting data into pieces and writing them to the disks in turn, for speed |
| Mirroring | Writing the same data to two or more disks, so one copy survives |
| Parity | An extra calculated block that lets one lost block be rebuilt |
| XOR | A bit operation that is 1 when two bits differ. The maths behind parity |
| Stripe | One row of blocks spread across all disks of the array |
| Degraded array | An array that has lost a disk but still works, more slowly and with less safety |
| Rebuild | Recreating the data of a failed disk onto a new disk |
| Hot spare | An idle disk that takes over automatically when another disk fails |
| Write penalty | The extra reads and writes that parity needs for each small write |
| Hardware RAID | RAID done by a controller card instead of the operating system |
| Choice | We gain | We lose |
|---|---|---|
| RAID 0 | Full capacity and best speed | All safety. One disk dies, everything is lost |
| RAID 1 | Simple and safe, fast reads | Half the space (or less with more copies) |
| RAID 5 | Good space use with protection from one failure | Slow small writes and a risky rebuild on large disks |
| RAID 6 | Survives two failures | Slower writes and two disks of space for parity |
| RAID 10 | Speed and safety, quick rebuild (copy one disk) | Half the space, and two failures in one pair are fatal |
| More disks | More space and speed | A higher chance that at least one disk fails |