RAID 5

striped + single parity

Derived by hand from the Linux md rule — how the pages are sourced

Data striped across every disk, with one parity block per stripe that moves from disk to disk. Any one disk can fail and everything on it is recomputed from the rest by XOR. It keeps all but one disk's worth of space, reads nearly as fast as a plain stripe, and pays for small writes with four disk operations each.

What it is

RAID 5 is the pair striped + single parity: the data is dealt out in chunks across all the members (striping), and in every stripe one chunk holds the XOR of the others (parity). It is the fifth level of the 1988 paper, and the one the paper builds up to: the fourth level had put all the parity on one disk, and "the check disk is the bottleneck"; the fifth "distributes the data and check information across all the disks". Which disk holds the parity in which stripe is the placement algorithm, almost always left-symmetric.

What it buys

Capacity, first. A mirror spends half the disks on copies; RAID 5 spends one disk's worth on parity whatever the count, so on four disks it keeps three quarters, on eight seven eighths. The fault tolerance is one disk, on any count, and the disk count is the risk: the more disks, the more space, the more likely a second failure while the first is being rebuilt.

What it pays

The write. A block changed in place must keep the parity of its stripe true, and to compute the new parity the engine needs two things it does not have in hand: the old data and the old parity. So one logical write becomes four disk operations, in this order:

  1. read the old data block
  2. read the old parity block
  3. write the new data block
  4. write the new parity block, computed as old data ⊕ new data ⊕ old parity

Two reads the write would not otherwise need, and two writes that must wait for them: this is the write penalty of single parity. It is paid by every small write, one that changes a block and leaves the rest of the stripe as it was. A write that covers a whole stripe pays none of the reads: every data block is already in hand, the parity is computed from them, and the cost is one write per member. That is the trade. RAID 5 is at its best under large sequential writes and worst under many small scattered ones, and the chunk size and the file system's alignment decide which of the two a workload gets.

The minimum, and below it

Three disks is the minimum that makes sense: two data, one parity per stripe. An array built with two disks is a different thing from a three-disk array that has lost one. The second is a RAID 5 running degraded: every stripe still has a data block and a parity block on the survivors, the missing block is recomputed by XOR on every read, and nothing is a copy of anything. The first has one data block per stripe, and the "parity" of a single block is that block itself: disk 0 and disk 1 hold the same content, and the array is a mirror by another name. The Linux kernel relies on exactly that, on request, when an administrator grows a mirror into a RAID 5: the first step, raid5_takeover_raid1(), relabels the two-disk RAID 1 as a two-disk RAID 5 without moving a byte, because on two disks the two layouts are the same; only then are disks added and the data redistributed. Such an array writes at a mirror's cost, two operations. The rebuild after a failure reads every surviving disk end to end; an unreadable sector found then is a block that cannot be recomputed, which is what scrubbing exists to catch earlier, and a power cut during a parity update leaves a write hole that only a protected cache, a journal or a partial parity log closes.

Segmentation

How an array splits its data across its member disks. Striped cuts the data into fixed-size chunks and deals them out to every member in turn; linear writes it as one run, filling the first member before touching the next. Segmentation is about how many disks take part in one request, not about whether the data survives a failure.

Read more — Segmentation

RAID 5 · 4 disks · left-symmetric

          disk 0  disk 1  disk 2  disk 3
stripe 0      D0      D1      D2       P
stripe 1      D4      D5       P      D3
stripe 2      D8       P      D6      D7
stripe 3       P      D9     D10     D11

Redundancy

How an array keeps its data readable when a member fails: by storing more than the data itself. Two techniques do it. Mirroring keeps whole copies on separate disks; parity keeps a computed summary from which any one missing block, or two with a second parity, can be rebuilt. Redundancy always costs capacity; the question is how much, and how many failures it buys.

Read more — Redundancy

(N − 1) × disk size
N = 4 disks of 2 TB → (4 − 1) × 2 TB = 6 TB usable

the members an adversary must kill, minus one
single parity: two members gone is one too many → 2 → tolerance 1

one logical write costs
random: read old data, read old parity, write both → 4 I/Os
sequential: a full stripe computes the parity once → 1 I/O

Algorithm

The rule that says, stripe by stripe, which member holds the parity and where the data starts, or where a mirror's copies go. The level says what is stored; the algorithm says where. Left-symmetric for the parity levels and near for RAID 10 are the defaults nearly everything uses. The choice changes speed and compatibility, not capacity or safety.

Read more — Placement algorithm

Left Asymmetric
Parity rotates leftward (same direction as left-symmetric). Data fills from disk 0 each stripe, going right and skipping the parity position — it does NOT continue from where the previous stripe left off.
Left Symmetric default
Parity rotates leftward (starts at the rightmost disk, moves one position left each stripe). Data fills from immediately right of parity, wrapping around — so consecutive data segments span all disks evenly.
Right Asymmetric
Parity rotates rightward (starts at disk 0, moves one position right each stripe). Data fills from disk 0 each stripe, going right and skipping the parity position.
Right Symmetric
Parity rotates rightward (starts at disk 0, moves one position right each stripe). Data fills from immediately right of parity, wrapping around. Mirror image of left-symmetric: same sequential-read locality, opposite parity rotation direction.

Where it runs

The component that turns a RAID layout into disk operations. It owns the array's metadata, translates every request from the array's addresses to the members', writes the copies or computes the parity, and keeps serving when a disk fails. It is a role, not a fixed device: a RAID-on-Chip on a controller card, the operating system's own driver, or a boot firmware working with that driver.

Read more — RAID engine

RAID Engine (RoC)
A dedicated PCIe card that includes BOTH the HBA (protocol translation) AND a RAID-on-Chip (RoC) processor. The RoC computes parity, manages the stripe, and exposes one or more Virtual Drives to the OS — the OS never sees the individual physical disks. Examples: Broadcom MegaRAID, Adaptec SmartRAID.
RAID Engine (RoC, tri-mode)
A RAID-on-Chip controller whose ports speak SAS, SATA and NVMe alike (Broadcom MegaRAID 9500/9600 "tri-mode", Adaptec SmartRAID 3200). NVMe drives plug straight into it — no HBA, no SAS/SATA backplane in between — and it still builds the array itself and exposes one virtual drive to the OS. It is the one way hardware RAID over NVMe exists.
RAID Engine (metadata)
A dedicated chip placed between the HBA and the CPU (on the motherboard or near it) that owns the RAID metadata and boot firmware — no compute silicon of its own. The OS still sees individual disks (unlike hardware RAID) but uses a driver to participate in RAID operations; the actual parity computation runs on the CPU. The canonical example is Intel RST (Rapid Storage Technology) on Intel chipsets. Also known as "motherboard RAID", "BIOS RAID", or, once its wiring reveals what it is, "fake RAID".
OS — Linux
Linux operating system managing the RAID array in software. Uses mdadm (for traditional RAID 0/1/5/6/10) or ZFS (with integrated volume management and checksums). The CPU computes all parity; no dedicated hardware required.
OS — Windows
Windows operating system managing RAID in software via Storage Spaces (Windows 8+/Server 2012+) or legacy Disk Management (dynamic volumes). Storage Spaces supports mirroring, striping, and parity spaces with optional journaling for crash consistency.

The write hole

RAID Engine (metadata)
The parity for each stripe is computed on the CPU and written after the data, so a power cut between the two can leave a stripe whose parity no longer matches, and a later rebuild trusts it. This chip owns the array metadata but has no write cache of its own to protect, so on fake RAID nothing here holds the write — that job falls to a UPS.
OS — Linux
Parity is computed from the data and written as a separate step, so a power cut between the two can leave a stripe whose parity no longer matches its data — and a later rebuild recomputes a missing disk from that wrong parity without noticing. Linux md can close this write hole with a journal device, or with mdadm's --consistency-policy=ppl on RAID 5; without one, a software parity array needs a UPS or a controller with a battery-backed write cache.
OS — Windows
Parity is computed on the CPU and written as a separate step, so a power cut between the two can leave a stripe whose parity no longer matches its data — and a later rebuild recomputes a missing disk from it without noticing. Nothing on a software path holds the write until both halves are safe; a UPS, or a controller with a battery-backed write cache, is what closes the gap.

Below the minimum

Minimum for the level
3 disks
The real system still starts it at
2 disks
drivers/md/raid5.c raid5_takeover_raid1(): a 2-device RAID 1 is converted to RAID 5 in place (any other count is refused); mdadm creates 2-device RAID 5
With 2 disks it is linear + mirror
with one data block per stripe the parity is that block itself — the second disk holds a copy
drivers/md/raid5.c raid5_takeover_raid1(): the kernel turns a 2-disk RAID 1 into a 2-disk RAID 5 in place, ALGORITHM_LEFT_SYMMETRIC, no data moved

In practice

Good at

  • Good balance of performance, capacity efficiency, and fault tolerance
  • Read performance close to RAID 0 (N−1 disks serve data per stripe)
  • No single parity disk bottleneck (distributed parity)

Costs

  • Write penalty: every small write triggers a read-modify-write cycle (4 I/Os)
  • Rebuild is slow and risky: a second failure during rebuild means total data loss
  • Rebuild time grows with disk capacity: every surviving disk is read end to end

Used for

  • File servers and NAS
  • General-purpose storage
  • The classic "balanced" RAID choice

Not for

  • Environments needing tolerance for 2+ simultaneous disk failures
  • Very write-heavy workloads (high parity calculation overhead)

Try it

Open this example in the sandbox

A desktop link: below the desktop breakpoint the sandbox is not offered (ADR-003).

See also

Related

Often confused with