Intuition What this page is
The parent note gave you the rules. This page throws every kind of problem at those rules:
tiny arrays, huge arrays, zero-disk edge cases, dead disks, dead-during-rebuild disasters, small writes,
word problems, and one nasty exam twist. If a scenario exists, it is worked below — with a forecast so you
guess first, then a full derivation, then a plug-back check.
We only use three tools throughout, all built in the parent note:
XOR written ⊕ — "add without carry", where x ⊕ x = 0 (see XOR and Boolean Algebra ).
Capacity formulas — 0 → n , 1 → n /2 , 5 → n − 1 , 6 → n − 2 , 10 → n /2 .
The write-penalty count — small writes = 4 I/Os (RAID 5) or 6 I/Os (RAID 6).
Nothing new is assumed. Every symbol below was earned in the parent note.
Every RAID problem is one of these case classes . The goal of this page is to fill every cell .
#
Case class
What makes it tricky
Worked example
A
Capacity — normal array
plug into the level formula
Ex 1
B
Fault tolerance — normal
how many failures survived
Ex 1, Ex 4
C
Degenerate input (small n )
n = 2 , n = 3 : formulas hit limits
Ex 2
D
Zero / impossible input
RAID 6 with 2 disks = "no data disks"
Ex 3
E
XOR recovery — data disk dies
rebuild a data block
Ex 5
F
XOR recovery — parity disk dies
the parity itself is lost
Ex 5
G
Small-write I/O count
read-modify-write penalty
Ex 6
H
Limiting behaviour (large n )
efficiency as n → ∞
Ex 7
I
Second-failure-during-rebuild
why RAID 5 dies on big arrays
Ex 8
J
Real-world word problem
pick a level from requirements
Ex 9
K
Exam twist (RAID 0+1 vs 10)
order of operations changes fate
Ex 10
The examples below are ordered so that together they touch A through K .
Worked example Ex 1 — Cell A + B: capacity & tolerance of a normal array
Statement. You have n = 6 disks, each 2 TB. Give usable capacity and max failures survived for RAID 0, 1, 5, 6, 10.
Forecast: guess the five capacities before reading — which level wastes the most space?
RAID 0: capacity = n × 2 = 6 × 2 = 12 TB. Why this step? striping keeps every disk for data.
RAID 1: capacity = 2 n × 2 = 3 × 2 = 6 TB. Why? half the disks are exact copies.
RAID 5: capacity = ( n − 1 ) × 2 = 5 × 2 = 10 TB. Why? one disk's worth is parity P .
RAID 6: capacity = ( n − 2 ) × 2 = 4 × 2 = 8 TB. Why? two disks' worth is P and Q .
RAID 10: capacity = 2 n × 2 = 6 TB. Why? mirroring halves it; striping adds no capacity.
Failures survived — be careful to separate guaranteed from lucky :
RAID 0 → 0 (guaranteed and best-case: no redundancy at all).
RAID 5 → 1 (guaranteed and best-case: single parity).
RAID 6 → 2 (guaranteed and best-case: double parity).
RAID 1 & 10 (3 mirror pairs here) → worst-case guaranteed = 1 (a single failure is always survived; two failures in the same pair kill it). Best-case (lucky) = 3 (one disk from each of the 3 pairs can die and every pair still keeps a twin). The honest headline number is the guaranteed 1 .
Verify: total raw is 6 × 2 = 12 TB. RAID 5 keeps 10/12 = 83.3% ; RAID 6 keeps 8/12 = 66.7% ; RAID 1/10 keep 50% . Parity is always cheaper than mirroring — matches theory. ✓
Worked example Ex 2 — Cell C: the smallest legal arrays (degenerate small
n )
Statement. What happens to each level at its minimum disk count? Use the smallest n each level allows.
Forecast: at n = 2 , is RAID 5 even possible?
RAID 0, n = 2 : capacity = 2 disks. Why? striping just needs ≥ 2 disks to stripe across.
RAID 1, n = 2 : capacity = n /2 = 1 disk. Why? one twin pair; you keep exactly one disk of data.
RAID 5, n = 3 (minimum): capacity = n − 1 = 2 disks. Why? need ≥ 2 data disks + 1 parity's worth rotated. At n = 2 you'd have 1 data + 1 parity = a mirror in disguise , so RAID 5 needs n ≥ 3 .
RAID 6, n = 4 (minimum): capacity = n − 2 = 2 disks. Why? need ≥ 2 data disks plus P and Q worth.
RAID 10, n = 4 (minimum): capacity = n /2 = 2 disks. Why? need ≥ 2 mirror pairs to have anything to stripe.
Verify: RAID 5 at its floor n = 3 keeps 2/3 = 66.7% — worse efficiency than large arrays. Small parity arrays waste proportionally more. ✓ (This is the whole reason RAID 5 pays off only with more disks.)
Worked example Ex 3 — Cell D: the impossible / zero-data input
Statement. A student configures RAID 6 with only 2 disks . What is the usable capacity, and what does the number mean ?
Forecast: plug n = 2 into n − 2 before reading. What do you get, and is it real?
Apply the formula: capacity = ( n − 2 ) disks = ( 2 − 2 ) = 0 disks. Why this step? RAID 6 always spends two disks' worth on P and Q .
Interpret 0 : zero data capacity — both disks are entirely parity, no room for actual data. Why? with 2 data disks needed minimum and 2 parities, you'd need ≥ 4 disks.
Conclusion: RAID 6 with n < 4 is not a valid configuration — the controller rejects it. Why? a code that protects against 2 erasures needs at least 2 things left to protect.
Verify: the formula gracefully returns 0 , the honest answer: "no usable space." Check RAID 5 with n = 1 : ( 1 − 1 ) = 0 too — a single disk can't store both data and parity. Degenerate inputs give 0 , not negatives. ✓
Worked example Ex 4 — Cell B: counting
which failure patterns survive
Statement. RAID 10 with 3 mirror pairs (6 disks: pairs { 1 , 2 } , { 3 , 4 } , { 5 , 6 } ). Which 2-disk failures survive, which don't?
Forecast: RAID 10 "survives 1 per pair" — so does it always survive 2 failures?
Failure of { 1 , 3 } (one from two different pairs): survives. Why? each pair still has one living twin.
Failure of { 1 , 2 } (both disks of one pair): total loss . Why? that pair's data has no surviving copy.
Count survivable 2-disk sets: total pairs of disks = ( 2 6 ) = 15 . Fatal ones are the 3 within-pair combos. Survivable = 15 − 3 = 12 . Why this step? only same-pair losses are fatal.
Verify: survival probability of a random 2-disk failure = 12/15 = 0.8 = 80% . Contrast RAID 6: survives all ( 2 6 ) = 15 two-disk failures (100%). So RAID 6 is strictly safer against 2 failures, but RAID 10 writes faster. Matches parent trade-off table. ✓
Worked example Ex 5 — Cells E + F: XOR recovery, data disk
and parity disk
Statement. A RAID 5 stripe holds D 1 = 1101 , D 2 = 0011 , D 3 = 1010 . Parity P = D 1 ⊕ D 2 ⊕ D 3 .
(a) Recover D 2 if disk 2 dies. (b) Recover P if the parity disk dies.
Forecast: in case (b), is losing parity even a problem for reading data?
Compute P : D 1 ⊕ D 2 = 1101 ⊕ 0011 = 1110 . Why? combine first two blocks.
Finish: P = 1110 ⊕ D 3 = 1110 ⊕ 1010 = 0100 . Why? XOR the last block to complete the parity.
(a) Data disk dies. Recover D 2 = P ⊕ D 1 ⊕ D 3 . Why? the recovery rule cancels every surviving block, leaving the missing one.
P ⊕ D 1 = 0100 ⊕ 1101 = 1001 ; then 1001 ⊕ D 3 = 1001 ⊕ 1010 = 0011 = D 2 . Why? matches the original D 2 — recovery succeeded.
(b) Parity disk dies. Data D 1 , D 2 , D 3 still readable directly — no rebuild needed to read . To restore redundancy, recompute P = D 1 ⊕ D 2 ⊕ D 3 = 0100 (step 2). Why? parity is just a function of the data; recompute it any time.
Read the figure. The four boxes are the three data blocks (blue) and the parity block P (green), each showing its 4-bit value. The red X marks the dead disk D 2 . Below, follow the two green monospace lines: they are exactly steps 3–4 — first P ⊕ D 1 = 1001 , then ⊕ D 3 = 0011 , which lands back on the original D 2 . The caption reminds you why it round-trips: every surviving block appears twice and cancels (x ⊕ x = 0 ), leaving only the missing one.
Verify: recovered D 2 = 0011 equals the original. Recomputed P = 0100 equals the stored parity. Both round-trip perfectly because XOR is self-inverse (x ⊕ x = 0 ). ✓ See Galois Fields GF(2^n) for why RAID 6's second parity Q needs more than XOR.
Worked example Ex 6 — Cell G: I/O cost of a small write in RAID 5 vs RAID 6
Statement. Update one 4 KB data block. Count physical disk I/Os for RAID 5 and RAID 6. Then update both parities: use P n e w = P o l d ⊕ D o l d ⊕ D n e w with P o l d = 0100 , D o l d = 0011 , D n e w = 1111 , and update the RAID 6 second parity Q the analogous way.
Forecast: guess the two I/O counts, and guess P n e w , before computing.
RAID 5 I/Os: read D o l d (1), read P o l d (1), write D n e w (1), write P n e w (1) = 4 . Why? parity must be recomputed to stay valid, and that needs the old values.
RAID 6 I/Os: same reads/writes but for two parities P and Q : read D o l d , P o l d , Q o l d (3), write D n e w , P n e w , Q n e w (3) = 6 . Why? a second independent parity doubles the parity work.
Compute P n e w : P o l d ⊕ D o l d = 0100 ⊕ 0011 = 0111 . Why? removes the old data's contribution from parity.
Finish P n e w : P n e w = 0111 ⊕ D n e w = 0111 ⊕ 1111 = 1000 . Why? inserts the new data's contribution.
Update the second parity Q (RAID 6 only). Q is not a plain XOR — from the parent note Q = ⨁ i g i ⋅ D i over GF ( 2 8 ) , so the block at position i enters multiplied by g i . The same "remove-old, add-new" trick still works, but the change must be scaled by that block's coefficient: Q n e w = Q o l d ⊕ ( g i ⋅ D o l d ) ⊕ ( g i ⋅ D n e w ) . Why this step? Q o l d contained the term g i ⋅ D o l d ; XORing it back cancels it (x ⊕ x = 0 ), and XORing g i ⋅ D n e w inserts the new scaled term. Numerically, if disk i has coefficient g i = 1 (the simplest case, position 0 ) the update collapses to the same shape as P : Q n e w = Q o l d ⊕ D o l d ⊕ D n e w = 1000 for the same operands. For any other position the multiply is done in GF ( 2 8 ) — see Galois Fields GF(2^n) .
Verify: sanity-check P n e w by rebuilding from scratch. Suppose the stripe was D o l d = 0011 with two other blocks XORing to 0111 (since 0111 ⊕ 0011 = 0100 = P o l d ✓). After the write those two blocks are unchanged, so new full parity = 0111 ⊕ 1111 = 1000 = P n e w . ✓ For Q with coefficient g i = 1 , the shortcut gives Q n e w = 1000 , matching a from-scratch recompute of the same collapsed sum. Both methods agree — the shortcut saved reading the other disks. ✓
Worked example Ex 7 — Cell H: limiting behaviour, efficiency as
n → ∞
Statement. For RAID 5, 6, and 1, what fraction of raw capacity is usable as the number of disks n grows large?
Forecast: does RAID 5's efficiency approach 100% ? Does RAID 1 ever improve?
RAID 5 efficiency: n n − 1 = 1 − n 1 . As n → ∞ , this → 1 (i.e. 100% ). Why? one fixed parity disk becomes negligible in a huge array.
RAID 6 efficiency: n n − 2 = 1 − n 2 → 1 too. Why? two fixed parities also vanish proportionally.
RAID 1 efficiency: n n /2 = 2 1 , constant. Why? every disk always has a twin, no matter how many you add — mirroring never gets cheaper.
Numerical spot-check at n = 10 : RAID 5 = 9/10 = 90% ; RAID 6 = 8/10 = 80% ; RAID 1 = 50% . Why? confirms the trend before the limit.
Read the figure. The horizontal axis is the disk count n ; the vertical axis is the usable fraction of raw capacity. The blue curve is RAID 5 = ( n − 1 ) / n and the orange curve is RAID 6 = ( n − 2 ) / n — both climb toward the dashed gray line at 1.0 (the 100% ceiling) as you move right, confirming steps 1–2. The flat green line sits at 0.5 : that is RAID 1, which never improves no matter how far right you look (step 3). The arrow marks the "→ 1 as n → ∞ " trend for the parity curves.
Verify: the limit 1 − 1/ n → 1 is monotone increasing — parity RAID becomes more space-efficient with scale, while mirroring stays flat at 0.5 . This is exactly why huge arrays favour parity levels. ✓
Worked example Ex 8 — Cell I: the second-failure-during-rebuild disaster
Statement. RAID 5 with 12 disks. During a rebuild after one failure, every remaining disk must be fully read. If a second disk fails during that window, what is lost — and how does RAID 6 change the outcome?
Forecast: does the number of disks make a second failure more or less likely during rebuild?
RAID 5 survives exactly 1 failure (single parity P = one equation, one unknown). Why? one erasure code fixes one erasure.
During rebuild, all 11 surviving disks are read end-to-end under heavy load. Why? the missing disk's every block is recomputed via D k = P ⊕ ⨁ i = k D i .
With more disks, the probability that some second disk fails during this stressful window rises (more disks = more chances). Why? independent failure risks add up — see Reliability and MTBF .
A second failure now means two unknowns but only one equation → unsolvable → total data loss . Why? one parity cannot span two missing blocks.
RAID 6 fix: with P and Q (two independent equations) it survives the second failure — rebuild continues safely. Why? two equations solve two unknowns.
Verify: RAID 5 tolerance = 1 , RAID 6 tolerance = 2 ; the failure count that kills each is 2 and 3 respectively. So the "12-disk RAID 5" mistake from the parent note is confirmed: large arrays need RAID 6. ✓
Worked example Ex 9 — Cell J: real-world word problem (pick a level)
Statement. A hospital needs a database volume that is (i) write-heavy , (ii) must survive one disk failure with no downtime , (iii) has budget for exactly 8 × 4 TB disks. It does not need max capacity. Which level, and what capacity results?
Forecast: RAID 5 or RAID 10 — which wins for write-heavy?
Rule out RAID 0 — requirement (ii) demands redundancy. Why? RAID 0 survives 0 failures.
Between RAID 5 and RAID 10: RAID 5 small writes cost 4 I/Os (read-modify-write); RAID 10 writes cost 2 I/Os (write to both twins, no parity read). Why? write-heavy load makes parity penalty the deciding factor.
Choose RAID 10 for lowest write penalty and no-downtime redundancy. Why? it satisfies (i) and (ii); (iii) is met and max capacity isn't required.
Capacity = 2 n × 4 = 4 × 4 = 16 TB. Why? mirroring halves the raw 32 TB.
Verify: RAID 10 write I/Os = 2 < 4 = RAID 5 — correct for write-heavy. Capacity 16 TB ≤ 32 TB raw, consistent with 50% mirroring overhead. All three requirements met. ✓ (RAID is availability, not backup — the hospital still needs separate backups .)
Worked example Ex 10 — Cell K: the exam twist, RAID 10 vs RAID 0+1
Statement. 4 disks, arranged two ways. RAID 10 = mirror pairs { A 1 , A 2 } , { B 1 , B 2 } then stripe. RAID 0+1 = two stripes S 1 = { A 1 , B 1 } , S 2 = { A 2 , B 2 } then mirror the stripes. Disk A 1 fails, then disk B 2 fails. Which layout survives?
Forecast: same disks, same 50% capacity — surely same survival? (It is not.)
RAID 10 after A 1 dies: pair { A 1 , A 2 } still has A 2 ; pair { B 1 , B 2 } intact. Why? mirror-then-stripe keeps redundancy inside each pair.
RAID 10 then B 2 dies: pair { B 1 , B 2 } still has B 1 . Both pairs alive → survives . Why? the two failures hit different pairs, and each pair only needs one surviving twin.
RAID 0+1 after A 1 dies: stripe S 1 = { A 1 , B 1 } is broken — a stripe has no internal redundancy, so losing any one member kills the whole stripe. The system now depends entirely on the surviving mirror copy, stripe S 2 . Why? stripe-then-mirror puts redundancy only between the two stripes, never inside them.
RAID 0+1 then B 2 dies: B 2 ∈ S 2 , so stripe S 2 is now also broken . Both stripes are dead and there is no third copy → total data loss . Why? the only surviving redundant copy (S 2 ) was itself a fragile stripe, and a single disk loss destroyed it.
Answer: with the identical failures { A 1 , B 2 } , RAID 10 survives but RAID 0+1 is lost .
Read the figure. Top row = RAID 10: the two mirror pairs are drawn side by side; A 1 and B 2 carry red X's but each pair still shows one blue (alive) twin, so the green label reads "BOTH PAIRS OK → SURVIVES". Bottom row = RAID 0+1: the same two dead disks now sit in different stripes S 1 and S 2 , so both stripe labels turn red ("BROKEN") and the red verdict reads "BOTH STRIPES DEAD → TOTAL LOSS". The single caption states the moral: order of striping vs mirroring changes fault tolerance.
Verify: identical disk failures { A 1 , B 2 } → RAID 10 lives , RAID 0+1 dies . Order of striping vs mirroring genuinely changes fault tolerance. This confirms the parent's "order matters" mistake. ✓
Recall Quick self-test
RAID 6 with 2 disks — usable capacity? ::: 0 disks (invalid config; both are parity).
RAID 5 efficiency as n→∞? ::: Approaches 100%, since (n−1)/n → 1.
RAID 10, 3 pairs — fraction of random 2-disk failures survived? ::: 12/15 = 80%.
Small RAID 6 write costs how many I/Os? ::: 6 (read+write of data, P, and Q).
P_new for P_old=0100, D_old=0011, D_new=1111? ::: 1000.
Guaranteed vs lucky failures survived by RAID 10 (3 pairs)? ::: Guaranteed 1 (worst case), up to 3 (one per pair, best case).
Why does RAID 0+1 die where RAID 10 survives (same disks)? ::: Stripe-then-mirror has no redundancy inside a stripe; one loss breaks a whole stripe.
Capacity by formula, tolerance by parity-count, cost by write-I/Os. Every RAID question reduces to
one of those three — pick the tool, plug in, verify with a round-trip.
Back to the RAID overview · related: Disk Scheduling , File Systems , Reliability and MTBF .