Sub topic 16
Calculating usable capacity
This chapter assumes you already know what striping, mirroring, and parity mean, and that you can describe RAID 0, 1, 5, 6, and 10 at a basic level. It also assumes you are comfortable with units such as GB and TB. Here the goal is to turn a drive count and a drive size into a usable capacity, quickly and without mistakes.
Raw capacity versus usable capacity
Raw capacity is the sum of all drive sizes in the array. Usable capacity is the space the operating system can actually store data in. The difference is the space spent on redundancy: mirror copies or parity.
Every formula in this chapter assumes that all drives are the same size. If the drives differ, the controller normally treats each drive as if it were as small as the smallest member. The extra space on the larger drives is wasted.
Let N be the number of drives and S the size of one drive.
| RAID level | Minimum drives | Usable capacity | Drive failures survived |
|---|---|---|---|
| RAID 0 | 2 | N × S | 0 |
| RAID 1 | 2 | S | 1 (with two drives) |
| RAID 5 | 3 | (N − 1) × S | 1 |
| RAID 6 | 4 | (N − 2) × S | 2 |
| RAID 10 | 4 | (N ÷ 2) × S | 1 per mirrored pair, at least 1 |
Where each formula comes from
- RAID 0 stores no extra data. Every drive holds unique data, so you keep all of it: N × S.
- RAID 1 writes the same data to both drives. You get the size of one drive. With more than two drives in a mirror, you still get only S.
- RAID 5 stores one drive's worth of parity, spread across all drives. You lose the equivalent of one drive: (N − 1) × S.
- RAID 6 stores two independent sets of parity. You lose the equivalent of two drives: (N − 2) × S.
- RAID 10 is a stripe of mirrored pairs. Half of the drives hold copies, so you keep half: (N ÷ 2) × S.
The parity "loss" is spread out. No single drive is the parity drive in RAID 5 or 6. Only the total amount of space lost equals one or two drives.
A function that encodes the rules
This Python function applies the formulas and rejects drive counts that are not valid for a level.
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)) # 4Notice the validity checks. RAID 10 needs an even number of drives, so six drives work and five do not. RAID 1 in this function accepts exactly two drives, which is the common exam case.
Worked examples
Example 1: four 2 TB drives
The raw capacity is 4 × 2 = 8 TB.
- RAID 0: 8 TB usable.
- RAID 5: (4 − 1) × 2 = 6 TB usable.
- RAID 6: (4 − 2) × 2 = 4 TB usable.
- RAID 10: (4 ÷ 2) × 2 = 4 TB usable.
RAID 6 and RAID 10 give the same capacity with four drives. They differ in how they tolerate failures and how fast they write, not in space.
Example 2: how many drives do I need?
A client needs 12 TB of usable space with RAID 5, using 4 TB drives. Work backward.
- Usable = (N − 1) × S, so 12 = (N − 1) × 4.
- N − 1 = 3.
- N = 4 drives.
For the same 12 TB with RAID 10 and 4 TB drives, you need 12 ÷ 4 = 3 drives' worth of data, which is 3 mirrored pairs, so 6 drives.
Example 3: mixed drive sizes
An array has three drives: 1 TB, 2 TB, and 2 TB, set up as RAID 5. The controller treats each as 1 TB. Usable capacity is (3 − 1) × 1 = 2 TB. The extra 2 TB of space on the larger drives goes unused.
Overhead as a percentage
Redundancy overhead is the share of raw capacity you give up. It is useful for comparing levels.
- RAID 5 overhead is 1 ÷ N. With 3 drives it is 33 percent, and with 8 drives it is 12.5 percent.
- RAID 6 overhead is 2 ÷ N. With 4 drives it is 50 percent, and with 8 drives it is 25 percent.
- RAID 10 overhead is always 50 percent.
- RAID 1 with two drives is 50 percent.
- RAID 0 has 0 percent overhead.
Parity levels get more space-efficient as you add drives. Mirroring never does.
Common errors
- Using the marketing size. A drive labeled 2 TB uses decimal units (1 TB = 1,000,000,000,000 bytes). Operating systems often report binary units, so the same drive shows up as about 1.8 TiB. Exam questions usually ignore this and use the labeled size, but real systems show a smaller number.
- Forgetting that RAID 1 does not add capacity. Two 4 TB drives in RAID 1 give 4 TB, not 8 TB.
- Applying the RAID 5 formula with two drives. RAID 5 needs at least three drives. With two drives the formula would give only one drive of space, and that is just a mirror, which is RAID 1.
- Using an odd drive count for RAID 10. Mirrored pairs need an even count.
- Counting a hot spare as capacity. A hot spare sits idle until a drive fails. Do not include it in N. Five drives in RAID 5 with one hot spare means N = 4, so usable capacity is 3 × S.
- Mixing drive sizes without noticing. The smallest drive sets the size for all of them.
Checking your answer
A fast check: usable capacity can never exceed raw capacity, and for any redundant level it must be smaller than raw capacity. RAID 5 should lose exactly one drive's worth, RAID 6 two, and RAID 10 half. If your answer does not match that pattern, recheck N.
Exercise
A technician builds a RAID 5 array from five 4 TB drives and adds one more 4 TB drive as a hot spare. What is the usable capacity?
Show answer
The hot spare is not counted, so N = 5. Usable capacity is (5 − 1) × 4 = 16 TB.
Exercise
A server needs 10 TB of usable space in RAID 10 using 2 TB drives. How many drives are required?
Show answer
10 TB ÷ 2 TB = 5 drives' worth of data. RAID 10 mirrors each one, so you need 5 × 2 = 10 drives.
Exercise
Six 3 TB drives are configured as RAID 6. What is the usable capacity and the overhead percentage?
Show answer
Usable capacity is (6 − 2) × 3 = 12 TB. Raw capacity is 18 TB, and 2 ÷ 6 is about 33 percent overhead.