4.2.39 · D3Operating Systems

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

3,278 words15 min readBack to topic

We only use three tools throughout, all built in the parent note:

  • XOR written — "add without carry", where (see XOR and Boolean Algebra).
  • Capacity formulas, , , , .
  • 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.


The scenario matrix

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 ) , : 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 ) efficiency as 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 examples











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.

Back to the RAID overview · related: Disk Scheduling, File Systems, Reliability and MTBF.