5-min deep dive

RAID in depth: RAID 6, RAID 10, write penalty and availability

You choose a RAID level by balancing “how many disks can fail,” “speed” and “usable capacity.” Let’s see why RAID 6 or RAID 10 is often chosen over RAID 5 in practice.

Reading time: about 5 min

← Start with the 1-min version

In the game, this was a team splitting up quiz answersPlay “Split It, Remember It”

In the gameIn real IT
Team membersDisks
Answers (Y/N)Data (1 and 0)
Even-up noteParity
Absent kidFailed disk
Recovering the absent kid’s partRebuild
A second kid is absentDouble failure

Comparing common RAID levels

LevelDisks that can failCapacity (6 × 4 TB)Writes
RAID5120TBslowish
RAID6216TBslower still
RAID101 per mirror pair12TBfast

RAID 10 makes mirrored pairs that write the same data to two disks (RAID 1) and spreads data across those pairs (RAID 0). As long as both disks of the same pair don’t fail, with luck it can even survive three failures.

Why RAID 5 writes are slow

When RAID 5 rewrites a small piece of data in one place, the parity must be fixed too. The new parity can be calculated as the XOR of “old data, new data and old parity,” so it needs these four disk operations:

  1. Read the old data
  2. Read the old parity
  3. Write the new data
  4. Write the new parity

This is called the write penalty. RAID 6 has two parities, so it’s 6 operations; RAID 10 just writes to two disks, so it’s 2. That’s why RAID 10 is often chosen for write-heavy databases.

RAID 6 for large disks

A rebuild after one failure reads every remaining disk from start to finish. The bigger the disks, the longer it takes — with HDDs over 10 TB it can take more than a whole day. If another disk fails meanwhile, or an unreadable spot turns up, RAID 5 loses data. RAID 6, which survives two failures, still has one disk’s worth of margin during the rebuild.

On top of that, if you install a spare disk (a hot spare), a rebuild starts automatically when a disk fails, so you don’t have to wait for the replacement part to arrive.

On the exam: calculating availability

Put two devices with availability 0.9 in a setup where “either one running is enough” (parallel), and the chance of both stopping is 0.1 × 0.1 = 0.01, so availability rises to 1 − 0.01 = 0.99. A RAID 1 mirror works this way.

In the opposite setup, where “both must run” (series), it drops to 0.9 × 0.9 = 0.81. RAID 0 is like this: the more disks, the more likely it is to fail.

Field note: RAID controller cache

On Dell PowerEdge, a RAID controller called PERC handles the RAID calculations. The controller has a cache (temporary memory) that accepts writes and replies “written” right away, which hides much of RAID 5’s slowness. To keep the cache contents from vanishing in a power outage, it’s protected by a battery or flash memory.

Practice questions

Four-choice questions in the style of Japan’s Fundamental Information Technology Engineer Examination. Tap below to see the answer.

Q1When RAID 6 is built from six 4 TB disks, what is the usable capacity?

  • A8TB
  • B12TB
  • C16TB
  • D20TB
Show the answer and explanation

Answer: CRAID 6 uses two disks’ worth for parity, so usable capacity is (6 − 2) × 4 TB = 16 TB. RAID 5 would give 20 TB, and RAID 10 12 TB.

Q2Two devices with availability 0.9 are connected in parallel, and the system works as long as either one is running. What is the overall availability?

  • A0.81
  • B0.9
  • C0.99
  • D1.8
Show the answer and explanation

Answer: CThe chance of both stopping is 0.1 × 0.1 = 0.01, so overall availability is 1 − 0.01 = 0.99. In series (both needed), it would be 0.9 × 0.9 = 0.81.

Q3What is the main reason writes take time when RAID 5 rewrites a small piece of data?

  • AThe data has to be compressed
  • BThe parity must be recalculated and written too
  • CEvery disk is initialized
  • DA rebuild runs on every write
Show the answer and explanation

Answer: BRAID 5 reads the old data and old parity, then writes the new data and new parity, so one rewrite needs four disk operations.

Summary
  • RAID 5 survives 1 failure, RAID 6 survives 2. RAID 10 is fast but gives half the capacity
  • A RAID 5 rewrite needs 4 operations (the write penalty)
  • Parallel availability is 1 − (1 − a) × (1 − a); series is a × a