The simple version
You and four friends each keep a page of a story. If one friend loses their page, the story is broken. So you add a sixth friend who keeps a clever "checksum" page: with it, any one missing page can be rebuilt from the rest. Add two checksum friends and you survive two losses. That's parity, and erasure coding is the general version.
RAID levels
| Level | Layout | Survives | Usable capacity (n drives) |
|---|---|---|---|
| RAID 0 | Striping | 0 failures | n |
| RAID 1 | Mirroring | n−1 (of a mirror set) | 1 drive's worth |
| RAID 5 | Striping + single parity | 1 | n−1 |
| RAID 6 | Striping + double parity | 2 | n−2 |
| RAID 10 | Stripe across mirrors | 1 per mirror pair | n/2 |
$ cat /proc/mdstat
$ sudo mdadm --detail /dev/md0Erasure coding (k+m)
Data is split into k data fragments plus m parity fragments, spread across k+m drives or nodes. Any m can be lost.
8+2 → 80% usable, survives 2. 4+2 → 67%, survives 2. 16+4 → 80%, survives 4.
Wider stripes give better efficiency, but every rebuild must read from more surviving fragments and small writes cost more. Distributed storage systems apply EC across nodes so a whole server can fail.
Rebuild time
30.72 TB at 200 MB/s → 30.72 × 10¹² ÷ 200 × 10⁶ = 153,600 s ≈ 42.7 hours.
Same drive at 1 GB/s → 30,720 s ≈ 8.5 hours.
During rebuild, the array runs with reduced protection and lower performance. As drives get bigger, that window grows, which is why large flash pools favour double parity or wider EC, and distributed rebuild that spreads the work over many drives at once. (Rebuild rate here is an example input: real rates depend on the system and how much foreground load it protects.)
Tools
mdadm --detailLinux software RAID state, layout and rebuild progress.
cat /proc/mdstatQuick view of md arrays and resync speed.
/proc/sys/dev/raid/speed_limit_min, _maxLinux md rebuild speed limits in KiB/s.
Quiz
Lab
Lab 2.3 · Rebuild math
A storage pool uses 30.72 TB drives. Your SLA says the pool must be back to full protection within 4 hours of a drive failure. Work out whether the current design meets it. No terminal needed: use the rebuild formula from Lesson 10.