Sub topic 16
Calculating Usable Capacity
This chapter assumes you know what striping, mirroring, and parity are, and that you have met RAID 0, 1, 5, 6, and 10. Here you turn those ideas into numbers. The exam often gives you a drive count and a drive size and asks how much space you can actually use.
The working model
Every RAID level spends some raw capacity on redundancy. Raw capacity is the drive count times the drive size. Usable capacity is what is left after redundancy takes its share. In these formulas, n is the number of drives and s is the size of one drive. The formulas assume all drives are the same size. If the drives differ, the array treats every drive as if it were the size of the smallest one.
| RAID level | Minimum drives | Usable capacity | Space spent on redundancy |
|---|---|---|---|
| RAID 0 | 2 | n × s | None |
| RAID 1 | 2 | s | One full copy |
| RAID 5 | 3 | (n − 1) × s | One drive of parity |
| RAID 6 | 4 | (n − 2) × s | Two drives of parity |
| RAID 10 | 4 (even count) | (n ÷ 2) × s | Half the drives |
Parity is not stored on one dedicated drive in RAID 5 and 6. It is spread across all drives. The capacity cost is still equal to one drive (RAID 5) or two drives (RAID 6).
Worked example in code
The function below applies each formula and rejects drive counts that the level does not allow.
def usable_capacity(level, drives, size_tb):
"""Return usable capacity in TB for a RAID level."""
if level == 0 and drives >= 2:
return drives * size_tb
if level == 1 and drives == 2:
return size_tb
if level == 5 and drives >= 3:
return (drives - 1) * size_tb
if level == 6 and drives >= 4:
return (drives - 2) * size_tb
if level == 10 and drives >= 4 and drives % 2 == 0:
return (drives // 2) * size_tb
raise ValueError("Drive count not valid for this RAID level")
print(usable_capacity(0, 4, 2)) # 8
print(usable_capacity(1, 2, 2)) # 2
print(usable_capacity(5, 4, 2)) # 6
print(usable_capacity(6, 4, 2)) # 4
print(usable_capacity(10, 4, 2)) # 4With four 2 TB drives, the raw capacity is 8 TB. RAID 0 keeps all 8 TB. RAID 5 keeps 6 TB. RAID 6 and RAID 10 each keep 4 TB, but they get there differently. RAID 6 survives any two drive failures. RAID 10 survives one failure per mirrored pair, so it can survive two failures only if they hit different pairs.
Common errors
- Using the wrong minimum drive count. RAID 1 uses two drives, RAID 5 needs three, and RAID 6 and RAID 10 need four. RAID 10 also needs an even number.
- Forgetting the smallest-drive rule. A RAID 5 of three drives sized 1 TB, 2 TB, and 2 TB gives (3 − 1) × 1 TB = 2 TB, not 3 TB.
- Counting a hot spare. A hot spare sits idle until a drive fails, so it adds no usable space. Subtract it from
nfirst. - Mixing up TB and TiB. Drive makers use decimal units. Operating systems often report binary units, so a "2 TB" drive shows up as about 1.82 TiB. This is normal and does not mean the drive is faulty.
Exercise
A technician builds a RAID 5 array from five 4 TB drives and adds one more 4 TB drive as a hot spare. How much usable capacity does the array have?
Show answer
16 TB. The hot spare adds no usable space, so n = 5. The formula is (5 − 1) × 4 TB = 16 TB.
Exercise
Which two RAID levels give the same usable capacity from four identical drives, and how do their fault tolerances differ?
Show answer
RAID 6 and RAID 10 both give (4 − 2) × s = 2s, which is half the raw capacity. RAID 6 survives any two drive failures. RAID 10 survives two failures only if they are in different mirrored pairs.