For RAID 5 vs RAID 6, the short answer is this: use RAID 6 for any array of large hard drives. RAID 5 costs one drive of parity and RAID 6 costs two, so on eight 20 TB drives you get 140 TB against 120 TB. In return, RAID 6 can finish a rebuild when a second drive fails or a sector turns out to be unreadable, which is the exact moment RAID 5 has no redundancy left. RAID 6 does pay for that with slower small random writes, 6 disk operations per write against 4.
The rest of this article shows the arithmetic, so you can run it with your own drive count and spec sheet.
Usable capacity with worked numbers
Usable space is (N minus 1) drives for RAID 5 and (N minus 2) for RAID 6. These figures use 20 TB drives and are before filesystem overhead.
| Drives | Raw | RAID 5 usable | RAID 6 usable | Difference as share of RAID 6 |
|---|---|---|---|---|
| 4 | 80 TB | 60 TB (75%) | 40 TB (50%) | 50% |
| 8 | 160 TB | 140 TB (87.5%) | 120 TB (75%) | 16.7% |
| 12 | 240 TB | 220 TB (91.7%) | 200 TB (83.3%) | 10% |
| 24 | 480 TB | 460 TB (95.8%) | 440 TB (91.7%) | 4.5% |
The capacity argument for RAID 5 shrinks as the array grows, which is awkward for RAID 5, because the rebuild risk grows in the same direction. At 12 drives you give up 10% more usable space to survive a whole class of failure.
Here are the eight 20 TB drives from the table as RAID 5, with one parity block per stripe:
- Usable space
- 7 of 8 disks (140 TB of 160 TB)
- Survives
- Any 1 disk failing
And the same drives as RAID 6, with a second parity block on every stripe:
- Usable space
- 6 of 8 disks (120 TB of 160 TB)
- Survives
- Any 2 disks failing at once
Drive vendors sell decimal terabytes while most tools report binary units. 120 TB is about 109 TiB, so that is what df -h will roughly show before the filesystem takes its share.
Rebuild time on a 20 TB drive
A rebuild has to write the entire replacement drive, whatever the array holds, at least on mdadm and typical hardware controllers. Take the Ultrastar DC HC560 product manual, which rates a 20 TB drive at a maximum sustained 269 MB/s. That maximum applies only on the outer tracks. Throughput falls towards the inner tracks, and production traffic takes its share as well.
| Assumed rebuild rate | Arithmetic | Time for 20 TB |
|---|---|---|
| 269 MB/s (datasheet maximum, idle array) | 20,000,000 MB / 269 | 20.7 hours |
| 150 MB/s (round figure for a blended rate) | 20,000,000 MB / 150 | 37 hours |
| 50 MB/s (array still serving traffic) | 20,000,000 MB / 50 | 111 hours, or 4.6 days |
The middle and bottom rows are assumptions, not measurements. Your array will land somewhere on that range depending on load and how the rebuild is throttled.
URE risk: the arithmetic from vendor specs
An unrecoverable read error (URE) is a sector the drive cannot return. During a RAID 5 rebuild every surviving drive has to be read end to end, and there is no redundancy left to reconstruct a bad sector from.
Three published ratings to work from:
- Seagate Exos X22 data sheet: 1 sector per 10E15 bits read
- Western Digital Ultrastar DC HC560 manual: 1 in 10^15 bits read
- WD Red Plus product brief: less than 1 in 10^14 bits read
Treating errors as independent, the chance of at least one URE while reading B bits at rate r is 1 minus e^(-r × B). For an eight-drive RAID 5 of 20 TB drives, the rebuild reads seven drives:
Data read: 7 x 20 TB = 140 TB
In bits: 140 x 10^12 x 8 = 1.12 x 10^15 bits
Expected UREs: 1.12 x 10^15 x 10^-15 = 1.12
P(at least 1): 1 - e^-1.12 = 67.4%| RAID 5 array (20 TB drives, 10^15 rating) | Read in rebuild | Expected UREs at spec | P(at least one) |
|---|---|---|---|
| 4 drives | 60 TB | 0.48 | 38.1% |
| 8 drives | 140 TB | 1.12 | 67.4% |
| 12 drives | 220 TB | 1.76 | 82.8% |
Run an eight-drive array of 12 TB drives at a 10^14 rating and the figure is worse: 84 TB is 6.72 × 10^14 bits, so 6.72 expected errors and a 99.9% chance of at least one.
The outcome of a URE also depends on your stack. Per the md(4) man page, when md cannot read or repair a block, it records the address in the device's bad block list and later reads of that block fail. You lose a stripe's worth of data and whatever files sit on it, and the array carries on. If md cannot record the entry, it fails the device, and a second failed device on a degraded RAID 5 stops the array. Hardware controllers vary by vendor and firmware, and some abort the rebuild. Read your controller's documentation before you need it.
With RAID 6 the same event is a non-event. After one drive failure you still have one parity left, so a URE on a surviving drive is reconstructed and rewritten. Only with two drives already gone does RAID 6 reach the same exposure as a degraded RAID 5.
Second drive failure during a rebuild
The other risk is a whole drive dying mid-rebuild. Using the 0.35% annualized failure rate in the same HC560 manual, seven surviving drives and a 37 hour rebuild:
7 x 0.0035 x (37 / 8760) = 0.0001, or about 0.01%Stretch the rebuild to 111 hours and it is about 0.03%. That is small, and it is also the least trustworthy number in this article, because it assumes independence. Drives bought together share a manufacturing batch, a chassis, a power supply and a vibration environment, and a rebuild is often the heaviest sustained load they have seen in months. Use it as a floor. The practical takeaway is that URE exposure dominates on paper and correlated failure is what bites in real incidents, and RAID 6 covers both.
Write penalty: RAID 5 needs 4 operations, RAID 6 needs 6
A small write that does not cover a full stripe forces a read-modify-write cycle. RAID 5 reads old data and old parity, then writes new data and new parity, which is 4 operations. RAID 6 reads and writes two parity blocks instead of one, which is 6.
Assume 12 drives at 180 random IOPS each. That per-drive figure is an assumption, typical of the 7,200 rpm class, so measure yours with fio.
| Level | Penalty | 100% random write | 70/30 read/write mix |
|---|---|---|---|
| RAID 10 | 2 | 2,160 / 2 = 1,080 | 2,160 / (0.7 + 0.6) = 1,662 |
| RAID 5 | 4 | 2,160 / 4 = 540 | 2,160 / (0.7 + 1.2) = 1,137 |
| RAID 6 | 6 | 2,160 / 6 = 360 | 2,160 / (0.7 + 1.8) = 864 |
Those are the worst-case figures, and most large HDD arrays do not live there. Full-stripe sequential writes compute parity without reading anything first, so backups, media libraries and archive ingest see little of the penalty. If your workload is small random writes, neither level is the right answer, and RAID 10 or NVMe storage is where to look.
RAID 5 and 6 also share the write hole: a crash mid-write can leave parity out of step with data. md offers a write journal on a separate device (Linux 4.4 onward) for both levels, and a Partial Parity Log (Linux 4.12 onward) for RAID 5 only.
Setting up RAID 6 with mdadm
These commands work on current Debian and Ubuntu LTS releases with partitions already created on each drive. Adjust the device names.
mdadm --create /dev/md0 --level=6 --raid-devices=12 \
--chunk=256 --bitmap=internal /dev/sd[b-m]1
# Raid-456 stripe cache. Default is 256 entries.
# Memory used is about page size x drives x entries:
# 4 KiB x 12 x 8192 = 384 MiB
echo 8192 > /sys/block/md0/md/stripe_cache_size
# Raise the rebuild ceiling for this array, in KiB/s
echo 400000 > /sys/block/md0/md/sync_speed_max
# Start a scrub, then read the mismatch count when it finishes
echo check > /sys/block/md0/md/sync_action
cat /sys/block/md0/md/mismatch_cntThe scrub is the part people skip, and it matters most. A sector that went bad two years ago stays hidden until something reads it. Per the md(4) man page, a scrub reads every block and rewrites read errors from redundancy, so latent errors get fixed while you still have parity to fix them with. Run it monthly, off-peak.
When a drive starts throwing errors but has not died, prefer a hot replace over failing it first, since the old drive stays in service and stays useful as a read source:
mdadm /dev/md0 --add /dev/sdn1
mdadm /dev/md0 --replace /dev/sdc1 --with /dev/sdn1Recommendation for large HDD arrays
The 8 TB line is judgement rather than a hard threshold: at that size a RAID 5 rebuild is long enough, and reads enough data, that the numbers above stop being comfortable.
Keep groups to about 12 drives, and stripe multiple groups (RAID 60) beyond that. A wide RAID 6 has the same two-parity protection across more drives, a longer exposure to failures and a slower rebuild. If you can run ZFS, RAID-Z2 gives you the same double parity with checksums and rebuilds that only touch allocated data. For a look at bulk hardware suited to this, see our storage dedicated servers.
RAID 5 still has a place on small groups of enterprise SSDs, where rebuilds finish in hours, and for scratch or re-downloadable data. Check the SSD's rated error figure rather than assuming, and note that on Linux md, TRIM on RAID 4/5/6 stays disabled unless you set raid456.devices_handle_discard_safely=Y, and only do that if your drives actually zero discarded data.