RAID-4 pays a heavy price for parity: the lone parity disk serializes small writes. RAID-5 fixes that with one small change, and then we can line all four levels up side by side.
38.7 RAID Level 5: Rotating Parity
RAID-5 rotating parity RAID-5: spread (rotate) the parity blocks across all disks instead of dedicating one parity disk (RAID-4). This removes the parity-disk bottleneck, so small random writes can proceed in parallel β throughput (N/4)Β·R vs RAID-4's R/2 β while keeping RAID-4's capacity ((Nβ1)Β·B) and single-failure tolerance. It has largely replaced RAID-4. defined in ch. 38 β open in glossary works almost identically to RAID-4 β except it rotates the parity block across the drives instead of pinning it to one disk. Step through the change and why it matters:
1RAID-4: parity pinned to one disk
In RAID-4 every parity block (P0βP3) lives on Disk 4. Any two small writes must both touch that one disk to update their parity β so writes serialize behind it (the small-write problem).
RAID-5 analysis. Capacity, reliability, sequential read/write, and single-request latency are all identical to RAID-4. Two things improve:
- Random reads reach NΒ·R (not (Nβ1)Β·R) β with parity spread over every disk, all N disks can serve reads.
- Random writes jump to (N/4)Β·R. Because parity no longer lives on one disk, independent writes hit disjoint disks and run in parallel; across many requests all disks stay busy. The remaining factor of 4 is simply the 4 physical I/Os every parity write costs (read data, read parity, write data, write parity).
Because RAID-5 matches RAID-4 everywhere and beats it on random I/O, it has almost entirely replaced RAID-4 in practice. The only holdout is systems that only ever do large (full-stripe) writes and thus never hit the small-write problem; there, RAID-4 is occasionally used for being slightly simpler to build.
38.8 RAID Comparison: A Summary
Here are all four levels along the three axes. (We simplify a little β e.g. a mirrored writeβs seek is the max of two, so real random-write numbers are a touch lower β but this captures the essential trade-offs.)
| RAID-0 striping | RAID-1 mirroring | RAID-4 parity | RAID-5 rot. parity | |
|---|---|---|---|---|
| Capacity | NΒ·B | (NΒ·B)/2 | (Nβ1)Β·B | (Nβ1)Β·B |
| Reliability (disks lost) | 0 | 1 | 1 | 1 |
| Seq. read | NΒ·S | (N/2)Β·S | (Nβ1)Β·S | (Nβ1)Β·S |
| Seq. write | NΒ·S | (N/2)Β·S | (Nβ1)Β·S | (Nβ1)Β·S |
| Random read | NΒ·R | NΒ·R | (Nβ1)Β·R | NΒ·R |
| Random write | NΒ·R | (N/2)Β·R | (1/2)Β·R | (N/4)Β·R |
| Latency β read | T | T | T | T |
| Latency β write | T | T | 2T | 2T |
Tip: Which RAID? It Depends On What You Value
- Pure performance, reliability be damned β RAID-0.
- Random I/O and reliability β RAID-1; you pay in capacity.
- Capacity and reliability β RAID-5; you pay in small-write performance.
- Mostly sequential I/O, want capacity β RAID-5 again (full-stripe writes dodge the small-write penalty).
38.9 Other Interesting RAID Issues
We simplified to teach the core ideas. Real systems go further: there are other levels (Levels 2 and 3 from the original taxonomy; RAID-6 adds a second parity block to survive two simultaneous disk failures). When a disk does fail, a RAID may keep a hot spare on standby to reconstruct onto immediately β and performance during reconstruction is its own concern. Our fail-stop fail-stop fault model The simple RAID failure assumption: a disk is either working (all blocks readable/writable) or failed (permanently, wholly lost), and a failure is immediately and reliably detected. It deliberately ignores 'silent' faults like corruption and latent sector errors (deferred to the data-integrity chapter). defined in ch. 38 β open in glossary assumption is also optimistic: real disks suffer latent sector errors and silent corruption (the subject of the data-integrity chapter). Finally, a RAID can be built purely in software in the OS β cheaper, but it must solve the consistent-update problem consistent-update problem A crash or power loss partway through a multi-disk write (e.g. updating both copies of a mirror) leaves the copies inconsistent β new on one disk, old on the other. Solved with a write-ahead log recording the intended update before it happens, usually kept in battery-backed non-volatile RAM to avoid the cost of logging to disk. defined in ch. 38 β open in glossary itself, without the luxury of battery-backed NVRAM.
38.10 Summary
RAID turns a pile of independent disks into a single storage device that is larger, faster, and more reliable β and does so transparently, so the file system and applications above are none the wiser. Which level to use, and how to set its parameters (chunk size, disk count), depends entirely on what the workload values; getting it right βremains more of an art than a science.β
Next we climb up from the raw device to the software that gives it structure: files and directories, and the file systems that implement them.
Check yourself: RAID-5 and the comparison
1.What is the single change RAID-5 makes to RAID-4, and what does it fix?
2.RAID-5's small random write throughput is (N/4)Β·R. Where do the N and the 4 come from?
3.Compared with RAID-4, RAID-5's random READ throughput is:
4.You need good capacity AND reliability, with a mostly-mixed workload. Which level, and what's the cost?
5.Which statement about the RAID comparison (Fig 38.8) is correct?
6.What does RAID-6 add beyond the levels analyzed here?