Sub topic 13
RAID 6: Surviving Two Drive Failures
This chapter assumes you already know striping, mirroring, and single parity from the RAID 5 chapter. You should also be comfortable with the idea that a RAID array presents several physical drives to the operating system as one logical volume.
What RAID 6 is
RAID 6 is striping with double distributed parity. Like RAID 5, it spreads data blocks across all the drives in a stripe and rotates the parity blocks so that no single drive holds all of them. Unlike RAID 5, each stripe carries two independent parity blocks, usually called P and Q. Because of this, the array can lose any two drives at the same time and still serve all of its data.
The key facts for the exam:
| Property | RAID 6 |
|---|---|
| Minimum drives | 4 |
| Fault tolerance | Any 2 drives |
| Usable capacity | (N − 2) × drive size |
| Read performance | Good, because reads come from many drives |
| Write performance | Slower than RAID 5, because two parity blocks are computed and written |
| Typical use | Large arrays of big drives where a rebuild is risky |
Why double parity exists
A single-parity array such as RAID 5 is only safe while every surviving drive stays healthy. When one drive fails, the controller must read every sector on every remaining drive to rebuild the lost data. This rebuild can take many hours on large drives. During that time the array has no redundancy left.
Two problems make this window dangerous:
- A second drive can fail during the rebuild. Drives in one array are often the same model, the same age, and under the same load, so failures can cluster.
- A single unreadable sector on a surviving drive can stop the rebuild. Larger drives hold more sectors, so the chance of hitting a bad one grows.
RAID 6 closes this gap. After one drive fails, the array still has one drive's worth of redundancy left. A second failure, or a bad sector found during the rebuild, can still be corrected.
How the layout works
In each stripe, the controller writes data blocks to most drives and two parity blocks to two others. The positions rotate from stripe to stripe. The diagram below shows a six-drive array. Each row is a stripe.
With six drives, four of every six blocks hold data. That gives a usable capacity of (6 − 2) × drive size, or two thirds of the raw space.
How two parities work
You do not need to know the math for the exam, but the idea helps. Two unknowns need two independent equations to solve.
- The P parity is the XOR of the data blocks, exactly as in RAID 5.
- The Q parity is computed with a different formula, typically arithmetic over a mathematical structure called a Galois field. It weights each data block differently, so it is not just a copy of P.
If one drive fails, the controller can rebuild it with P alone. If two data drives fail, the controller has two missing values and two equations, P and Q, so it can solve for both. This is why RAID 6 survives two failures and not three.
The next example shows the first half of this idea in Python. It rebuilds one lost block from P, as RAID 5 does. The Q calculation is left out because it needs Galois-field arithmetic.
# Four data blocks in one stripe (4-bit values for readability)
blocks = [0b1010, 0b0110, 0b1100, 0b0011]
# P parity is the XOR of all data blocks
p = 0
for block in blocks:
p ^= block
print("P parity:", format(p, "04b"))
# Suppose the drive holding blocks[2] fails.
# XOR the survivors with P to rebuild the lost block.
rebuilt = p
for i, block in enumerate(blocks):
if i != 2:
rebuilt ^= block
print("Rebuilt:", format(rebuilt, "04b"))
print("Correct:", rebuilt == blocks[2])With one failure, P is enough. A second simultaneous failure in the same stripe is where Q becomes necessary.
Capacity calculations
The formula is (N − 2) × drive size, where N is the number of drives. Two drives' worth of space always goes to parity, no matter how large the array is. This means the capacity overhead shrinks as you add drives.
| Drives | Drive size | Raw capacity | Usable capacity | Parity overhead |
|---|---|---|---|---|
| 4 | 4 TB | 16 TB | 8 TB | 50% |
| 6 | 4 TB | 24 TB | 16 TB | 33% |
| 8 | 4 TB | 32 TB | 24 TB | 25% |
Here is a short program that applies the formula and rejects invalid drive counts.
def raid6_usable(drives, size_tb):
"""Return usable capacity in TB for a RAID 6 array."""
if drives < 4:
raise ValueError("RAID 6 needs at least 4 drives")
return (drives - 2) * size_tb
for n in (4, 6, 8):
print(n, "drives of 4 TB ->", raid6_usable(n, 4), "TB usable")Compare this with RAID 10 on four 4 TB drives. Both give 8 TB usable. The difference is in fault tolerance, covered below.
RAID 6 compared with RAID 5 and RAID 10
| Feature | RAID 5 | RAID 6 | RAID 10 |
|---|---|---|---|
| Minimum drives | 3 | 4 | 4 |
| Usable capacity | (N − 1) × size | (N − 2) × size | (N ÷ 2) × size |
| Guaranteed failures survived | 1 | 2 | 1 |
| Best-case failures survived | 1 | 2 | N ÷ 2, if each loss is in a different mirror pair |
| Write speed | Moderate | Slowest of the three | Fast |
| Rebuild stress | High | High, but a second fault is survivable | Low, copies one mirror |
RAID 10 on four drives survives two failures only if they hit different mirrored pairs. If both drives of one pair fail, the array is lost. RAID 6 survives any two failures, which is the property to remember.
Common errors and misconceptions
- Assuming RAID 6 needs six drives. The minimum is four.
- Using the RAID 5 formula. Subtract two drives, not one.
- Believing RAID 6 is a backup. It protects against drive failure only. Deleted files, malware, controller failure, fire, and theft still destroy the data. The later chapter on why RAID is not a backup covers this fully.
- Expecting RAID 6 to be fast on writes. Each small write can require reading old data and both parity blocks, then writing the new data and both new parity blocks. Hardware controllers with a battery-backed cache reduce this penalty.
- Ignoring failed drives. A degraded RAID 6 array with one failure is effectively RAID 5. Replace the drive promptly.
Exam angle
The A+ exam usually frames RAID 6 as a scenario. Look for phrases such as "must survive two drive failures," "large array of high-capacity drives," or "extra protection during a rebuild." If a question needs two-drive tolerance and mentions parity, the answer is RAID 6. If it stresses speed with mirrors, think RAID 10. If it asks for the least capacity lost with single-drive tolerance on three or more drives, think RAID 5.
Exercise
A technician builds a RAID 6 array from six 8 TB drives. How much usable capacity does the array have, and how many drives can fail without data loss?
Show answer
Usable capacity is (6 − 2) × 8 TB = 32 TB. Any two drives can fail without data loss. A third failure before a rebuild completes would lose the array.
Exercise
A four-drive RAID 10 array and a four-drive RAID 6 array both use 2 TB drives. Both give 4 TB usable. Why might an administrator still prefer RAID 6 for protecting important data?
Show answer
RAID 6 survives any two drive failures. RAID 10 survives two failures only if they are in different mirrored pairs, so losing both drives of one pair destroys the array. RAID 10 has faster writes, so the choice depends on whether fault tolerance or write speed matters more.
Exercise
Why is a RAID 5 array of very large drives considered riskier during a rebuild than a RAID 6 array of the same drives?
Show answer
A RAID 5 rebuild leaves no redundancy. A second drive failure, or one unreadable sector on a surviving drive, can make the rebuild fail and lose the data. RAID 6 keeps a second parity block, so it can still recover after one failure plus one more fault.