4.2.39 · D1Operating Systems

Foundations — RAID — levels 0, 1, 5, 6, 10 — trade-offs

1,809 words8 min readBack to topic

Before you can read the parent note, you need a small toolbox of ideas: what a disk even is here, what a block is, what striping/mirroring/parity mean as pictures, and the one piece of algebra — XOR — that makes parity magic. We build each from nothing, in an order where every new idea leans only on the ones before it.


1. Disk — the thing we are protecting

The whole topic exists because one box is not enough. We need this word first because "array of disks" (the A and D in RAID) is literally many of these boxes lined up.

Recall What makes a single disk both slow and fragile?

One head reads/writes at a time (slow), and if it fails there is no other copy (fragile).


2. Block — the unit we move around

We need blocks because RAID never moves "a whole file" onto "a whole disk" — it moves pages onto different disks. Everything after this (striping, parity) is a rule for which page goes where.

Figure — RAID — levels 0, 1, 5, 6, 10 — trade-offs

Look at the figure: one file (the tall stack) is sliced into equal blocks . Those blocks are the atoms we shuffle across disks.


3. — how many disks we have


4. Striping — spreading pages for speed

The picture: instead of one door, you have doors all open at once. That is the whole win of striping — parallelism — and the whole risk — losing any one disk loses those pages forever.

Figure — RAID — levels 0, 1, 5, 6, 10 — trade-offs

The left panel shows striping: each disk holds a different page (fast, no safety). Keep this picture — RAID 0 is this picture.


5. Mirroring — the copy for survival

Look at the right panel of the same figure: two disks hold the same pages . That redundancy is why RAID 1 survives a failure — and why it costs 50% of your space.

Recall Striping vs mirroring in one line each

Striping = different page per disk (speed, no safety). Mirroring = same page twice (safety, half capacity).


6. XOR () — the algebra behind parity

Parity is the clever, cheap safety net, and it runs entirely on one operation: XOR, written . We must earn this symbol fully, because the parent's whole derivation depends on it. See XOR and Boolean Algebra for the deeper treatment.

Why XOR and not plain addition? Because XOR has three magic properties that let us undo it perfectly:

Figure — RAID — levels 0, 1, 5, 6, 10 — trade-offs

The figure shows why parity recovers a lost block: XOR all blocks into a "summary" ; when one block vanishes, XOR the survivors with and every survivor cancels its own copy inside (the law), leaving only the missing block. That cancellation is the entire trick behind RAID 5.


7. and subscripts — reading the big formula

So the parent's recovery rule reads in plain words: "the lost block equals the summary XORed with every surviving block." Nothing here is new — it is section 6 written compactly.


8. , , and — one parity vs two

Why can't just be another XOR? Because two XOR summaries would be the same equation twice — no new information. To make genuinely independent, RAID 6 weights each block differently using arithmetic in a Galois field (see Galois Fields GF(2^n)). You do not need the field's internals here — only the idea: two different recipes = two solvable equations = two disks recoverable.

Recall Why a second XOR won't give RAID 6 its double protection?

Two XOR summaries encode the same equation; you can't solve two unknowns from one equation. uses to be independent.


9. I/O — counting the cost of a write


How these foundations feed the topic

Disk one slow fragile box

Array many disks called n

Block a page of data

Striping deal pages across disks

Mirroring copy pages to a twin

XOR the different bit operation

Parity P the summary block

Recovery rebuild one lost block

Second parity Q over Galois field

RAID levels 0 1 5 6 10

Read it top-down: the atoms (disk, block, XOR) build the three tools (striping, mirroring, parity), which combine into the five RAID levels.


  • Reliability and MTBFwhy more disks means more failures to plan for.
  • Backups vs Redundancywhy RAID is availability, not backup.
  • File Systems — the layer that sits on top of the logical disk RAID presents.
  • Return to the parent: 4.2.39 RAID — levels 0, 1, 5, 6, 10 — trade-offs (index 4.2.39).

Equipment checklist

Test yourself — you are ready for the parent note when each of these comes instantly.

What is a "disk" in this topic, and its two weaknesses?
One storage device with one head — slow (one door) and fragile (no copy).
What is a "block"?
A fixed-size chunk of data, like one page torn from a book.
What does the symbol mean?
The number of disks in the array.
Say striping in one line.
Deal different blocks to different disks for parallel speed, no redundancy.
Say mirroring in one line.
Keep an identical twin copy of every disk; costs half your capacity.
Compute .
.
State the three XOR laws.
, , order doesn't matter (commutative + associative).
Why does one parity block recover exactly one lost disk?
XOR is self-inverse, so survivors cancel inside , leaving the missing block — one equation, one unknown.
What does mean in words?
XOR together every data block except disk .
Why does RAID 6 need in instead of a second XOR?
A second XOR is the same equation; must be independent to solve two unknowns.
What is one "I/O", and why do we count them?
One read or write to a disk; they are the slow part, so counting them measures the write penalty.