RAID Concepts & Levels

Linux Filesystems

Chapter 7 · RAID Concepts & Levels

Every prior chapter has assumed working disks. This chapter is about combining several — RAID (Redundant Array of Independent Disks). It's a conceptual chapter on purpose: the five levels worth actually knowing, and the real tradeoffs each one makes. fs1-8 covers the real mdadm commands to build one.

What RAID Actually Trades Off

RAID combines multiple physical disks into one logical unit, but every level makes a genuinely different tradeoff between three things: performance (via striping data across disks), redundancy (via mirroring or parity), and usable capacity (how much of the raw disk space ends up available for real data versus spent on redundancy). No RAID level maximizes all three at once — that tension runs through every level below.

RAID 0 — Striping (Performance, Zero Redundancy)

Data is split ("striped") across all disks with no redundancy at all. Usable capacity is the full sum of every disk. Performance is the best of any level here, since reads and writes spread across multiple disks in parallel. But losing any single disk in the array loses all the data — reliability actually gets worse than a single disk, not better, since more disks means more independent chances of one failing.

Honest tradeoff: only worth it when redundancy already exists elsewhere (a database replica, a separate backup) and pure speed matters more than this specific array's own survival.

RAID 1 — Mirroring (Redundancy, Halved Capacity)

Every disk is an exact duplicate of every other. Usable capacity is the size of the smallest single disk — with two disks, that's 50% of the raw total. Survives any single disk failure completely (with two disks). Read performance can genuinely improve (reads spread across mirrors); write performance is roughly that of one disk, since every write has to go to every mirror.

Honest tradeoff: expensive in capacity — paying for N−1 disks' worth of pure redundancy — but the simplest, most predictable RAID level, with the least complicated failure story of any level here.

RAID 5 — Striping with Distributed Parity

Data is striped like RAID 0, but one disk's worth of capacity is used for parity data, distributed across all disks rather than living on one dedicated disk. Survives exactly one disk failure. Usable capacity is (N−1) disks' worth — better capacity efficiency than RAID 1 as disk count grows.

The real, well-known weakness is rebuild time. Replacing a failed disk requires reading every remaining disk to reconstruct the failed one's data — on large modern drives this can take many hours, and a second disk failure during that rebuild window loses the entire array. This risk grows directly with disk size, which is the genuine, practical reason RAID 5 is increasingly discouraged on today's largest drives. It's also where the "RAID write hole" lives — a power loss mid-write to a stripe can leave data and its parity inconsistent, exactly the problem ZFS's RAID-Z (fs1-4) was designed to avoid by tying parity into the same transactional model as everything else in ZFS.

RAID 6 — Striping with Double Distributed Parity

Like RAID 5, but with two parity blocks distributed across the array — survives two simultaneous disk failures. Usable capacity is (N−2) disks' worth. This directly addresses RAID 5's own rebuild-window vulnerability: even if a second disk fails during the rebuild after the first, RAID 6 can still survive it.

Honest tradeoff: write performance is worse than RAID 5 (two parity calculations per write instead of one), and it needs at least four disks to be worthwhile at all.

RAID 10 — Mirroring + Striping Combined

A nested/hybrid level: disks are paired and mirrored (RAID 1), then those mirrored pairs are striped together (RAID 0). Gets RAID 0's performance and real redundancy — survives multiple disk failures, as long as no single mirrored pair loses both of its own disks. Rebuilding a failed disk just means re-mirroring from its own surviving partner — much faster, and much lower-risk, than reconstructing from parity across the whole array the way RAID 5/6 do.

Honest tradeoff: usable capacity is only 50% of raw, same as RAID 1, and it needs at least four disks (two mirrored pairs minimum). Often the preferred choice for performance-critical database workloads specifically because of its fast, low-risk rebuilds.

Tying to perf1's Disk I/O & Storage Bottlenecks

perf1's own Disk I/O & Storage Bottlenecks chapter covered diagnosing a disk-bound workload — iostat, %util, IOPS — without addressing the underlying storage architecture itself. Striping (RAID 0/5/6/10) is a direct architectural answer to a genuinely disk-bound bottleneck diagnosed there: spreading read/write load across multiple physical disks in parallel raises the effective IOPS and throughput ceiling those same diagnostic tools would measure. But striping doesn't fix a bottleneck that was never really disk-bound in the first place — a workload misdiagnosed as disk-bound when it's actually CPU- or memory-bound gains nothing from RAID at all. The diagnostic step from perf1 still has to come first.

LevelMin disksUsable capacitySurvivesRebuild risk
RAID 02100% of rawNothingN/A — no redundancy to rebuild
RAID 1250% of raw1 diskLow — simple re-mirror
RAID 53(N−1)/N of raw1 diskHigh — long parity rebuild, 2nd failure loses array
RAID 64(N−2)/N of raw2 disksModerate — survives a 2nd failure mid-rebuild
RAID 10450% of rawMultiple, if not both disks in one pairLow — fast re-mirror, no parity math
There is no "best" level, only the right tradeoff
Choosing a RAID level is a genuine decision informed by workload (read-heavy vs. write-heavy), disk count, disk size (rebuild-time risk), and how much capacity is worth spending on redundancy — not a search for a single objectively-best option.
RAID is not a backup
Echoing fs1-3's own "snapshots are not backups" warning: RAID protects against a physical disk failing, nothing more. It does nothing against accidental deletion, ransomware, or a filesystem-level bug — any of those get written identically and consistently to every disk in the array, redundancy and all. A real backup on genuinely separate storage is still required regardless of RAID level.

Hands-On Exercises

Exercise 1

A team wants to maximize raw read/write speed for a scratch/cache workload where the data can be regenerated at any time if lost. Recommend a RAID level and explain why, using this chapter's own tradeoffs.

📄 View solution
Exercise 2

A team is running RAID 5 on very large (18TB) drives and is considering migrating to RAID 6. Explain the specific risk this chapter names that motivates that migration.

📄 View solution
Exercise 3

A team running RAID 10 for their production database was hit by ransomware that encrypted every file in place. They assumed their RAID array meant they were protected. Explain why they weren't, using this chapter's own warn-box.

📄 View solution

Chapter 7 Quick Reference

  • Every RAID level trades off performance, redundancy, and usable capacity — none maximizes all three
  • RAID 0 — striping, full capacity, zero redundancy, best performance, worst reliability
  • RAID 1 — mirroring, 50% capacity, survives 1 failure, simplest failure story
  • RAID 5 — striping + 1 distributed parity, (N−1)/N capacity, real rebuild-window risk on large disks
  • RAID 6 — striping + 2 distributed parity, (N−2)/N capacity, survives 2 failures, slower writes
  • RAID 10 — mirrored pairs, striped together, 50% capacity, fast low-risk rebuilds, good for databases
  • RAID striping raises the IOPS/throughput ceiling perf1's own tools measure — but only for a genuinely disk-bound workload
  • RAID is not a backup — it protects against disk failure only, not deletion, ransomware, or corruption written identically everywhere