Interactive Demo — RAID 5

Parity: the missing-number trick

How can a RAID 5 array lose a whole disk and still get every file back — without keeping a full copy? Crash a disk below and figure it out yourself.

Step 1 · The number trickuse ▲ ▼ to change numbers, 💥 to crash a disk

Three disks each store a number. A fourth disk, the parity disk, stores the total of the three. It's not a copy of anything — just one extra number that is calculated from the others. Crash a data disk and see if you can work out what was on it.

Step 2 · How computers really do itclick bits to flip them · click a column heading to see why

Computers store 1s and 0s, not numbers like 7. Adding doesn't work neatly on bits, so they use a trick called XOR (written ⊕). The rule is tiny:

0 ⊕ 0 = 0
1 ⊕ 1 = 0
0 ⊕ 1 = 1
1 ⊕ 0 = 1
Same → 0. Different → 1.

Each row below is a block on a different disk. The parity row is the XOR of the rows above it, one column at a time.

Step 3 · Your turn

Work out the missing value, then press Check.