Knowledgebase

Find frequently asked questions and setup guides by searching or by browsing the categories.

RAID 6 in Numbers

Usable capacity is the number of disks minus two, times the size of the smallest disk. Any two disks may fail at the same time.

DisksUsable capacityShare usable
4 × 8 TB16 TB50%
6 × 8 TB32 TB67%
8 × 8 TB48 TB75%
12 × 8 TB80 TB83%

The share grows with the number of disks, which is why RAID 6 is most attractive for large arrays.

How Double Parity Works

Like RAID 5, RAID 6 stripes data across the disks. Each stripe carries two parity blocks instead of one. The first, P, is the same XOR parity that RAID 5 uses. The second, Q, is computed with a different formula (a Reed-Solomon code), so P and Q are two independent equations. With two equations, two missing blocks can be solved for, whichever two disks they were on. Both parity blocks rotate across the disks from stripe to stripe.

Slower Writes Than RAID 5

A small write has to update both parity blocks: read the old data, P, and Q, then write all three. That is six disk operations for one write, against four on RAID 5 and two on RAID 10. Computing Q needs some processor time as well, though current processors handle it with little effort. Writes that fill a whole stripe avoid the extra reads, so large sequential writes suffer much less than small random ones.

Why It Took RAID 5's Place for Large Disks

A failed disk in a RAID 5 array of large hard disks starts a rebuild that can last a day or more. During that time a second failed disk, or one unreadable sector on a surviving disk, damages data. RAID 6 still has one level of protection during the rebuild: a second failure is survived, and a read error is repaired from the remaining parity. As disks grew to many terabytes, that margin became the reason to choose RAID 6.

Load During a Rebuild

A rebuild reads every surviving disk from start to end, and that reading competes with normal traffic. With two disks missing, every read of their data needs both parity blocks, which costs more processor time and disk work. Linux md limits the rebuild speed with two settings, in KiB per second for each device:

cat /proc/sys/dev/raid/speed_limit_min
cat /proc/sys/dev/raid/speed_limit_max

Raising the minimum shortens the rebuild at the cost of slower service; lowering the maximum protects service and makes the rebuild longer. Watch the progress in /proc/mdstat.

Where RAID 6 Fits

  • Large arrays of hard disks: six disks or more, where capacity matters.
  • Archives and media: data written once and read many times.
  • Backup targets: long sequential writes and a need to survive a rebuild safely.
  • Not for write-heavy databases: there, RAID 10 is faster.

RAID-Z2: The ZFS Counterpart

ZFS has its own parity levels. RAID-Z2 keeps two parity blocks per stripe like RAID 6, but ZFS also checksums every block, so it knows which copy is wrong and repairs it during reads and scrubs. Because ZFS writes new data to new places instead of overwriting, it avoids the write hole that classic parity RAID has. See what is ZFS.

Create a RAID 6 Array with mdadm

Warning: the create command overwrites every disk you list. Back up their contents and confirm the names with lsblk before you run it.

sudo mdadm --create /dev/md0 --level=6 --raid-devices=4 /dev/sdb /dev/sdc /dev/sdd /dev/sde

Saving the configuration and mounting follow mdadm RAID: set up software RAID on Linux. Check each disk now and then with smartctl.

Other RAID Levels

  • RAID 5: one parity block, one more disk of capacity, one failure allowed.
  • RAID 10: mirrored pairs for fast writes and quick rebuilds.
  • RAID 1: a plain mirror.
  • RAID 0: striping with no redundancy.

To compare capacity at other disk counts, see the RAID calculator and levels overview.

Was this answer helpful?
Loading...