Jelajahi Sumber

docs: RAID is business continuity and not a backup, a lesson on levels, parity and rebuilds and a framing section in the backups deep dive (#421) (#428)

Part A adds a framing section to the backups deep dive: RAID keeps a system running through some drive failures, an array counts as at most one copy for 3-2-1-1-0, with NIST SP 800-34, the Linux Raid Wiki and the 1987 Berkeley report as sources, and links the continuity lesson. Part B is a new lesson: levels 0, 1, 5, 6, 10 and RAIDZ, parity and the write penalty, rebuilds and the risk window, the write hole, hardware and software RAID, where an array sits in a continuity plan, three diagrams, a Python parity drill that was run, an mdadm loopback block that was not run, and a six-drive exercise whose answers the test computes from formulas. Registered in nav, Contents, Home, Sidebar, Reading-Order and the Glossary. Written from reading on 2026-11-01; unverified draft.

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
ChiefGyk3D 1 bulan lalu
induk
melakukan
669b9e322d

+ 9 - 0
docs/diagrams.json

@@ -200,6 +200,15 @@
   "docs/wiki/images/privacy-security-and-anonymity-three-different-things-and-why-there-is-no-silver-bullet-diagram-6.png": {
     "sha256": "3e7a9fb20982383047e8d9dd89dea76c4e9641ac76e2413b7e1be4f11a00e877"
   },
+  "docs/wiki/images/raid-levels-parity-rebuilds-and-why-raid-is-continuity-not-a-backup-diagram-1.png": {
+    "sha256": "3f9246679b5565a7901acb61fdc6e73a0fc5a96902aba8cc7755e9b90c11ceb5"
+  },
+  "docs/wiki/images/raid-levels-parity-rebuilds-and-why-raid-is-continuity-not-a-backup-diagram-2.png": {
+    "sha256": "430cfdd56f202e4722b1b9954b8142a2301594a0519c69773070fd50873ac594"
+  },
+  "docs/wiki/images/raid-levels-parity-rebuilds-and-why-raid-is-continuity-not-a-backup-diagram-3.png": {
+    "sha256": "a2713b40f877a1797d6f8429b8a542d73dc0f1364a75128b3288e1d092b97fe1"
+  },
   "docs/wiki/images/red-and-blue-yin-yang-and-your-lab-os-diagram-1.png": {
     "sha256": "32ea564eae0c1b56fcf7c57ef403c9eca283d1a2dfc96aeb4cfb34b44df63917"
   },

+ 27 - 2
docs/wiki/Backups-Deep-Dive-3-2-1-1-0-Immutability-and-Restore-Testing.md

@@ -1,10 +1,10 @@
 # Backups deep dive: 3-2-1-1-0, immutable copies, key custody and restore testing
 
-Side page to the start-from-zero pages. Read it after [Backups, recovery and patching](Backups-Recovery-and-Patching.md), which teaches snapshot versus backup, RPO and RTO, the plain 3-2-1 rule and a first timed restore, and after [The CIA triad](The-CIA-Triad-Confidentiality-Integrity-Availability.md), because availability is the property all of this protects. This page does not repeat them. It takes up what they leave open: the two extra digits of 3-2-1-1-0, what an immutable copy really protects against, who holds the key to an encrypted backup, backing up the backup system itself, how often to test a restore, how long to keep copies, the ransomware angle, the traps in cloud backups, and what this project would have to back up. Next: the lesson on business continuity and disaster recovery, which covers how the work carries on and how the systems come back; it is named here in plain text, and this page does not depend on it.
+Side page to the start-from-zero pages. **A RAID array is a business continuity solution, not a backup:** it keeps a system running through some drive failures, and it counts as at most one copy of your data, so none of the digits below is met by adding drives to an array. Read it after [Backups, recovery and patching](Backups-Recovery-and-Patching.md), which teaches snapshot versus backup, RPO and RTO, the plain 3-2-1 rule and a first timed restore, and after [The CIA triad](The-CIA-Triad-Confidentiality-Integrity-Availability.md), because availability is the property all of this protects. This page does not repeat them. It takes up what they leave open: why RAID is not one of the copies, the two extra digits of 3-2-1-1-0, what an immutable copy really protects against, who holds the key to an encrypted backup, backing up the backup system itself, how often to test a restore, how long to keep copies, the ransomware angle, the traps in cloud backups, and what this project would have to back up. Next: the lesson on [business continuity and disaster recovery](Business-Continuity-and-Disaster-Recovery-BCP-and-DR.md), which covers how the work carries on and how the systems come back, and the lesson on [RAID](RAID-Levels-Parity-Rebuilds-and-Why-RAID-Is-Continuity-Not-a-Backup.md), which covers how arrays work and why they are a continuity control.
 
 > Unfamiliar word or acronym? The [Glossary](Glossary.md) defines it.
 
-> **Status: unverified draft. One local script was run; everything else was read, not run.** On **2026-10-31** I ran the Bash script in the free path on a Debian-based Linux machine (GNU bash 5.2.37, GNU coreutils 9.7, GNU tar 1.35, OpenSSL 3.5.7, as an ordinary user) and pasted its output. **Not run:** the script on macOS or Windows, any PowerShell version (none is given), every cloud command shown or named (`aws s3api`, `rclone`, `doppler`, `terraform state pull`, `git clone --mirror`), the restore of anything real in this project, and every control in the project table (I read the files; I applied no stack and called no provider). The standards and vendor pages were downloaded and read on **2026-10-31** and sit in the [claims register](#claims-register) with their URLs and the date each page shows. A time interval or a test frequency that is my own suggestion is marked **est.**; the standards I read do not set one.
+> **Status: unverified draft. One local script was run; everything else was read, not run.** On **2026-10-31** I ran the Bash script in the free path on a Debian-based Linux machine (GNU bash 5.2.37, GNU coreutils 9.7, GNU tar 1.35, OpenSSL 3.5.7, as an ordinary user) and pasted its output. **Not run:** the script on macOS or Windows, any PowerShell version (none is given), every cloud command shown or named (`aws s3api`, `rclone`, `doppler`, `terraform state pull`, `git clone --mirror`), the restore of anything real in this project, and every control in the project table (I read the files; I applied no stack and called no provider). The standards and vendor pages were downloaded and read on **2026-10-31** and sit in the [claims register](#claims-register) with their URLs and the date each page shows. A time interval or a test frequency that is my own suggestion is marked **est.**; the standards I read do not set one. The section on RAID was added on **2026-11-01** for issue 421, from reading only: I read the NIST guide's passage on high availability again, the Linux Raid Wiki's page on protecting data and the 1987 Berkeley report that named RAID, and ran nothing.
 
 > **Prerequisites.** [Backups, recovery and patching](Backups-Recovery-and-Patching.md) first, then [Hashing, encryption and keys](Hashing-Encryption-and-Keys.md) for what a key is and [The terminal and your first script](Terminal-and-Your-First-Script.md) for running a script. The free path needs a Linux machine or WSL 2 with `bash`, GNU `tar`, `sha256sum`, `openssl` and `dd` (stock macOS lacks the GNU forms, so it is not written for macOS). No cloud account, no network, no installs. About 90 minutes with the exercise (est.).
 
@@ -12,6 +12,7 @@ Side page to the start-from-zero pages. Read it after [Backups, recovery and pat
 
 ## What you will be able to do
 
+- Say why a RAID array is business continuity and not a backup, name what it does not survive, and say how many copies it counts as.
 - Say what each digit of 3-2-1-1-0 asks for, who added the last two, and what the rule still does not cover.
 - Tell a full, an incremental and a differential backup apart, and say what each one costs you at restore time.
 - Say what an immutable copy stops, and name four things it does not stop.
@@ -31,6 +32,25 @@ Side page to the start-from-zero pages. Read it after [Backups, recovery and pat
 | Why availability matters, and the key-versus-availability trade-off | [The CIA triad](The-CIA-Triad-Confidentiality-Integrity-Availability.md) | The key-custody half in depth. |
 | State, locking, and a lost-state exercise | [Plans, state, drift and recovery](Plans-State-Drift-and-Recovery.md) | Where this project's state would have to be copied from, and what exists today. |
 | What a key is and how it is lost | [Hashing, encryption and keys](Hashing-Encryption-and-Keys.md) | What losing the key to a backup costs, and how to hold it. |
+| Mirroring, parity and the array that sits under a server | [RAID: levels, parity, rebuilds](RAID-Levels-Parity-Rebuilds-and-Why-RAID-Is-Continuity-Not-a-Backup.md) | How an array works. This page says what it counts for. |
+
+## RAID is business continuity, not a backup
+
+RAID is not a backup. A RAID array keeps a system running through some drive failures. That is **availability**, the third property of [the CIA triad](The-CIA-Triad-Confidentiality-Integrity-Availability.md#availability), and it belongs with the plan in [business continuity and disaster recovery](Business-Continuity-and-Disaster-Recovery-BCP-and-DR.md), not with the backups. A backup is a separate, restorable copy that survives deletion, corruption, ransomware and the loss of the site. An array does none of those, because it writes every change to every member, including a mistake, an encrypted file and a corrupted block, and its drives sit in one box on one site.
+
+NIST SP 800-34 Rev. 1 (May 2010) lists RAID among the technologies to consider in a recovery strategy, and then states the limit: "HA systems cannot be a replacement for a solid backup strategy, as a corruption of data on a system may propagate through an HA system, making the system unusable. Without a backup of the system separate from the system itself, recovery may not be possible." The Linux Raid Wiki, written by the people who run Linux software RAID, says: "RAID is not a panacea ... Secondly, backup, backup, BACK UP. And keep it off site." And the 1987 report that named RAID, by Patterson, Gibson and Katz, opens its reliability case with the reason arrays were wanted at all: the unreliability of disks "forces computer systems managers to make backup versions of all information every night in case of failure". The array was proposed to keep going through a disk failure, never to replace that nightly backup.
+
+| Event | RAID alone | A separate backup |
+|---|---|---|
+| A drive dies | **Yes**: the array keeps running, degraded, while the drive is replaced | Not needed for this event alone; it is the way back if the rebuild fails |
+| A file is deleted or overwritten | **No**: every drive gets the same change | Yes, if the copy is older than the mistake |
+| Ransomware encrypts the files | **No**: the encrypted data is written to every drive | Yes, if the copy was out of reach of whatever was taken over |
+| Data is corrupted by a bug or a bad write | **No**: the array stores the corruption | Yes, from a copy that predates it |
+| The controller or the whole box fails | **No**: it is one box | Yes, onto other hardware |
+| Fire, flood or theft of the machine | **No**: every drive is in one place | Yes, if one copy is elsewhere |
+| An administrator account is taken over | **No**: the array does what the administrator asks | Yes, if a copy is immutable or offline |
+
+**For 3-2-1-1-0, an array counts as at most one copy**, whatever its level and however many drives it holds. A two-way mirror is not two copies in the sense of the rule, and parity is not a copy at all. Put the array in the continuity plan, where it shortens the outage for a dead drive, and put the backup beside it. How arrays work, what a rebuild risks and a free drill that shows a mirror copying a mistake are on [the RAID lesson](RAID-Levels-Parity-Rebuilds-and-Why-RAID-Is-Continuity-Not-a-Backup.md).
 
 ## From 3-2-1 to 3-2-1-1-0
 
@@ -360,6 +380,7 @@ How to read it:
 
 | Symptom | Most likely cause | What to check |
 |---|---|---|
+| "We have RAID, so we have a backup" | An array mistaken for a copy: it protects against a dead drive and copies every mistake to every drive | Whether a deleted, encrypted or corrupted file can be restored from somewhere the array's logins cannot reach |
 | "We have 3-2-1" and one login can delete all three copies | The copies share a credential | Who can delete each copy, and with which login |
 | Versioning is on, so "they cannot delete it" | Versioning mistaken for a lock | Whether the same key can permanently delete a version |
 | The immutable copy restores corrupted data | It was made from damaged data | The check you ran before the copy was locked |
@@ -400,5 +421,9 @@ Standards and vendor pages were downloaded and read on **2026-10-31**; repositor
 | Secrets are listed by name and owner; values are not written | `docs/spacelift-secrets.md` | Read 2026-10-31 |
 | Twingate resources, groups and service accounts are defined in code | `stacks/10-access/main.tf`, `stacks/20-telemetry/main.tf` | Read 2026-10-31; not applied |
 | Droplet backups are `false` in the connector module | `modules/twingate-connector/main.tf` | Read 2026-10-31 |
+| A RAID array is a continuity control and not a backup (the maintainer's framing, issue 421); an array counts as at most one copy for 3-2-1-1-0 | The maintainer's comment on issue 421 of 2026-11-01, and the framing section above | Read 2026-11-01 |
+| RAID is among the technologies for a recovery strategy; "HA systems cannot be a replacement for a solid backup strategy"; a backup must be separate from the system itself | [NIST SP 800-34 Rev. 1, May 2010](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-34r1.pdf), sections 3.4.1 and 5.1.6 (read again for the RAID section) | Read 2026-11-01 |
+| "RAID is not a panacea"; "backup, backup, BACK UP. And keep it off site." | [Linux Raid Wiki, How to protect your data](https://raid.wiki.kernel.org/index.php/How_to_protect_your_data) (the site redirects to an archive; page last modified 30 November 2019; marked obsolete) | Read 2026-11-01 |
+| Disk unreliability "forces computer systems managers to make backup versions of all information every night"; arrays proposed to keep running through a disk failure | [Patterson, Gibson and Katz, *A Case for Redundant Arrays of Inexpensive Disks (RAID)*, Berkeley report CSD-87-391, 1987](https://www2.eecs.berkeley.edu/Pubs/TechRpts/1987/CSD-87-391.pdf) (a scan; report pages 1 to 9 and 14 to 17 read) | Read 2026-11-01 |
 | The Bash script and its output | The free path | **Observed** 2026-10-31, GNU bash 5.2.37, coreutils 9.7, tar 1.35, OpenSSL 3.5.7, Linux |
 | The script on macOS, or under another shell | | **Not run** |

+ 3 - 2
docs/wiki/Contents.md

@@ -6,7 +6,7 @@ page does not match the manifest. -->
 
 > Unfamiliar word or acronym? The [Glossary](Glossary.md) defines it.
 
-Every page of this wiki appears here once (151 pages), grouped by theme, with a line on what it is for and who it is for. If you do not know where to begin, take the numbered core path; [Reading order](Reading-Order.md) has the same pages with time estimates and checkpoints, and [Start here if you are new](Start-Here-If-You-Are-New.md) is the gentlest first page.
+Every page of this wiki appears here once (152 pages), grouped by theme, with a line on what it is for and who it is for. If you do not know where to begin, take the numbered core path; [Reading order](Reading-Order.md) has the same pages with time estimates and checkpoints, and [Start here if you are new](Start-Here-If-You-Are-New.md) is the gentlest first page.
 
 Some pages carry a status marker, copied from the page's own banner:
 
@@ -20,7 +20,7 @@ A page with no marker has no such banner. It may still say what was and was not
 
 - [Start here](#start-here) (5)
 - [Core path: read in this order](#core-path-read-in-this-order) (21)
-- [Foundations: OS and Linux](#foundations-os-and-linux) (12)
+- [Foundations: OS and Linux](#foundations-os-and-linux) (13)
 - [Foundations: networking](#foundations-networking) (5)
 - [Foundations: identity and secrets](#foundations-identity-and-secrets) (10)
 - [Foundations: infrastructure as code](#foundations-infrastructure-as-code) (7)
@@ -83,6 +83,7 @@ A page with no marker has no such banner. It may still say what was and was not
 | [Linux for enterprise beginners](Linux-for-Enterprise-Beginners.md) | The Linux families, package managers, services, permissions and logs you meet at work, for beginners; commands were not run by the author. | learner | est. steps |
 | [Patch management and automatic security updates](Patch-Management-and-Automatic-Security-Updates.md) | What unattended-upgrades does, how to configure it, where updates are logged, which four events deserve an alert, reboots, testing and rollback, for anyone running a Debian or Ubuntu host. | learner |  |
 | [Radio and off-grid communication](Radio-Off-Grid-Communication-LoRa-Meshtastic-Reticulum-Ham-and-SIGINT.md) | What still works when the internet and power are down: LoRa mesh, amateur radio, GMRS, FRS and CB, a legal-first SIGINT overview, and what a radio fallback could do for this project. | learner | draft |
+| [RAID: continuity, not a backup](RAID-Levels-Parity-Rebuilds-and-Why-RAID-Is-Continuity-Not-a-Backup.md) | RAID as a business continuity control and not a backup: levels, parity, the write penalty, rebuilds, the write hole and a computed six-drive exercise, with a free parity drill. | learner | draft |
 | [Red and blue, and choosing your lab OS](Red-and-Blue-Yin-and-Yang-and-Your-Lab-OS.md) | Red, blue and purple teams, the written permission you need before any test, and setting up a lab computer you can safely break. | learner |  |
 | [The terminal and your first script](Terminal-and-Your-First-Script.md) | What a terminal, shell and command are, moving around files safely and chaining commands into a first script, for beginners on any operating system. | learner |  |
 | [Virtual machines and hypervisors: desktop to datacenter](Virtual-Machines-Hypervisors-Desktop-and-Datacenter-Options.md) | What a virtual machine is, type 1 and type 2 hypervisors, the desktop and server options, a dated account of the VMware licensing changes, and a first VM with QEMU, for learners who need a lab. | learner | draft |

+ 12 - 0
docs/wiki/Glossary.md

@@ -177,6 +177,7 @@ Every term the wiki uses, in plain language, with a pointer to the page that exp
 | **Default route** | The route `0.0.0.0/0`, "everything else goes this way", used only when no more specific route matches. A machine without one reaches its own subnet and nothing beyond. [Subnets, NAT and firewalls by hand: routing](Subnets-NAT-and-Firewalls-By-Hand.md#routing-in-plain-words) |
 | **Defense in depth** | Several independent controls between an attacker and what they want, so one failing does not mean everything fails. [Plan for failure](Plan-for-Failure-Blast-Radius-and-Assuming-Breach.md#three-ideas-defined-once) |
 | **DeFi** | Decentralized finance: lending, borrowing, exchanging and pooling funds through smart contracts on a blockchain. The code and the keys behind it, not the idea, are where the security failures documented so far have happened. [How Monero works: DeFi](How-Monero-Works-Compared-with-Bitcoin-and-Ethereum-DeFi-Mixers-Swaps-and-Ransomware.md#defi-in-concept-and-why-code-and-custody-make-it-a-security-topic) |
+| **Degraded array** | A RAID array that has lost a member and still works, with less or no redundancy left. The state to leave quickly: a second failure in a single-parity array loses it. [RAID: when a drive fails](RAID-Levels-Parity-Rebuilds-and-Why-RAID-Is-Continuity-Not-a-Backup.md#when-a-drive-fails-degraded-rebuild-and-the-risk-window) |
 | **Delegation (DNS)** | The pointer, published by a parent zone, that says which nameservers answer for a child zone. Changing nameservers at your registrar edits it. [DNS and Cloudflare: delegation](DNS-Cloudflare-and-Hosting-Your-Own-Website.md#delegation-how-the-world-finds-your-nameservers) |
 | **Delete Act and DROP** | California's data broker law (Civil Code 1798.99.80 and following) and the Delete Request and Opt-out Platform built under it. Since January 1, 2026 a resident can send one deletion request to every registered broker; from August 1, 2026 brokers must process requests at least every 45 days. [US privacy law: state broker rules](US-Privacy-Law-No-General-Right-the-Patchwork-Data-Brokers-Social-Security-Numbers-and-License-Plate-Readers.md#state-broker-rules) |
 | **Deliverability** | Whether the mail you send reaches the inbox rather than being refused or filtered. It depends on authentication, the reputation of your address and domain, blocklists and recipient complaints, not only on correct settings. [Email security: what deliverability needs](Email-Security-DNS-Gateways-and-API-Driven-Protection.md#what-deliverability-needs) |
@@ -307,6 +308,7 @@ Every term the wiki uses, in plain language, with a pointer to the page that exp
 | **.htaccess** | A small per-folder configuration file that Apache can read on requests, if `AllowOverride` allows it. Nginx has no equivalent, so a rule kept there does nothing on Nginx. [LAMP and LEMP from zero](LAMP-and-LEMP-From-Zero.md#the-a-and-the-e-two-ways-to-serve-many-visitors) |
 | **Host-only network** | A virtual network that joins a virtual machine to the host and to other lab machines but has no route to the outside world. The usual home for a security lab. [Red and blue as yin and yang: a safe network for the lab](Red-and-Blue-Yin-and-Yang-and-Your-Lab-OS.md#a-safe-network-for-the-lab) |
 | **Hot list** | A list of vehicles of interest, such as stolen cars or missing persons, that a license plate reader compares each plate against to raise an alert. [US privacy law: license plate readers and Flock](US-Privacy-Law-No-General-Right-the-Patchwork-Data-Brokers-Social-Security-Numbers-and-License-Plate-Readers.md#what-an-automated-license-plate-reader-records) |
+| **Hot spare** | A drive installed in an array and waiting, so a rebuild starts the moment a member fails and the repair time shrinks. [RAID: the words](RAID-Levels-Parity-Rebuilds-and-Why-RAID-Is-Continuity-Not-a-Backup.md#the-words-striping-mirroring-parity-spares) |
 | **Hot wallet** | A wallet whose keys are, or have been, on a device connected to the internet. Easy to use, and exposed to anything that compromises that device. [Wallets and key custody: hot and cold](Wallets-and-Key-Custody-Hot-and-Cold-Hardware-Wallets-Recovery-Shamir-and-Multisig.md#hot-cold-and-the-kinds-of-wallet) |
 | **HSTS** | HTTP Strict Transport Security: a response header telling a browser to use only HTTPS for a site for a stated time. [WordPress and PHP security: security headers](WordPress-and-PHP-Security-WAF-and-Static-Sites.md#tls-and-security-headers) |
 | **HTLC (hash time-locked contract)** | A script that lets one party take locked coins by revealing the secret behind a hash, or lets the other party take them back after a timeout. The classic way to build an atomic swap. [How Monero works: the classic construction](How-Monero-Works-Compared-with-Bitcoin-and-Ethereum-DeFi-Mixers-Swaps-and-Ransomware.md#what-an-atomic-swap-is-and-the-classic-construction) |
@@ -408,6 +410,7 @@ Every term the wiki uses, in plain language, with a pointer to the page that exp
 | **Metasploit** | Rapid7's exploit framework. The Framework is open source; Metasploit Pro is a separate commercial product. Only ever used against a lab you own. [Security tools basics](Security-Tools-Basics-Nmap-OpenVAS-Burp-Metasploit.md#metasploit-framework-know-what-it-is-and-stop-there) |
 | **MFA** (basics) | Multi-factor authentication: a second proof beyond the password, such as a code from an app or a hardware key. [Identity basics: MFA and identity providers](Identity-Secrets-and-Zero-Trust-Basics.md#mfa-and-identity-providers) |
 | **Miner (Bitcoin)** | A participant who collects transactions into a block and searches for a header hash below the target. A miner may be a single machine or a pool that stands for many. [How Bitcoin works: mining](How-Bitcoin-Works-Keys-UTXOs-Mining-and-Why-It-Is-Pseudonymous-and-Traceable.md#mining-proof-of-work-difficulty-and-halvings) |
+| **Mirroring** | Writing the same data to two or more drives (RAID 1). One drive can die and the system keeps running; a mistaken delete is written to every copy. [RAID: the words](RAID-Levels-Parity-Rebuilds-and-Why-RAID-Is-Continuity-Not-a-Backup.md#the-words-striping-mirroring-parity-spares) |
 | **Mixer (tumbler)** | A service meant to break the visible link between where coins came from and where they go, by pooling, splitting or code-coordinated transactions. Governments have sanctioned and prosecuted some; "most activity is licit" still applies. [How Monero works: mixers and tumblers](How-Monero-Works-Compared-with-Bitcoin-and-Ethereum-DeFi-Mixers-Swaps-and-Ransomware.md#mixers-and-tumblers-in-concept) |
 | **Mock provider** | A fake stand-in for a provider inside `tofu test` that returns made-up values, so a test builds nothing and needs no credentials. [OpenTofu from zero: tofu test](OpenTofu-From-Zero.md#tests-without-building-anything-tofu-test-and-mock-providers) |
 | **mod_php** | PHP loaded inside the Apache process. The alternative is PHP-FPM, a separate service. [LAMP and LEMP from zero](LAMP-and-LEMP-From-Zero.md#the-four-words) |
@@ -475,6 +478,7 @@ Every term the wiki uses, in plain language, with a pointer to the page that exp
 | **Packet filter** | Software that looks at each network packet's header and decides to accept, drop or reject it by rules, with a default policy for packets that match nothing. [Packet filters compared: what a packet filter is](Packet-Filters-Compared-iptables-nftables-ufw-pf.md#what-a-packet-filter-is) |
 | **Page cache** | A cache of finished HTML pages, so most anonymous visitors never reach PHP or the database. It must bypass and not store pages for logged-in visitors. [WordPress at scale: the rule for who may be served a cached page](WordPress-at-Scale-CDN-WAF-and-CI.md#the-rule-for-who-may-be-served-a-cached-page) |
 | **Parse** | To read text in a known format and turn it into a program's own structures. A file that breaks the format's rules gives a syntax error. [Data formats and config files](Data-Formats-JSON-YAML-HCL.md#why-there-are-so-many-formats) |
+| **Parity** | A check value, the XOR of the data blocks, stored in an array so one lost drive can be calculated back from the others. One parity survives one failure; two survive two. [RAID: parity in one XOR](RAID-Levels-Parity-Rebuilds-and-Why-RAID-Is-Continuity-Not-a-Backup.md#parity-in-one-xor-and-the-price-of-a-small-write) |
 | **Passphrase** | A long phrase that encrypts a private key file on disk, so a copied file is not a stolen identity. [Hashing, encryption and keys: keeping keys](Hashing-Encryption-and-Keys.md#keeping-keys-storage-passphrases-and-hardware-keys) |
 | **Password manager** | A program that keeps your logins in an encrypted vault, makes a long random password for each account and fills it in. You remember one master password; set up MFA and offline recovery codes first. [Secrets from day one: step 1](Secrets-From-Day-One.md#step-1-a-password-manager-from-the-first-day) |
 | **Patch** | A change from the maker that removes a vulnerability. The gap between its release and your copy receiving it is where much real damage happens. [Threats in plain words](Threats-in-Plain-Words.md#patch) |
@@ -540,6 +544,8 @@ Every term the wiki uses, in plain language, with a pointer to the page that exp
 | **Qube** | One of the isolated virtual machines Qubes OS runs side by side, each for one purpose: an app qube, a template, a USB qube, a network qube. [Running Monero properly: the pieces](Running-Monero-Properly-Hardware-Wallet-Qubes-and-Whonix-Offline-Wallet-and-PiNodeXMR.md#the-pieces-in-plain-words) |
 | **Qubes OS** | A desktop operating system built from isolated virtual machines on the Xen hypervisor, designed on the assumption that software bugs will be exploited. Whonix can run inside it. [Tor, I2P and the darknet: Whonix, Qubes and how they differ](Tor-I2P-and-the-Darknet-Without-the-Myths.md#whonix-qubes-and-how-they-differ) |
 | **QEMU** | A free program that models a whole computer. With KVM it runs guests at near full speed; alone it can emulate other processors, slowly. It also ships `qemu-img` for disk images and snapshots. [Virtual machines and hypervisors: the desktop choices](Virtual-Machines-Hypervisors-Desktop-and-Datacenter-Options.md#the-desktop-choices) |
+| **RAID** | Redundant array of independent disks: several drives acting as one so a system keeps running through some drive failures. A business continuity control, not a backup: it copies every mistake to every drive. [RAID: continuity, not a backup](RAID-Levels-Parity-Rebuilds-and-Why-RAID-Is-Continuity-Not-a-Backup.md#raid-keeps-the-system-running-a-backup-keeps-the-data-recoverable) |
+| **RAIDZ** | ZFS's parity RAID with one, two or three parities (raidz1, 2, 3), built into the filesystem. Space is about (N - P) x the drive size; it does not replace a backup. [RAID: hardware, software and filesystem RAID](RAID-Levels-Parity-Rebuilds-and-Why-RAID-Is-Continuity-Not-a-Backup.md#hardware-firmware-software-and-filesystem-raid) |
 | **Rate limiting** | Capping how often one client (or one key) may do something in a time window, and refusing, delaying or challenging the surplus. It slows abuse; it does not prove who someone is. [Rate limiting at every layer](Rate-Limiting-at-Every-Layer.md) |
 | **RBAC** | Role-based access control: people hold roles, roles hold permissions. Easy to audit, prone to role sprawl and over-broad groups. [Enterprise identity](Enterprise-Identity-SSO-SAML-OIDC.md#groups-roles-and-mapping-people-to-access) |
 | **Read-only database user** | A database account granted only `SELECT` on what a dashboard charts. Grafana does not check that a query is safe, so this account is the real limit on what a panel's author can do. [Grafana basics: a SQL database](Grafana-Basics-From-a-Blank-Page.md#a-sql-database) |
@@ -547,6 +553,7 @@ Every term the wiki uses, in plain language, with a pointer to the page that exp
 | **Real risk of significant harm (RROSH)** | The PIPEDA test for a breach (section 10.1): report to the Privacy Commissioner and notify the individual when it is reasonable to believe the breach creates a real risk of significant harm. Judged by the sensitivity of the information and the probability of misuse. [Privacy law: PIPEDA breaches](Privacy-Law-Around-the-World-GDPR-PIPEDA-POPIA-and-PIPL-Compared-With-the-United-States.md#breach-of-security-safeguards) |
 | **Reasonable expectation of privacy** | The test from Katz v. United States (1967) for whether a government action is a Fourth Amendment search: a person expects privacy and society is prepared to treat that as reasonable. [US privacy law: what the Constitution says](US-Privacy-Law-No-General-Right-the-Patchwork-Data-Brokers-Social-Security-Numbers-and-License-Plate-Readers.md#what-the-constitution-does-and-does-not-say-about-privacy) |
 | **Reboot-required flag** | The file `/var/run/reboot-required`, which an update leaves behind when a reboot is needed to finish it; an alert can watch for it. [Patch management: where the results are logged](Patch-Management-and-Automatic-Security-Updates.md#where-the-results-are-logged) |
+| **Rebuild (resilver)** | Writing a failed array member's contents onto a replacement from the surviving drives. The risky stretch: every survivor is read in full while the array has little or no redundancy. ZFS calls it resilvering. [RAID: when a drive fails](RAID-Levels-Parity-Rebuilds-and-Why-RAID-Is-Continuity-Not-a-Backup.md#when-a-drive-fails-degraded-rebuild-and-the-risk-window) |
 | **Records of processing activities (ROPA)** | The written record the GDPR requires of controllers and processors (Article 30): purposes, categories of people and data, recipients, transfers, planned erasure times and security measures. Employers with fewer than 250 persons have a limited exemption. [Privacy law: data mapping and records of processing](Privacy-Law-Around-the-World-GDPR-PIPEDA-POPIA-and-PIPL-Compared-With-the-United-States.md#data-mapping-and-records-of-processing) |
 | **Recovery phrase** | The list of words (also called a seed phrase, mnemonic or wallet backup) from which every key in a wallet is derived. Whoever has it, and the passphrase if one is set, has the wallet. [Wallets and key custody: recovery phrases](Wallets-and-Key-Custody-Hot-and-Cold-Hardware-Wallets-Recovery-Shamir-and-Multisig.md#recovery-phrases-bip39) |
 | **Red team** | The attackers in an exercise: authorized, in writing, to behave like a real adversary so an organization can see what works against it. [Red and blue as yin and yang](Red-and-Blue-Yin-and-Yang-and-Your-Lab-OS.md#red-and-blue-and-the-idea-of-yin-and-yang) |
@@ -608,6 +615,7 @@ Every term the wiki uses, in plain language, with a pointer to the page that exp
 | **Scope (engagement)** | The written list of what a test may touch and what is out of bounds. Not the same as a token scope. [Red and blue as yin and yang: ground rules](Red-and-Blue-Yin-and-Yang-and-Your-Lab-OS.md#ground-rules-before-any-tool) |
 | **Scope (token)** (basics) | One named permission on a token. Grant the fewest that do the job (least privilege). [APIs and tokens: scopes](APIs-and-Tokens-From-Zero.md#scopes-and-least-privilege) |
 | **Script** | A text file of commands the shell runs in order. Automation is a script plus a trigger. [The terminal and your first script](Terminal-and-Your-First-Script.md#your-first-script) |
+| **Scrub (storage)** | Reading a whole array on purpose, on a schedule, to find unreadable or mismatched blocks while the redundancy can still repair them. Different from a restore test. [RAID: when a drive fails](RAID-Levels-Parity-Rebuilds-and-Why-RAID-Is-Continuity-Not-a-Backup.md#when-a-drive-fails-degraded-rebuild-and-the-risk-window) |
 | **Secret** (basics) | Any string that lets its holder do something: a password, a token, a private key. Lives in Doppler here, never in a file. [Identity basics: what a secret is](Identity-Secrets-and-Zero-Trust-Basics.md#what-a-secret-is) |
 | **Secret scanning** | A program that reads text, or every commit of a repository, and flags strings that look like credentials. A safety net that misses encoded, split and home-made values. [Secrets from day one: scanning](Secrets-From-Day-One.md#secret-scanning-three-layers-and-their-limits) |
 | **Secrets manager** (basics) | A service whose only job is to hold secrets and hand them to programs at run time, by name, with logging and expiry. [Identity basics: the fix](Identity-Secrets-and-Zero-Trust-Basics.md#the-fix-a-secrets-manager-and-the-discipline-around-it) |
@@ -677,6 +685,7 @@ Every term the wiki uses, in plain language, with a pointer to the page that exp
 | **Stream isolation** | Sending different applications or sites through different Tor circuits, so activities that share a circuit cannot be correlated to one user. Whonix lists it against cross-application correlation. [The browsing setups compared: Whonix](The-Browsing-Setups-Compared-Tor-Browser-Brave-Whonix-Tails-and-Qubes-with-Whonix.md#whonix) |
 | **Strict mode** | Shell settings that stop a script at the first error or unset variable instead of carrying on: `set -euo pipefail` in Bash, `Set-StrictMode -Version Latest` with `$ErrorActionPreference = 'Stop'` in PowerShell. [The terminal and your first script](Terminal-and-Your-First-Script.md#make-it-safe) |
 | **STRIDE** | Six prompts for finding threats: spoofing, tampering, repudiation, information disclosure, denial of service, elevation of privilege. [Threat model exercise: the STRIDE table](Threat-Model-Exercise.md#step-3-fill-in-the-stride-table) |
+| **Striping** | Cutting data into chunks and laying them out in turn across several drives (RAID 0) so large reads and writes run in parallel. By itself it has no redundancy. [RAID: the words](RAID-Levels-Parity-Rebuilds-and-Why-RAID-Is-Continuity-Not-a-Backup.md#the-words-striping-mirroring-parity-spares) |
 | **Stylometry** | Statistical analysis of how someone writes (word choice, sentence shape) to attribute a text to an author. Research abstracts report high accuracy even with many candidate authors, and no network path changes the words you write. [Privacy, security and anonymity: writing style](Privacy-Security-and-Anonymity-Three-Different-Things-and-Why-There-Is-No-Silver-Bullet.md#writing-style) |
 | **Subdomain takeover** | An attacker claims the outside service a forgotten DNS record still points at, and so serves content under your domain. Fix by deleting the record first. [DNS and Cloudflare: dangling record](DNS-Cloudflare-and-Hosting-Your-Own-Website.md#exercise-6-a-dangling-record) |
 | **Subnet** | A block of consecutive addresses that share a first part, written in CIDR form such as `10.78.0.0/24`. A `/24` holds 256 addresses, a `/26` 64, a `/28` 16. [Subnets, NAT and firewalls by hand: the method](Subnets-NAT-and-Firewalls-By-Hand.md#the-method-five-steps) |
@@ -740,6 +749,7 @@ Every term the wiki uses, in plain language, with a pointer to the page that exp
 | **ULA** | Unique local address (`fc00::/7`, in practice `fd` plus 40 random bits): IPv6's private address space, unique per site and not routed on the internet. [IPv6: first, the words](IPv6-Adoption-and-Handling-It-Safely.md#first-the-words) |
 | **unattended-upgrades** | The Debian and Ubuntu package that installs updates (security by default on Ubuntu) without a person present, and can reboot at a set time. It does not update a third-party repository you did not allow, or a container image. [First hour on a new system](First-Hour-on-a-New-System-Updates-and-Baseline.md#what-automatic-updates-means-system-by-system) |
 | **Unlinkability** | The inability of an observer to tell whether two items, such as two visits or two accounts, belong to the same person (RFC 6973). Reusing a cookie, a handle, a writing style or a payment destroys it, whatever pipe carried the traffic. [Privacy, security and anonymity: correlation](Privacy-Security-and-Anonymity-Three-Different-Things-and-Why-There-Is-No-Silver-Bullet.md#correlation-how-small-facts-become-one-identity) |
+| **Unrecoverable read error (URE)** | A sector a drive cannot read. Datasheets give a maximum rate, such as 1 in 10^14 bits. In a single-parity rebuild one can lose data in that stripe, because there is nothing left to read it from. [RAID: exercise](RAID-Levels-Parity-Rebuilds-and-Why-RAID-Is-Continuity-Not-a-Backup.md#exercise-size-a-six-drive-shelf-on-paper) |
 | **USB qube** | A Qubes qube (usually `sys-usb`) that owns the USB controller, so the USB drivers and any hostile device meet it and not dom0. It has no network; a device is attached on to the qube that needs it. [Running Monero properly: the USB qube](Running-Monero-Properly-Hardware-Wallet-Qubes-and-Whonix-Offline-Wallet-and-PiNodeXMR.md#the-usb-qube-and-why-it-matters) |
 | **Use after free** | A memory flaw: a program gives a block of memory back, then uses it anyway, when it may hold something else. The class of both October 2026 PHP runtime flaws. [WordPress and PHP security: the October 2026 case](WordPress-and-PHP-Security-WAF-and-Static-Sites.md#the-october-2026-php-release-two-critical-flaws) |
 | **User-data** | The cloud-init configuration passed to a droplet at creation. Readable from the metadata endpoint. [Droplet hardening: first boot](Droplet-Hardening.md#first-boot-in-order) |
@@ -768,6 +778,8 @@ Every term the wiki uses, in plain language, with a pointer to the page that exp
 | **Worker (Spacelift)** | The container, on a shared public pool or on a machine you host, that runs a stack's plan and apply. [Spacelift from zero](Spacelift-From-Zero.md#plans-workers-and-limits-as-read-on-2026-10-22) |
 | **workflow_call** | The trigger that makes a GitHub Actions workflow reusable: another workflow starts it with `uses:` and passes the inputs it declares. [From commit to pipeline](From-Commit-to-Pipeline.md#what-a-reusable-workflow-is) |
 | **WP-CLI** | The command line for WordPress: install, configure and manage a site from a terminal. [LAMP and LEMP from zero](LAMP-and-LEMP-From-Zero.md#exercise-4-install-wordpress-on-each-with-wp-cli-then-see-the-htaccess-difference) |
+| **Write hole** | In a parity array, data and parity that no longer match after a power cut between the two writes. A later rebuild can finish with no error and wrong data. A journal or a partial parity log closes it. [RAID: the write hole](RAID-Levels-Parity-Rebuilds-and-Why-RAID-Is-Continuity-Not-a-Backup.md#the-write-hole-and-power-loss) |
+| **Write penalty** | The extra disk operations a write costs in a redundant array: 2 for a mirror, 4 for single parity (read old data and old parity, write both), and 6 for double parity by derivation. [RAID: the price of a small write](RAID-Levels-Parity-Rebuilds-and-Why-RAID-Is-Continuity-Not-a-Backup.md#parity-in-one-xor-and-the-price-of-a-small-write) |
 | **X-Forwarded-For** | An HTTP header holding a list of addresses a request passed through, nearest proxy last. Entries added before your first trusted proxy came from somebody else, so read it from the right. [Behind a CDN](Behind-a-CDN-Real-Client-IPs-and-OSI-Basics.md#the-trust-problem) |
 | **X-Forwarded-For** | A request header listing the client and each proxy that handled the request. Anyone can write it, so a limiter may trust only the values added by its own proxy. [Rate limiting: trusting X-Forwarded-For](Rate-Limiting-at-Every-Layer.md#trusting-x-forwarded-for) |
 | **XML** | A format that wraps data in matching tags, `<resource name="a"/>`. Strict (every tag must close) and wordy; a parser that follows outside references can be tricked, so configure it not to. [Data formats: TOML, INI, CSV and XML](Data-Formats-JSON-YAML-HCL.md#toml-ini-csv-and-xml-a-paragraph-each) |

+ 2 - 1
docs/wiki/Home.md

@@ -27,7 +27,7 @@ If you only read one page, read [Why ZTNA and not a VPN](Why-ZTNA-Not-a-VPN.md):
 
 ## Every page, by theme
 
-All 151 pages of this wiki, grouped the way [Contents](Contents.md) groups them, with one line on what each is for. Pages marked draft, est. steps or unbuilt say so in their own banner; [Contents](Contents.md) explains the markers.
+All 152 pages of this wiki, grouped the way [Contents](Contents.md) groups them, with one line on what each is for. Pages marked draft, est. steps or unbuilt say so in their own banner; [Contents](Contents.md) explains the markers.
 
 ### Start here, by kind of reader
 
@@ -80,6 +80,7 @@ All 151 pages of this wiki, grouped the way [Contents](Contents.md) groups them,
 - [Linux for enterprise beginners](Linux-for-Enterprise-Beginners.md) (est. steps): The Linux families, package managers, services, permissions and logs you meet at work, for beginners; commands were not run by the author.
 - [Patch management and automatic security updates](Patch-Management-and-Automatic-Security-Updates.md): What unattended-upgrades does, how to configure it, where updates are logged, which four events deserve an alert, reboots, testing and rollback, for anyone running a Debian or Ubuntu host.
 - [Radio and off-grid communication](Radio-Off-Grid-Communication-LoRa-Meshtastic-Reticulum-Ham-and-SIGINT.md) (draft): What still works when the internet and power are down: LoRa mesh, amateur radio, GMRS, FRS and CB, a legal-first SIGINT overview, and what a radio fallback could do for this project.
+- [RAID: continuity, not a backup](RAID-Levels-Parity-Rebuilds-and-Why-RAID-Is-Continuity-Not-a-Backup.md) (draft): RAID as a business continuity control and not a backup: levels, parity, the write penalty, rebuilds, the write hole and a computed six-drive exercise, with a free parity drill.
 - [Red and blue, and choosing your lab OS](Red-and-Blue-Yin-and-Yang-and-Your-Lab-OS.md): Red, blue and purple teams, the written permission you need before any test, and setting up a lab computer you can safely break.
 - [The terminal and your first script](Terminal-and-Your-First-Script.md): What a terminal, shell and command are, moving around files safely and chaining commands into a first script, for beginners on any operating system.
 - [Virtual machines and hypervisors: desktop to datacenter](Virtual-Machines-Hypervisors-Desktop-and-Datacenter-Options.md) (draft): What a virtual machine is, type 1 and type 2 hypervisors, the desktop and server options, a dated account of the VMware licensing changes, and a first VM with QEMU, for learners who need a lab.

+ 502 - 0
docs/wiki/RAID-Levels-Parity-Rebuilds-and-Why-RAID-Is-Continuity-Not-a-Backup.md

@@ -0,0 +1,502 @@
+# RAID: levels, parity, rebuilds, and why it is continuity and not a backup
+
+Side page to the backup and continuity pages. **RAID is a business continuity control, not a backup.** It keeps a system running through some drive failures, which is availability, the third letter of [the CIA triad](The-CIA-Triad-Confidentiality-Integrity-Availability.md#availability) and a piece of the plan in [business continuity and disaster recovery](Business-Continuity-and-Disaster-Recovery-BCP-and-DR.md). A backup is a separate, restorable copy that survives deletion, corruption, ransomware and the loss of the site, which an array does not. This page teaches RAID in that order: first what it is for and what it cannot do, then how the levels work (striping, mirroring and parity), what a small write costs, what happens when a drive fails and a replacement is rebuilt, why a power cut can leave a silent error, how hardware, software and filesystem RAID differ, where an array belongs in a plan, and a paper exercise with every answer computed. Read it after [Backups, recovery and patching](Backups-Recovery-and-Patching.md) and next to [the backups deep dive](Backups-Deep-Dive-3-2-1-1-0-Immutability-and-Restore-Testing.md), which says an array counts as at most one copy of your data.
+
+> Unfamiliar word or acronym? The [Glossary](Glossary.md) defines it.
+
+> **Status: unverified draft, written from reading, with one small script run.** This is issue 421, started from the maintainer's framing of 2026-11-01. On **2026-11-01** I downloaded and read the sources in the [claims register](#claims-register): the 1987 Berkeley report that named RAID, NIST SP 800-34 Rev. 1, the Linux kernel's `md` documents (the admin guide, the partial parity log and the RAID 5 cache pages), the `mdadm` and `losetup` manual pages, four pages of the archived Linux Raid Wiki, the OpenZFS RAIDZ and scrub pages, Microsoft's Storage Spaces fault tolerance page and Backblaze's published drive statistics page. I ran **one** thing: the Python parity drill in the [free path](#free-path-a-parity-drill-on-your-own-computer), on a Debian-based Linux machine with CPython 3.13, as an ordinary user, in a throwaway folder; its output is pasted. **Not run:** every `mdadm`, `losetup` and `truncate` command (they are shown from the manual pages and need root), any ZFS, Storage Spaces or hardware controller command, and every array and drive failure described, none of which I built or caused. **Not read:** a drive datasheet for any model, the SNIA RAID definitions, any hardware controller's manual, and the text of the Berkeley report for levels 2 and 3 (list in [Not verified, plainly](#not-verified-plainly)). Times and rates marked **est.** are my own round numbers.
+
+> **Prerequisites.** [Backups, recovery and patching](Backups-Recovery-and-Patching.md) for snapshot versus backup, RPO and RTO and the 3-2-1 rule. [Hashing, encryption and keys](Hashing-Encryption-and-Keys.md) helps for the idea of a checksum. [The terminal and your first script](Terminal-and-Your-First-Script.md) for running a script. The free path needs Python 3 and nothing else: no root, no network, no extra package. About 90 minutes with the exercise (est.).
+
+> **Where this runs, and the rule.** The drill runs in one folder the script makes with `tempfile.mkdtemp` and deletes at the end; its "drives" are small files, and it touches no real disk, device or other folder. The optional `mdadm` block is shown and not run: it needs root, so read it, and if you ever run it, run it only on files you made yourself. **Never run any RAID command on a disk that holds data you want.** This page is defensive and educational; it attacks nothing.
+
+## What you will be able to do
+
+- Say why RAID is not a backup, and name five events an array does nothing about.
+- Say what striping, mirroring, parity, a hot spare, a degraded array, a rebuild and a scrub are.
+- Compare RAID 0, 1, 5, 6 and 10 (and RAIDZ) by usable space, how many drive failures they survive and what a small write costs.
+- Work out, from the formulas, the usable space, the fault tolerance and the random-write rate of a six-drive shelf.
+- Explain why a rebuild is the risky part, and what correlated failure, unreadable sectors and a slow replacement each do to the odds.
+- Say what the write hole is and why a journal, a partial parity log or a checksumming filesystem closes it.
+- Place an array in a continuity plan with the backup that must sit next to it.
+- Run a free drill that loses a "drive", rebuilds it from parity, shows the write hole and shows a mirror copying a mistake.
+
+## What the wiki already says (and the gap)
+
+| Idea | Where it is today | The gap this page fills |
+|---|---|---|
+| Snapshot, backup, replica, archive; RPO and RTO; the plain 3-2-1 rule | [Backups, recovery and patching](Backups-Recovery-and-Patching.md) | It does not say what an array is, or that a mirror or parity set is not one of the copies. |
+| 3-2-1-1-0, immutable copies, key custody, restore testing | [Backups deep dive](Backups-Deep-Dive-3-2-1-1-0-Immutability-and-Restore-Testing.md) | It says an array counts as at most one copy. This page shows why and how an array works. |
+| BCP versus DR, BIA, RTO and RPO per system, recovery strategies | [Business continuity and disaster recovery](Business-Continuity-and-Disaster-Recovery-BCP-and-DR.md) | RAID is one availability control inside that plan. This page says where. |
+| Availability as one of three properties | [The CIA triad](The-CIA-Triad-Confidentiality-Integrity-Availability.md) | A dead disk is its example of lost availability. This page is the control for it. |
+| The word RAID | Nowhere before this issue: a search of the wiki on 2026-11-01 found no page that explains it, and the [Glossary](Glossary.md) had no row | Everything below. |
+
+## RAID keeps the system running; a backup keeps the data recoverable
+
+The name stands for "redundant array of independent disks" (the 1987 report said "inexpensive"). **RAID is not a backup.** The report that proposed it offered arrays of cheap disks as an alternative to one "single large expensive disk", with better performance, reliability, power consumption and scalability. Patterson, Gibson and Katz (Berkeley, 1987) wrote that the unreliability of disks "forces computer systems managers to make backup versions of all information every night in case of failure", and then proposed arrays with extra "check" disks so that a failed disk's contents can be rebuilt on a replacement. Read what that says: the array was never offered as the thing that replaces the nightly backup. It was offered as a way for the system to **keep running** while one disk is replaced.
+
+That is **business continuity**: the work goes on through a disruption, which in the vocabulary of [the CIA triad](The-CIA-Triad-Confidentiality-Integrity-Availability.md#availability) is availability. NIST SP 800-34 Rev. 1 (May 2010) lists "redundant arrays of independent disks (RAID), automatic failover, UPS, server clustering, and mirrored systems" among the technologies to consider when developing a system recovery strategy, and says such methods "store data on more than one drive and eliminate loss of data from single drive failures". The same guide is blunt about the limit. Of high availability systems it says: "HA systems cannot be a replacement for a solid backup strategy, as a corruption of data on a system may propagate through an HA system, making the system unusable. Without a backup of the system separate from the system itself, recovery may not be possible."
+
+The Linux Raid Wiki, run by the people who maintain Linux software RAID, says the same in its own voice: "RAID is not a panacea. There is no point in having multiple copies of your data in your computer if your computer is then stolen or destroyed." Then: "backup, backup, BACK UP. And keep it off site." (the page, last changed 30 November 2019). So there are two different jobs:
+
+- **RAID (continuity, availability):** survive some drive failures **without stopping**. It answers "what if a drive dies at 2 p.m. on a working day?"
+- **A backup (recovery):** a separate copy, made at a point in time, that you can restore after deletion, corruption, ransomware or the loss of the site. It answers "what if the data is wrong or gone, everywhere?"
+
+The array does not give you a second copy that is independent of the first. Every write goes to every member, including a bad one. The [backups deep dive](Backups-Deep-Dive-3-2-1-1-0-Immutability-and-Restore-Testing.md#from-3-2-1-to-3-2-1-1-0) counts an array as **at most one copy** for 3-2-1-1-0, however many drives are in it. [Backups, recovery and patching](Backups-Recovery-and-Patching.md#the-3-2-1-rule-and-what-it-leaves-open) has the plain 3-2-1 rule, and the [continuity lesson](Business-Continuity-and-Disaster-Recovery-BCP-and-DR.md#rto-rpo-and-the-time-nobody-counts) has the RTO and RPO you would set for each system.
+
+| Event | What RAID does about it | What a separate backup does about it |
+|---|---|---|
+| A drive dies | **Yes**: the array keeps serving, degraded, while it is replaced and rebuilt | Not needed for this alone; it is the way back if the rebuild fails |
+| A second drive dies before the rebuild ends | **No** for a single-parity array and a two-way mirror (RAID 6 and a three-way mirror survive one more) | Restores, after the outage |
+| A file is deleted or overwritten by mistake | **No**: every drive gets the same deletion | Restores, if the copy is older than the mistake |
+| A ransomware program encrypts the files | **No**: the encrypted data is written to every drive | Restores, only if the copy was out of reach of whatever was taken over |
+| A bad update, a bug or a drive that returns wrong data corrupts the data | **No**: the array stores and protects the corruption | Restores, from a copy that predates it |
+| The controller, the enclosure or the power supply fails | **No**: it is one box, and some arrays can only be read by the same kind of controller | Restores onto other hardware |
+| Fire, flood or theft of the machine | **No**: every drive is in the same place | Survives, only if one copy is somewhere else |
+| Power fails in the middle of a write | **No**, unless the array closes the write hole (a journal, a partial parity log or a battery-backed cache) | Not affected, if the copy was made earlier |
+| An administrator account is taken over and the volume is deleted | **No**: the array does what the administrator asks | Survives, only if a copy is immutable or offline |
+
+Only the first row is one the array answers. The other eight are the reason a backup exists.
+
+![Five events, from one dead drive to ransomware and fire, each showing what RAID does and what a separate backup does.](images/raid-levels-parity-rebuilds-and-why-raid-is-continuity-not-a-backup-diagram-1.png)
+
+<details>
+<summary>Diagram source (Mermaid)</summary>
+
+```mermaid
+flowchart LR
+    a1["A drive dies"]:::ev --> a2["RAID: still serving,<br/>array degraded"]:::yes --> a3["Backup: not needed yet,<br/>it is the way back if<br/>the rebuild fails"]:::mid
+    b1["A file is deleted<br/>by mistake"]:::ev --> b2["RAID: deleted on<br/>every drive"]:::no --> b3["Backup: restore the<br/>copy from before"]:::yes
+    c1["A ransomware program<br/>encrypts the files"]:::ev --> c2["RAID: encrypted on<br/>every drive"]:::no --> c3["Backup: restore, if<br/>the copy was out of reach"]:::mid
+    d1["Fire, flood<br/>or theft"]:::ev --> d2["RAID: gone with<br/>the machine"]:::no --> d3["Backup: survives, if<br/>one copy is elsewhere"]:::mid
+    e1["The controller<br/>fails"]:::ev --> e2["RAID: one box,<br/>one point of failure"]:::no --> e3["Backup: restore onto<br/>other hardware"]:::yes
+
+    classDef ev fill:#1e1b3a,stroke:#a78bfa,color:#ede9fe
+    classDef yes fill:#132a1f,stroke:#4ade80,color:#dcfce7
+    classDef mid fill:#3a2a0f,stroke:#fbbf24,color:#fef3c7
+    classDef no fill:#3a1a1a,stroke:#f87171,color:#fee2e2
+```
+
+</details>
+
+One more reason the two are different: the model behind the numbers. The 1987 report's reliability arithmetic assumes that failures are "exponential and independent", and adds that "an earthquake or power surge is a situation where an array of disks might not fail independently". Fire, theft and a bad update are exactly the events that hit every drive at once, which is why a copy somewhere else is a different kind of thing from another drive.
+
+## The words: striping, mirroring, parity, spares
+
+- **Striping.** Data is cut into **chunks** and the chunks are laid out in turn across the drives, so one large read or write is spread over several at once. The `mdadm` manual lists "RAID0 (striping)" as striping with no redundancy, and the kernel's `md` guide names the levels that use striping as 0, 4, 5, 6 and 10 and sets a **chunk size** for them. Striping alone is for speed and size, and one lost drive loses the whole set.
+- **Mirroring.** The same data is written to two (or more) drives. The `mdadm` manual's name is "RAID1 (mirroring)". Microsoft's Storage Spaces page calls it "keeping multiple copies of all data", and says a two-way mirror has 50 percent storage efficiency and a three-way mirror 33.3 percent.
+- **Parity.** One extra drive's worth of space holds a **check value** calculated from the others, so a lost drive can be calculated back. Parity is a bitwise exclusive or (XOR) of the data: "each parity bit is just a single exclusive or of all the corresponding data bits in a group", in the 1987 report's words. One parity survives one failure. Two parities (RAID 6, "dual parity" in Storage Spaces, which uses Reed-Solomon codes) survive two.
+- **Hot spare.** A drive installed and waiting. When a member fails the array starts rebuilding onto it at once. The 1987 report named the reason: the MTTR (the mean time to repair) "can be reduced if the system includes extra disks to act as 'hot' standby spares", and the repair time is in the reliability formula below. The `md` guide's word for it is `recover`: "a hot spare is being built to replace a failed/missing device".
+- **Degraded.** An array that has lost a member and still works. The `md` driver keeps a `degraded` count: "an optimal array will show 0. A single failed/missing drive will show 1". A degraded array has no redundancy left (RAID 5) or less of it (RAID 6), so it is the state to get out of fast.
+- **Rebuild, or resilver.** Writing the lost member's contents onto a replacement. The ZFS name is **resilver**, and its manual says resilvering "only examines data that ZFS knows to be out of date".
+- **Scrub.** Reading the whole array on purpose, before a failure, to find errors while there is still redundancy to fix them. The Linux Raid Wiki says "any array should be 'scrubbed' at regular intervals" (the page is archived; I did not read a recommended interval). ZFS's scrub "verifies each block's checksum" and repairs from the redundancy.
+
+## The levels, side by side
+
+The five levels in the 1987 report are numbered 1 to 5: mirrored disks (1), a Hamming-code check (2), bit-interleaved parity on one check disk (3), block-interleaved parity on one check disk (4) and block-interleaved parity **spread over all the disks** (5). Levels 0 and 6 and the combined "10" came later, and I did not read where (general knowledge). In practice you meet these:
+
+| Level | Fewest drives | Usable space (n drives of size s) | Drive failures it survives | Cost of one small write | What it is for |
+|---|---|---|---|---|---|
+| RAID 0 (striping) | 2 | all n drives: n x s | None: one lost drive loses everything | 1 write | Speed or size for data you can lose. Not redundant, so not continuity. |
+| RAID 1 (mirroring) | 2 | one drive's worth: s | One of two; with three copies, two | 2 writes | The simplest continuity; the array is as big as one drive |
+| RAID 5 (single parity) | 3 | (n - 1) x s | One. A second failure before the rebuild ends loses the array | 2 reads and 2 writes | Capacity with one drive of cover |
+| RAID 6 (double parity) | 4 | (n - 2) x s | Two | 3 reads and 3 writes (derived) | Capacity with two drives of cover, for wide arrays and long rebuilds |
+| RAID 10 (a stripe over mirrored pairs) | 4 | n / 2 x s | One for certain; up to one per pair if the failures land in different pairs | 2 writes | Speed with simple cover, at half the space |
+| RAIDZ1, 2, 3 (ZFS) | one more than the parity count | (n - p) x s, "approximately" | p, where p is 1, 2 or 3 | Not read | Parity with the filesystem and the RAID in one; the same arithmetic as RAID 5 and 6 |
+
+Three notes on the table. **Not a backup:** every row above, including the ones that survive two failures, is one copy in one box. **"Survives" is about drives, not data:** a row that survives two drives survives two dead drives and nothing else in the event table above. **RAID 10** here means a stripe over mirrored pairs; Linux `md` also has its own `raid10` driver, listed by `mdadm` as a level, and I did not read its layouts. The ZFS formula and parity counts are from the OpenZFS RAIDZ page ("approximately (N-P)*X bytes ... can withstand P devices failing"). The small-write column is explained in the next section; RAID 6's figure is my derivation (**est.**), not a number I found in a source.
+
+![RAID level layouts for RAID 0, 1, 5, 6 and 10: how data is placed, how many drives each can lose and how much space is usable.](images/raid-levels-parity-rebuilds-and-why-raid-is-continuity-not-a-backup-diagram-2.png)
+
+<details>
+<summary>Diagram source (Mermaid)</summary>
+
+```mermaid
+flowchart LR
+    r0a["RAID 0<br/>chunks striped over<br/>every drive"]:::lay --> r0b["Loses everything<br/>with one drive"]:::bad --> r0c["Usable: all n drives"]:::cap
+    r1a["RAID 1<br/>each chunk written<br/>to two drives"]:::lay --> r1b["Survives one of two"]:::ok --> r1c["Usable: one drive"]:::cap
+    r5a["RAID 5<br/>chunks plus one parity,<br/>parity spread around"]:::lay --> r5b["Survives one drive"]:::mid --> r5c["Usable: n minus 1"]:::cap
+    r6a["RAID 6<br/>chunks plus two parities,<br/>spread around"]:::lay --> r6b["Survives two drives"]:::ok --> r6c["Usable: n minus 2"]:::cap
+    r10a["RAID 10<br/>a stripe over<br/>mirrored pairs"]:::lay --> r10b["Survives one for sure,<br/>one per pair at best"]:::mid --> r10c["Usable: half of n"]:::cap
+
+    classDef lay fill:#1e1b3a,stroke:#a78bfa,color:#ede9fe
+    classDef ok fill:#132a1f,stroke:#4ade80,color:#dcfce7
+    classDef mid fill:#3a2a0f,stroke:#fbbf24,color:#fef3c7
+    classDef bad fill:#3a1a1a,stroke:#f87171,color:#fee2e2
+    classDef cap fill:#0d2a3a,stroke:#38bdf8,color:#e0f2fe
+```
+
+</details>
+
+## Parity in one XOR, and the price of a small write
+
+XOR is true when its two inputs differ. Its useful property for RAID: XOR of a set of blocks gives the parity, and XOR of the parity with all the blocks but one gives the missing block back. Three data blocks `A`, `B`, `C` and parity `P = A xor B xor C`. If `B` is lost, `B = A xor C xor P`. The drill below does exactly this.
+
+A **small write** is a write of less than a whole stripe. To change one block in a parity array you cannot just write it, because the parity must change too. The 1987 report gives the shortcut:
+
+> new parity = (old data xor new data) xor old parity
+
+and counts the cost: "a small write then uses 2 disks to perform 4 accesses--2 reads and 2 writes". You read the old data and the old parity, work out the new parity, and write the new data and the new parity. That is the **write penalty** of single parity: four disk operations for one logical write, against two for a mirror and one for a stripe. The report itself says the small read-modify-write "is still so slow relative to a level 1 RAID that its applicability to transaction processing is doubtful" for the level with a single check disk, and that level 5 improves it by spreading the parity so writes to different blocks need not queue on one check disk. The OpenZFS page adds a different cost for RAIDZ: a block is spread over the group, so "a RAIDZ vdev has a write IOPS of the slowest disk in the array in the worst case", and its rule of thumb is that mirrors are the better choice "when random-read IOPS is the binding constraint". Double parity does the same read-modify-write with two parities; three reads and three writes is my derivation (**est.**).
+
+Practical effect: parity arrays are good for capacity and for large sequential writes, and weaker for small random writes, such as a busy database. The exercise below puts numbers on it.
+
+## When a drive fails: degraded, rebuild and the risk window
+
+When a member fails, three things start. The array is **degraded**: it works, with less or no redundancy. A **rebuild** starts if a spare or a replacement is there. And a **window of risk** opens that lasts until the rebuild ends. During that window a single-parity array has no cover left, and the rebuild itself reads every surviving drive from start to finish, which is the heaviest read load those drives will have had for a long time.
+
+![Timeline of a drive failure: healthy, degraded, rebuild and healthy again, with the risk window and the backup as the way back.](images/raid-levels-parity-rebuilds-and-why-raid-is-continuity-not-a-backup-diagram-3.png)
+
+<details>
+<summary>Diagram source (Mermaid)</summary>
+
+```mermaid
+flowchart LR
+    s1["Healthy<br/>every drive in"]:::ok --> s2["A drive fails,<br/>array degraded"]:::bad --> s3["Spare or<br/>replacement added"]:::mid --> s4["Rebuild reads every<br/>surviving drive"]:::mid --> s5["Healthy again"]:::ok
+    s2 -.-> w1["The risk window:<br/>a second failure or an<br/>unreadable sector"]:::bad
+    s4 -.-> w1
+    w1 --> w2["RAID 5: data in that<br/>stripe can be lost.<br/>RAID 6: one more is covered"]:::mid
+    w2 --> w3["A separate backup is<br/>the way back"]:::ok
+
+    classDef ok fill:#132a1f,stroke:#4ade80,color:#dcfce7
+    classDef mid fill:#3a2a0f,stroke:#fbbf24,color:#fef3c7
+    classDef bad fill:#3a1a1a,stroke:#f87171,color:#fee2e2
+```
+
+</details>
+
+What makes the window dangerous:
+
+- **Time.** The window is as long as the repair. The 1987 report's formula, given in the exercise, has the repair time in the denominator: the longer it takes, the sooner another failure arrives. A hot spare shortens it; a replacement that sits in a cupboard lengthens it.
+- **Failures that are not independent.** The report's arithmetic assumes independent failures. Drives bought together, from the same batch, the same age, in the same enclosure on the same power supply and the same fans, are not independent. I found no figure for how much this matters (not read), and the lesson is only that the textbook odds are a best case.
+- **Unreadable sectors.** A rebuild must read everything left. If a sector cannot be read, the array has nothing to rebuild it from (in RAID 5) and the data in that stripe is lost, even though no second drive died. The exercise works out what a datasheet's stated rate would mean. The Linux Raid Wiki's scrub page adds a rule of thumb from drive makers' specifications on arrays of 10 TB or more: a desktop-class drive counts as healthy at "less than one read error per check".
+- **Timeout mismatch.** The wiki's *Timeout Mismatch* page describes a drive that keeps trying to read a bad sector for longer than the operating system will wait: "Unfortunately, with desktop drives, they can take over two minutes to give up ... while the linux kernel will give up after 30 seconds", so the array treats a working drive as dead and drops it. "This is how a single error with these drives can easily kill an array." Drives with a configurable error-recovery timeout avoid it. The same page warns about drives that write in overlapping tracks (shingled recording), which can stall for minutes and refuse to join an array; read the model's specification, and do not guess from the product name.
+- **People.** The wiki's main page says: "NEARLY ALL data lost as reported to the raid mailing list, is down to user error while attempting to recover a failed array", and "NEVER NEVER NEVER use `mdadm --create` on an already-existing array unless you are being guided by an expert". The step you take on a bad day is the dangerous one, which is one more reason to have a backup and a written procedure first.
+
+**Scrub before you need it.** A scrub reads every block while the redundancy is still whole. In `md` it is `check` written to the array's `sync_action` file (the wiki's scrub page; the `md` guide lists the values), and the `mismatch_count` says how many sectors were or would have been rewritten (`md` guide). `repair` rewrites; the wiki warns not to run it on RAID 6 without knowing it is right, because it "may just rewrite both parities and leave any corruption in place". ZFS's `zpool scrub` checks each block's checksum and repairs from the redundancy. Neither is a substitute for a restore test.
+
+## The write hole and power loss
+
+A parity write is several writes: the data and the parity, on different drives. If power fails between them, the parity no longer matches the data. The kernel's partial parity log page describes it: after a dirty shutdown "parity of a particular stripe may become inconsistent with data on other member disks. If the array is also in degraded state, there is no way to recalculate parity, because one of the disks is missing. This can lead to silent data corruption when rebuilding the array ... Such condition is known as the RAID5 Write Hole." The `md` guide adds that if a RAID 5 or 6 array "is both dirty and degraded, it could have undetectable data corruption", so `md` "will normally refuse to start such an array" until an administrator forces it.
+
+Three ways to close it, all from the sources I read:
+
+- **A journal.** The RAID 5 cache page: write the data and parity to a separate cache device first, then to the array, so after a crash `md` "can recover correct data after unclean shutdown even [if] the array is degraded". If the cache drive itself fails the array "is exposed to 'write hole' again".
+- **A partial parity log (PPL).** Log just enough (the XOR of the blocks the write does not change) on the member drives themselves, with no extra drive. The page says write performance falls "by up to 30%-40%", and that PPL "is not a true journal": it protects against silent corruption and not against losing the in-flight data.
+- **Not overwriting in place.** The OpenZFS page says RAIDZ "eliminates the RAID-5 'write hole'". I read the claim and not the mechanism. Hardware controllers with a battery-backed cache address the same problem; I read no controller manual (not read, general knowledge **est.**).
+
+The drill below shows the hole in a few lines, so you can see that a rebuild can finish with no error and the data still be wrong.
+
+## Hardware, firmware, software and filesystem RAID
+
+Where the RAID logic lives changes what you can recover and what you must monitor.
+
+- **Hardware RAID** runs on a controller card and shows the operating system one block device. The Linux Raid Wiki says "Proper hardware RAID systems are presented to linux as a block device" and does not cover them. I read no controller documentation. The risk to ask about is the controller: if it dies, can its replacement read the drives?
+- **Firmware or "fake" RAID** is logic in the motherboard's firmware. The wiki lists its objections: "if the 'raid' card or motherboard dies then you often have to find an exact replacement", "if drives move to other machines the data can't easily be read", and "there is usually no monitoring or reporting on the array". Its verdict is that for people who want to reduce risk it is "a terrible idea". That is a judgment from a community documentation project on a page it labels obsolete, so check the current situation for your hardware.
+- **Operating system software RAID** is Linux `md`, managed with `mdadm`. The `mdadm` manual lists linear, RAID0, RAID1, RAID4, RAID5, RAID6, RAID10, multipath, faulty and container modes, and says multipath is "not a Software RAID mechanism" and faulty is "not true RAID". Because the array is described in metadata on the drives, they can be moved to another Linux machine.
+- **Filesystem RAID.** ZFS puts the redundancy and the checksums in one layer (RAIDZ, mirrors), so it can tell which copy is right. Microsoft's Storage Spaces offers mirror and parity "similar to RAID, except distributed across servers and implemented in software" and "discourage[s] using single parity" because "it can only safely tolerate one hardware failure at a time". Both are RAID by another name, with the same limit: neither is a backup.
+
+One more layer matters: **integrity**. The wiki says it plainly: "drives lie", and what RAID needs is "for the level below to provide integrity and not corrupted data". It points to `dm-integrity` or an integrity-aware filesystem so that corrupt data becomes a read error that the redundancy can repair. An array on its own detects a failed drive; it does not always detect a drive that returns the wrong bytes without an error.
+
+## What RAID does not protect against
+
+The event table at the top of the page is the summary. In more words:
+
+- **Deletion, overwriting and bad edits,** by anyone, including the right person. The array stores the mistake on every member.
+- **Ransomware and malicious changes.** An attacker with the credentials writes to the array like any other user. The CISA material the backups deep dive cites says to keep backups offline for this reason; an array is online by design.
+- **Corruption** from software, bad memory, a bad cable or a drive that returns wrong data. Checksumming filesystems and `dm-integrity` can turn some of it into repairable errors. None of it can turn a bad edit into a good file.
+- **The site.** Fire, flood, theft, a power event that takes every drive at once.
+- **The box.** A failed controller, enclosure, power supply or backplane. Plan for the box to be replaced, and write down what it needs to read the old drives.
+- **Operators.** The wrong drive pulled, the wrong `mdadm` command, a rebuild onto the wrong disk.
+- **Time.** An array with no scrub, no monitoring and no alert on a degraded count can sit degraded for months and be found only when the second drive dies.
+
+## Where RAID sits in a continuity plan
+
+The [enterprise page](Enterprise-Infrastructure-Differences.md#high-availability-disaster-recovery-and-backups) puts high availability, disaster recovery and backups side by side, and RAID is a small piece of the first. In the language of the [continuity lesson](Business-Continuity-and-Disaster-Recovery-BCP-and-DR.md), RAID is a control that lets one system tolerate one kind of failure (a drive) with no downtime. It lowers the chance that a drive failure becomes an outage, which helps the **RTO** for that failure, and it does nothing for the **RPO**, because an array has no history: the newest write is the only version. The business impact analysis decides which systems earn the cost. NIST SP 800-34 says the BIA "can help determine the type and frequency of backup, the need for redundancy or mirroring of data, and the type of alternate site", and that "each of these strategy decisions have cost versus availability or recovery implications".
+
+A short checklist for an array that is part of a plan:
+
+1. **Say what it is for.** "Keeps the file server up through one drive failure", not "protects our data".
+2. **Pick the level from the failure you must survive** and the rebuild window you can accept: more cover for wide arrays and large drives, mirrors where small random writes dominate.
+3. **Have a spare, or a replacement on the shelf,** and write down how long it takes to get one.
+4. **Monitor the degraded count and alert on it.** An array that is degraded and silent is a loss of cover nobody knows about; [logs and detection](Logs-SIEM-and-Detection-Basics.md) is where an alert like that is routed.
+5. **Scrub on a schedule** you chose and wrote down, and keep the result.
+6. **Keep the backup outside the array's failure domain,** with the 3-2-1-1-0 digits from the [backups deep dive](Backups-Deep-Dive-3-2-1-1-0-Immutability-and-Restore-Testing.md#immutable-and-offline-copies): a copy the same login cannot delete, and one somewhere else.
+7. **Test both.** A [timed restore](Backups-Deep-Dive-3-2-1-1-0-Immutability-and-Restore-Testing.md#restore-testing) proves the backup. A planned drive pull on a **throwaway** array proves the continuity story, including who gets the alert and how long the rebuild takes.
+
+## Where this shows up in this project
+
+The question for each row is the Backups page's: if this vanished tonight, what would you restore it from? A search of the repository's `.tf`, `.md`, `.yaml`, `.yml`, `.py` and `.sh` files outside the wiki on 2026-11-01 found no RAID configuration, so the honest answer for the repository is that there is no RAID in it. The rows say what stands where an array would.
+
+| Item | Where it lives today | File or procedure in this repository | Status |
+|---|---|---|---|
+| The cloud droplets | The provider's storage; I did not read how a droplet's disk is made redundant | `modules/twingate-connector/main.tf` (droplet backups are `false`; the recovery is a rebuild from code) | Built, not applied for this page. Whether the provider uses an array is not read |
+| Stage 3 daemon state | A Spaces bucket, versioned; object storage keeps its own redundancy and is not a disk array you manage | `modules/spaces-bucket/main.tf`, `modules/spaces-bucket/README.md` | Written, off by default |
+| A home server or a NAS with several drives | Outside this repository; the continuity lesson says everything about the home logging server is outside it | None; the plan is in [Business continuity and disaster recovery](Business-Continuity-and-Disaster-Recovery-BCP-and-DR.md#7-the-home-logging-server) | None |
+| An array's configuration, alerts or scrub schedule | Does not exist: no RAID in this repository | None | None |
+| A drive-pull drill or a timed restore from an array | Never run | None | None |
+
+The lesson for the project is the one the page opened with. Where this project has data, it is protected by rebuilding from code and by a provider's storage, and the page on [backups](Backups-Deep-Dive-3-2-1-1-0-Immutability-and-Restore-Testing.md#where-this-shows-up-in-this-project) lists the rows that have no copy at all. Adding disks in an array at home to one of those would improve availability and add no backup.
+
+## Free path: a parity drill on your own computer
+
+This script runs in a throwaway folder. Its "drives" are 32-byte files. Predict, do, check, undo. Save it as `raid_drill.py`.
+
+```python
+#!/usr/bin/env python3
+# raid_drill.py - parity, a lost "drive", a rebuild, the write hole and a mirror that copies a mistake.
+# Everything is a small file in one throwaway folder made with tempfile.mkdtemp. No disk, device or other folder is touched.
+import hashlib
+import shutil
+import tempfile
+from pathlib import Path
+
+
+def xor(*blocks):
+    out = bytearray(len(blocks[0]))
+    for block in blocks:
+        for i, b in enumerate(block):
+            out[i] ^= b
+    return bytes(out)
+
+
+def short(data):
+    return hashlib.sha256(data).hexdigest()[:10]
+
+
+lab = Path(tempfile.mkdtemp(prefix="raid-drill-"))
+try:
+    # Three "data drives" of 32 bytes each, and one "parity drive" that holds their XOR.
+    originals = {n: hashlib.sha256(f"drive-{n}".encode()).digest() for n in (1, 2, 3)}
+    for n, data in originals.items():
+        (lab / f"drive{n}.bin").write_bytes(data)
+    (lab / "parity.bin").write_bytes(xor(*originals.values()))
+
+    print("== Parity: lose one drive, rebuild it from the others")
+    for n in (1, 2, 3):
+        print(f"drive {n} fingerprint {short(originals[n])}")
+    (lab / "drive2.bin").unlink()
+    print("drive 2 is gone; the array is degraded but every byte can still be read")
+    rebuilt = xor((lab / "drive1.bin").read_bytes(), (lab / "drive3.bin").read_bytes(), (lab / "parity.bin").read_bytes())
+    (lab / "drive2.bin").write_bytes(rebuilt)
+    print(f"rebuilt drive 2 matches the original: {rebuilt == originals[2]}")
+
+    print("== A small write: new parity = (old data xor new data) xor old parity")
+    old_data = (lab / "drive1.bin").read_bytes()
+    old_parity = (lab / "parity.bin").read_bytes()
+    new_data = hashlib.sha256(b"drive-1 edited").digest()
+    new_parity = xor(xor(old_data, new_data), old_parity)
+    print("reads: 2 (old data, old parity); writes: 2 (new data, new parity)")
+    (lab / "drive1.bin").write_bytes(new_data)
+    (lab / "parity.bin").write_bytes(new_parity)
+    full = xor(*[(lab / f"drive{n}.bin").read_bytes() for n in (1, 2, 3)])
+    print(f"parity from the shortcut equals parity from all three drives: {new_parity == full}")
+
+    print("== The write hole: the data is written, the power fails before the parity is")
+    edited = hashlib.sha256(b"drive-1 edited again").digest()
+    (lab / "drive1.bin").write_bytes(edited)
+    print("parity.bin was not updated, and nothing says so")
+    (lab / "drive3.bin").unlink()
+    print("drive 3 now fails, and the array rebuilds it from drive 1, drive 2 and the stale parity")
+    wrong = xor((lab / "drive1.bin").read_bytes(), (lab / "drive2.bin").read_bytes(), (lab / "parity.bin").read_bytes())
+    (lab / "drive3.bin").write_bytes(wrong)
+    differing = sum(a != b for a, b in zip(wrong, originals[3]))
+    print(f"rebuilt drive 3 matches the original: {wrong == originals[3]}")
+    print(f"the rebuild finished without an error; {differing} of {len(wrong)} bytes are wrong, a silent corruption")
+
+    print("== A mirror copies a mistake, a backup does not")
+    (lab / "mirror-a.txt").write_text("quarterly figures\n")
+    (lab / "mirror-b.txt").write_text("quarterly figures\n")
+    (lab / "backup-from-last-night.txt").write_text("quarterly figures\n")
+    for name in ("mirror-a.txt", "mirror-b.txt"):
+        (lab / name).write_text("")
+    print("an empty file was written to the array, so both mirror halves are now empty")
+    print(f"mirror halves: {len((lab / 'mirror-a.txt').read_text())} and {len((lab / 'mirror-b.txt').read_text())} bytes; backup: {len((lab / 'backup-from-last-night.txt').read_text())} bytes")
+    print("the mirror kept the system running and kept the mistake; the backup kept last night")
+finally:
+    shutil.rmtree(lab)
+print("done: the lab folder is gone")
+```
+
+**Predict first.** Before you run it, write down: (a) whether drive 2 will come back byte for byte; (b) how many disk operations the small write takes; (c) whether a rebuild after the "power failure" will report an error, and whether the rebuilt drive will match; (d) how big the two mirror halves are after the mistake, and the backup.
+
+```bash
+python3 -I raid_drill.py
+```
+
+Output from my run (CPython 3.13, Linux, 2026-11-01). The fingerprints are the same on every machine because the "drive" contents are fixed:
+
+```text
+== Parity: lose one drive, rebuild it from the others
+drive 1 fingerprint ff0bc3d721
+drive 2 fingerprint 14d846758f
+drive 3 fingerprint 6bf784caf1
+drive 2 is gone; the array is degraded but every byte can still be read
+rebuilt drive 2 matches the original: True
+== A small write: new parity = (old data xor new data) xor old parity
+reads: 2 (old data, old parity); writes: 2 (new data, new parity)
+parity from the shortcut equals parity from all three drives: True
+== The write hole: the data is written, the power fails before the parity is
+parity.bin was not updated, and nothing says so
+drive 3 now fails, and the array rebuilds it from drive 1, drive 2 and the stale parity
+rebuilt drive 3 matches the original: False
+the rebuild finished without an error; 32 of 32 bytes are wrong, a silent corruption
+== A mirror copies a mistake, a backup does not
+an empty file was written to the array, so both mirror halves are now empty
+mirror halves: 0 and 0 bytes; backup: 18 bytes
+the mirror kept the system running and kept the mistake; the backup kept last night
+done: the lab folder is gone
+```
+
+How to read it:
+
+- **Parity.** Drive 2 was deleted and then calculated back from the other two drives and the parity. That is the whole trick, and it is why one parity survives one failure and not two.
+- **Small write.** The shortcut gives the same parity as recomputing from every drive, with two reads and two writes. That is the write penalty in four operations.
+- **Write hole.** The data was written and the parity was not. Nothing flagged it. When drive 3 failed, the "rebuild" used the stale parity and produced 32 wrong bytes out of 32, with no error. All 32 differ because the edit is a fresh hash; a real write would change fewer bytes and be harder to see. This is the situation the kernel's journal and partial parity log exist to prevent.
+- **Mirror.** Both halves took the empty file. The array stayed up. The backup is the only thing that still has the figures.
+- **What the drill is not.** It does not model a real controller, a real chunk layout, real timing or a real failure. It only shows the arithmetic and the reasoning.
+
+**Check.** If the array had been RAID 6, what extra thing would the second parity let you do in the write-hole case? (Hint: the wiki's scrub page says that with RAID 6 "it is possible to detect which block is corrupt", and also that `repair` will not fix it for you.) **Undo.** The script deletes its own folder. If it is stopped early, delete only the directory named `raid-drill-` plus random characters under `$TMPDIR` (or `/tmp`), after reading its name.
+
+## Optional: an array on loopback files (shown, not run)
+
+Status: **Not run.** This block is written from the `mdadm` and `losetup` manual pages (read 2026-11-01). It builds a small RAID 5 out of three files you create, fails one, replaces it and removes everything. It needs root. **Run it only on files you made yourself, in a virtual machine or a machine you do not mind breaking.** Everything in angle brackets is a name you read from your own screen; do not copy a device name from this page, and do not substitute the name of any disk you did not make from a file. In particular, `mdadm --create` on a disk that already holds an existing array is a classic way to destroy data, and the wiki says never to do it without expert help, so the only things named below are loop devices made from your own files.
+
+```bash
+# NOT RUN. Needs root. Only on files you create yourself. In /dev/loop<A> to /dev/loop<D>, replace the <A> to <D> with the loop names that losetup prints on your own screen.
+mkdir raid-lab && cd raid-lab
+truncate -s 200M disk1.img disk2.img disk3.img disk4.img
+sudo losetup --find --show disk1.img     # prints the loop device it made; note it as <A>
+sudo losetup --find --show disk2.img     # <B>
+sudo losetup --find --show disk3.img     # <C>
+sudo losetup --find --show disk4.img     # <D>, the replacement
+sudo mdadm --create /dev/md/lab --level=5 --raid-devices=3 /dev/loop<A> /dev/loop<B> /dev/loop<C>
+cat /proc/mdstat
+sudo mdadm --detail /dev/md/lab
+sudo mdadm /dev/md/lab --fail /dev/loop<B>      # degraded now; look at --detail again
+sudo mdadm /dev/md/lab --remove /dev/loop<B>
+sudo mdadm /dev/md/lab --add /dev/loop<D>       # rebuild onto the replacement; watch /proc/mdstat
+sudo mdadm --stop /dev/md/lab
+sudo mdadm --zero-superblock /dev/loop<A> /dev/loop<C> /dev/loop<D> /dev/loop<B>
+sudo losetup -d /dev/loop<A> /dev/loop<B> /dev/loop<C> /dev/loop<D>
+cd .. && rm -r raid-lab
+```
+
+What each part is for, and where it comes from: `truncate -s` makes sparse files; `losetup --find --show` attaches a file as a loop device and prints its name (the `losetup` manual's own example); `--create`, `--level`, `--raid-devices`, `--fail`, `--remove`, `--add`, `--detail`, `--stop` and `--zero-superblock` are `mdadm` options in its manual page, which says `--add` on a degraded array "will immediately start to rebuild data onto that spare". Reading `/proc/mdstat` for progress is general knowledge (**est.**; not in the pages I read). To see a scrub, the wiki's scrub page says to write `check` to the array's `sync_action` file under `/sys` (the `md` guide lists the values); I did not run it. After you stop the array, the `--zero-superblock` line clears the metadata so those four loop devices cannot be mistaken for an array later.
+
+## Exercise: size a six-drive shelf on paper
+
+A made-up case, so that nobody's real hardware is in it. **Example Shelf** has six drives of 8 TB each and a budget for one array. Everything here is computed from formulas, not read off a device. **Not run:** no array was built and no drive was failed for any number below. Do it on paper first, then check against the answers.
+
+**Set-up and formulas.**
+
+- Usable space: RAID 0 is n x s; RAID 10 is n / 2 x s; RAID 5 is (n - 1) x s; RAID 6 is (n - 2) x s.
+- Small-write cost (disk operations for one small write): 1 for RAID 0, 2 for RAID 10, 4 for RAID 5 (the report's 2 reads and 2 writes) and 6 for RAID 6 (derived, **est.**).
+- Random writes per second for the whole array: n x (writes per second of one drive) / (small-write cost). Take **150** per drive (an invented round number, **est.**).
+- The 1987 report's reliability formula: `MTTF_RAID = MTTF_disk^2 / ((D + C x nG) x (G + C - 1) x MTTR)`, where D is the number of data disks, G the data disks per group, nG = D / G the number of groups, C the check disks per group, and MTTR the repair time in hours. Its own example takes D = 100, G = 10, MTTF_disk = 30,000 hours and MTTR = 1 hour.
+
+**Questions.** (1) For each level, the usable space, the share of the raw 48 TB, the number of drive failures survived for certain and in the best case, and the small-write cost. (2) The random writes per second for each. (3) The report's example with C = 1: the MTTF of the whole array at G = 10 and at G = 25, then at G = 10 with a 24-hour repair. (4) The chance that at least one of the six drives fails in a year, using a published annualized failure rate. (5) The chance that a rebuild of a five-survivor RAID 5 meets at least one unreadable sector, at two stated rates. (6) How long a rebuild takes at two read speeds.
+
+**Answers 1 and 2** (the first table is the answer to the first question):
+
+| Level | Drives | Usable TB | Share of raw | Lose for certain | Best case | Small-write I/Os |
+|---|---|---|---|---|---|---|
+| RAID 0 (striping) | 6 | 48 | 100% | 0 | 0 | 1 |
+| RAID 10 (three mirrored pairs) | 6 | 24 | 50% | 1 | 3 | 2 |
+| RAID 5 (single parity) | 6 | 40 | 83% | 1 | 1 | 4 |
+| RAID 6 (double parity) | 6 | 32 | 67% | 2 | 2 | 6 |
+
+| Level | Random writes per second (est.) |
+|---|---|
+| RAID 0 (striping) | 900 |
+| RAID 10 (three mirrored pairs) | 450 |
+| RAID 5 (single parity) | 225 |
+| RAID 6 (double parity) | 150 |
+
+The best case for RAID 10 counts one failure in each of the three pairs; two failures in the same pair lose the array. The write rates are the formula with an invented per-drive figure; they show the ratio between levels and are not a prediction for any drive.
+
+**Answer 3.** With C = 1, D = 100 and G = 10, the formula gives 818,182 hours, or 93.4 years; the report's own table prints "820,000 hrs or >90 years". At G = 25 it gives 346,154 hours and the report prints "346,000 hrs or 40 years". With a repair that takes 24 hours instead of 1, the G = 10 figure falls to 34,091 hours, or 3.9 years: the repair time is the term you control, which is why the report named hot spares. These are the 1987 model's numbers, which assume constant failure rates and **independent** failures (the report says both are the manufacturers' assumptions). Real failures are **correlated** (same batch, same shelf, same power, same fire), so treat the result as a ceiling and not as a promise.
+
+**Answer 4.** Backblaze's drive statistics page for Q2 2026 (read 2026-11-01) shows 31,553,350 drive days and 1,498 drive failures, an annualized failure rate of 1.73%. (Check: failures divided by drive days over 365 gives the same figure.) That is a rate for Backblaze's own fleet in its own data centers, not for any drive you own. If six drives each had 1.73% a year and failed independently, the chance that at least one fails within a year is 9.9%. That is roughly one shelf in ten each year, so for a shelf kept for years the question is when, not whether.
+
+**Answer 5.** A rebuild of a six-drive RAID 5 of 8 TB drives reads the five survivors: 5 x 8 TB = 40 TB, or 3.2 x 10^14 bits. Drive datasheets give an unrecoverable read error rate as a **maximum**, for example 1 in 10^14 bits or 1 in 10^15 bits (I did not read a datasheet for any model; check yours). Treating the rate as an average, which is the **worst case** reading, the chance of at least one unreadable sector during the rebuild is 96% at 1 in 10^14 and 27% at 1 in 10^15. Real drives are commonly said to do better than their stated maximum (general knowledge, **est.**; I have no measurement), so read these as an upper bound on the risk, and compare the two figures with each other. The comparison is the point: a RAID 6 rebuild that meets one bad sector still has a second parity to read it from, and RAID 5 does not.
+
+**Answer 6.** At a sustained 150 MB/s, an 8 TB drive takes 14.8 hours to write, with nothing else using the array. If the array is also serving users and the rebuild gets 50 MB/s, the time is 44.4 hours. Both figures are lower bounds on the window (**est.**: I picked the speeds, and the manufacturer's sustained rate varies across the surface of a drive). Add the time to get a replacement, and the repair time in answer 3 is a day or two, which is the case where that answer shows most of the margin gone.
+
+**Check.** Which of the four levels would you pick for a file server where you could not accept an outage, and what would you buy next to it? (The answer on this page is "a backup", every time.)
+
+## Build, break, detect, evade, defend (on paper)
+
+**Build.** For one system you care about, write what it would take to lose one drive with no outage: the level, the spare, the alert and who receives it.
+
+**Break (words only).** Say in one sentence how an honest mistake empties the array with no drive failing, and in one how an attacker with the administrator's password does the same.
+
+**Detect.** Name the check that shows each: the degraded count and a failed-drive alert for a loss of cover, a scrub's mismatch count for corruption, a failed restore test for a backup that does not work.
+
+**Evade.** The tempting move is to rely on the array being "hard to break" and skip the backup. A second drive is another place for the same mistake to be written.
+
+**Defend.** Add the cheapest control that moves the highest risk: an alert on a degraded array, a scheduled scrub, a copy that the array's administrator cannot delete, or a calendar entry for a restore test.
+
+## Checkpoint
+
+- Why is RAID a business continuity control and not a backup? Which letter of the CIA triad does it protect?
+- Name five events an array does nothing about.
+- What is the difference between striping, mirroring and parity?
+- A six-drive RAID 5 of 8 TB drives: usable space, drives survived, and how many disk operations for one small write?
+- What does a rebuild have to read, and why does that make it the risky part?
+- Why can a rebuild finish without an error and the data still be wrong?
+- What is the write hole, and name two ways Linux closes it.
+- In 3-2-1-1-0, how many copies does an array count as?
+- What two things would you set up next to an array: one for continuity and one for recovery?
+
+## Common mistakes
+
+| Symptom | Most likely cause | What to check |
+|---|---|---|
+| "We have RAID, so we have backups" | Redundancy mistaken for a separate copy | Whether a deleted, corrupted or encrypted file can be restored from somewhere the array's logins cannot reach |
+| The array has been degraded for months | No alert on the degraded count | The array's status, and who gets the alert |
+| A rebuild fails on a healthy second drive | An unreadable sector, or a drive that stalls past the kernel's timeout | A scrub history; the drive's error-recovery setting |
+| "RAID 5 is fine, we have a spare" | The window of risk is the rebuild, not the wait for a spare | Rebuild time against the odds in the exercise, and whether double parity is worth it |
+| The replacement controller cannot read the drives | Hardware or firmware RAID tied to one controller | What the vendor says about moving the drives, before you need to |
+| Using `--create` to "fix" an array | The command writes new metadata over the old | The wiki's main page on recovery, and a copy of the drives first |
+| Calling a single-parity array "two copies" | Counting parity as a copy | The 3-2-1-1-0 count: an array is at most one copy |
+| Speed measured on a fresh array and assumed forever | Small-write cost, a degraded array and a rebuild all slow it | Random-write numbers during a rebuild |
+| Nobody has timed a drive replacement | The repair time is a guess | A planned drive pull on a throwaway array, with a clock |
+
+## Not verified, plainly
+
+- **Not run:** every `mdadm` (including `mdadm --create`), `losetup` and `truncate` command in the optional block; any array, rebuild, scrub or write-hole fix on real hardware; any ZFS or Storage Spaces command.
+- **Not read:** a drive datasheet for any model (so the unrecoverable read error rates in the exercise are stated assumptions, and I do not know what any particular drive is specified to do); the SNIA RAID definitions and the common RAID disk drive format; any hardware RAID controller's manual, so the controller and battery-backed cache remarks are general knowledge; the Berkeley report's text for RAID 2 and level 3 (I read the abstract, the reliability section, level 1, the small-write explanation and level 4 and 5 with their tables); how RAID 0, RAID 6 and RAID 10 were first defined; the layouts of the Linux `raid10` driver; the NIST glossary's definition of RAID (the page lists its sources and its definition did not come through the download); any figure for how much correlated failure changes the odds.
+- **Read from archived or community sources:** the Linux Raid Wiki says on every page that it is archived and obsolete and points to the kernel's own documents; I used it for advice and cautions, and used the kernel pages for how `md` behaves.
+- **A fleet is not your drives:** the Backblaze rate is from one operator's data centers in one quarter, and says nothing about a single model, and I draw no ranking from it.
+- **Derived, not read:** a write cost of 6 for double parity and the best case of three failures for six drives in RAID 10 are my arithmetic.
+
+## Claims register
+
+Sources were downloaded and read on **2026-11-01**. Status words: **Read** means I read the passage, **Observed** means I ran it, **Not run** and **est.** mean neither, and **General knowledge** means I did not look it up. A page I could only read through an archive says so.
+
+| Claim | Source | Status |
+|---|---|---|
+| RAID is a business continuity control and not a backup; teach it that way | The maintainer's framing, issue 421 (comment of 2026-11-01) | Read 2026-11-01 |
+| RAID was proposed as "Redundant Arrays of Inexpensive Disks"; the unreliability of disks "forces computer systems managers to make backup versions of all information every night"; five levels; MTTF of an array is the single-disk MTTF divided by the number of disks; the MTTF_RAID formula, with the example D = 100, G = 10, MTTF 30,000 hours, MTTR 1 hour; failures assumed exponential and independent, with an earthquake or power surge as the counter-example; hot spares reduce MTTR; the parity shortcut and the 2 reads and 2 writes; the level 4 table (820,000 hours, 346,000 hours) | [Patterson, Gibson and Katz, *A Case for Redundant Arrays of Inexpensive Disks (RAID)*, University of California, Berkeley, report CSD-87-391 (1987)](https://www2.eecs.berkeley.edu/Pubs/TechRpts/1987/CSD-87-391.pdf) (a scan; I read the abstract and pages 1, 2, 5 to 9 and 14 to 17 of the report as numbered in its footer) | Read 2026-11-01 |
+| RAID is among the technologies to consider in a recovery strategy; redundancy stores data on more than one drive and eliminates loss from single drive failures; the BIA helps decide the need for redundancy or mirroring; high availability cannot replace a solid backup strategy and corruption can propagate; backup must be separate from the system | [NIST SP 800-34 Rev. 1, May 2010](https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-34r1.pdf), sections 3.4.1, 5.1.1, 5.1.2 and 5.1.6 (text extracted from the PDF) | Read 2026-11-01 |
+| "RAID is not a panacea"; "backup, backup, BACK UP. And keep it off site"; drives lie; RAID needs the level below to provide integrity; `dm-integrity` | [Linux Raid Wiki, How to protect your data](https://raid.wiki.kernel.org/index.php/How_to_protect_your_data) (the site redirects to an archive; page last modified 30 November 2019; marked obsolete) | Read 2026-11-01 |
+| Any array should be scrubbed at regular intervals; `check` and `repair` through `sync_action`; the RAID 6 repair warning; the 10 TB drive-specification note | [Linux Raid Wiki, Scrubbing the drives](https://raid.wiki.kernel.org/index.php/Scrubbing_the_drives) (archived; marked obsolete) | Read 2026-11-01 |
+| Timeout mismatch: a drive can take over two minutes to give up and the kernel gives up after 30 seconds, so a working drive is dropped; shingled drives can stall | [Linux Raid Wiki, Timeout Mismatch](https://raid.wiki.kernel.org/index.php/Timeout_Mismatch) (archived; marked obsolete) | Read 2026-11-01 |
+| Nearly all lost data is user error during recovery; never use `mdadm --create` on an existing array; hardware RAID is shown to Linux as one block device; the firmware RAID objections | [Linux Raid Wiki, main page](https://raid.wiki.kernel.org/) (archived; marked obsolete) | Read 2026-11-01 |
+| The md device driver; chunk size and the levels that stripe; `sync_action` values (`resync`, `recover`, `check`, `repair`), `degraded` and `mismatch_count`; a dirty and degraded RAID 5 or 6 is refused at boot; journal and PPL consistency policies | [Linux kernel, md: RAID arrays](https://docs.kernel.org/admin-guide/md.html) | Read 2026-11-01 |
+| The RAID 5 write hole and the partial parity log, with its 30 to 40 percent write cost and its limits | [Linux kernel, Partial Parity Log](https://docs.kernel.org/driver-api/md/raid5-ppl.html) | Read 2026-11-01 |
+| The RAID 4, 5 and 6 write-through cache closes the write hole, and a cache disk failure exposes it again | [Linux kernel, RAID 4/5/6 cache](https://docs.kernel.org/driver-api/md/raid5-cache.html) | Read 2026-11-01 |
+| Linux supports linear, RAID0 (striping), RAID1 (mirroring), RAID4, 5, 6, 10, multipath, faulty and container; `--create`, `--level`, `--raid-devices`, `--fail`, `--remove`, `--add` (starts a rebuild on a degraded array), `--detail`, `--stop` and `--zero-superblock` exist | [mdadm(8)](https://man7.org/linux/man-pages/man8/mdadm.8.html) | Read 2026-11-01; not run |
+| `losetup --find --show FILE` attaches a file as a loop device and prints its name; `--detach` | [losetup(8)](https://man7.org/linux/man-pages/man8/losetup.8.html) | Read 2026-11-01; not run |
+| RAIDZ with one, two or three parity, `(N-P)*X` space, withstands P failures, eliminates the RAID 5 write hole; the write and read behavior; mirrors for random read IOPS | [OpenZFS, RAIDZ](https://openzfs.github.io/openzfs-docs/Basic%20Concepts/Pool%20Structure/RAIDZ.html) (last updated July 22, 2026) | Read 2026-11-01; not run |
+| A scrub verifies each block's checksum and repairs from redundancy; resilvering examines only out-of-date data | [OpenZFS, zpool-scrub(8)](https://openzfs.github.io/openzfs-docs/man/master/8/zpool-scrub.8.html) | Read 2026-11-01; not run |
+| Mirroring keeps multiple copies (two-way 50 percent, three-way 33.3 percent); single parity tolerates one failure and is discouraged; dual parity uses Reed-Solomon and tolerates two; "similar to RAID" | [Microsoft, Fault tolerance and storage efficiency in Storage Spaces Direct](https://learn.microsoft.com/en-us/windows-server/storage/storage-spaces/fault-tolerance) (no date read on the page) | Read 2026-11-01; not run |
+| Q2 2026: 31,553,350 drive days, 1,498 failures, annualized failure rate 1.73 percent, for the operator's own fleet | [Backblaze, Drive Stats](https://www.backblaze.com/cloud-storage/resources/hard-drive-test-data) | Read 2026-11-01 |
+| An array counts as at most one copy for 3-2-1-1-0; immutable and offline copies; restore testing | The author's own reading of [Backups deep dive](Backups-Deep-Dive-3-2-1-1-0-Immutability-and-Restore-Testing.md) | Read 2026-11-01 (repository file) |
+| BCP, RTO and RPO, and the home logging server plan | The author's own reading of [Business continuity and disaster recovery](Business-Continuity-and-Disaster-Recovery-BCP-and-DR.md) | Read 2026-11-01 (repository file) |
+| Droplet backups are `false` in the connector module; the Spaces bucket module is versioned and off by default | The author's own reading of `modules/twingate-connector/main.tf` and `modules/spaces-bucket/main.tf` | Read 2026-11-01 |
+| No RAID configuration in the repository's `.tf`, `.md`, `.yaml`, `.yml`, `.py` and `.sh` files outside the wiki, before this page was added | The author's own recursive search of the repository for the word RAID, case-insensitive | Observed 2026-11-01 |
+| Usable-space, fault-tolerance, write-rate, reliability, failure-chance, read-error and rebuild-time figures in the exercise | Derived by the author from the formulas shown; the test suite recomputes each from the formulas | Derived 2026-11-01; **est.** where marked |
+| RAID 0, 6 and 10 came after the 1987 levels; a double-parity small write costs 3 reads and 3 writes; battery-backed caches; `/proc/mdstat` shows rebuild progress | General knowledge | **est.**; not run |
+| The Python drill and its output | The author's own run of the free path | **Observed** 2026-11-01, CPython 3.13, Linux |
+| The drill on macOS or Windows | The author's own: not run | **Not run** |

+ 1 - 0
docs/wiki/Reading-Order.md

@@ -204,6 +204,7 @@ Not a path. Open these when you need them; every one is linked from the sidebar.
 | [IPv6: why adoption is slow, why this project is IPv4-only, and how to handle it safely](IPv6-Adoption-and-Handling-It-Safely.md) | You know basic networking and want to know what IPv6 changes (a /64, SLAAC, neighbor discovery, no NAT), why companies and this project still keep it off, how a dual-stack service ends up open over IPv6 behind an IPv4-only firewall, or what to change together before you turn it on. A foundations side page that builds on [Subnets, NAT and firewalls by hand](Subnets-NAT-and-Firewalls-By-Hand.md) and [Packet filters compared](Packet-Filters-Compared-iptables-nftables-ufw-pf.md); the lab is free and runs rootless in network namespaces. |
 | [Backups, recovery and patching](Backups-Recovery-and-Patching.md) | "Snapshot", "backup", "RPO", "RTO" or "patch cadence" are only words to you, you want to time a restore for yourself, or you want to know how to read a CVE entry and what a severity score leaves out. A foundations side page to [Droplet hardening](Droplet-Hardening.md), read after it and before [OpenTofu, stacks and modules](OpenTofu-Stacks-and-Modules.md); no step is renumbered. About three hours with the free exercises (est.); the optional own-account path adds about an hour spread over a day or two (est.); not counted in the path totals. |
 | [Backups deep dive: 3-2-1-1-0, immutability, key custody and restore testing](Backups-Deep-Dive-3-2-1-1-0-Immutability-and-Restore-Testing.md) | "3-2-1-1-0", "immutable backup", "air gap" or "key custody" are only words to you, or you have read the plain 3-2-1 rule and want to know what it leaves open. Full, incremental and differential backups, what a locked copy does and does not protect against, who holds the key to an encrypted backup, backing up the backup system itself, how often to test a restore, retention against a slow discovery and legal holds, the ransomware angle, cloud traps, this project's own table of what to back up (with the rows that say None), and a free local drill. A foundations side page read after [Backups, recovery and patching](Backups-Recovery-and-Patching.md); no step is renumbered. About 90 minutes with the drill (est.); not counted in the path totals. |
+| [RAID: levels, parity, rebuilds, and why it is continuity and not a backup](RAID-Levels-Parity-Rebuilds-and-Why-RAID-Is-Continuity-Not-a-Backup.md) | A server, a NAS or a vendor page says "RAID" and someone treats it as a backup, or "parity", "degraded", "rebuild" and "write hole" are only words to you. RAID as a business continuity control: it keeps a system running through some drive failures and is not a separate, restorable copy, with the events an array does nothing about; striping, mirroring and parity; RAID 0, 1, 5, 6 and 10 and RAIDZ side by side; the cost of a small write; what a rebuild risks; the write hole; hardware, software and filesystem RAID; where an array sits in a continuity plan; this project's rows (none have an array); a free parity drill and a six-drive paper exercise with every answer computed. Three diagrams. A foundations side page read after [Backups, recovery and patching](Backups-Recovery-and-Patching.md) and next to [Business continuity and disaster recovery](Business-Continuity-and-Disaster-Recovery-BCP-and-DR.md); no step is renumbered. About 90 minutes (est.); unverified draft, written from reading with one script run; not counted in the path totals. |
 | [Radio and off-grid communication: LoRa, Meshtastic, MeshCore, Reticulum, ham radio, GMRS, FRS, CB and a SIGINT overview](Radio-Off-Grid-Communication-LoRa-Meshtastic-Reticulum-Ham-and-SIGINT.md) | Your contact tree needs the internet at every step, or "LoRa", "Meshtastic", "Reticulum", "General class", "GMRS" or "SIGINT" are only words to you. What still works when the internet and the mains are down, how the three LoRa systems route and what they can and cannot carry, the United States amateur license classes and emergency communications, GMRS, FRS and CB rules, the legal rules for receive-only monitoring stated first, why encryption and good habits still matter, what this project has for a radio fallback (none), and offline, listen-only and paper exercises plus a small arithmetic script. A foundations side page read after [Business continuity and disaster recovery](Business-Continuity-and-Disaster-Recovery-BCP-and-DR.md); no step is renumbered. About 2 hours (est.); nothing transmits; not counted in the path totals. |
 | [Cross-tenant data flows, governance, retention and DLP](Cross-Tenant-Data-Governance-Retention-and-DLP.md) | "Tenant", "cross-account", "retention", "purge", "legal hold" or "DLP" are only words to you, or you want to know what an access-only product does not inspect. A side page to [Enterprise identity and secrets at scale](Enterprise-Identity-and-Secrets-at-Scale.md); read it after [Telemetry crosses the trust boundary](Telemetry-Crosses-the-Trust-Boundary.md). About three hours with the free local lab on invented data (est.); the optional own-account path is a pointer with its cost box first; not counted in the path totals. |
 | [Privacy versus security: blinds and locks, with physical security and Monero as the example](Privacy-vs-Security-Blinds-and-Locks-Physical-Security-and-Monero.md) | "Private" and "secure" feel like the same word to you, you want to know where they overlap and where they pull apart, or you want the physical side of security (locks, doors, tailgating, alarms, cameras, disposal) and the legal rules before you touch a lock. Privacy as blinds and security as locks, anonymity against accountability, Monero's own pages read as an example of both, GDPR principles at a high level (not legal advice), why lockpicking is a hobby in the field, and a free audit of your own room or desk. A foundations side page read after [The CIA triad](The-CIA-Triad-Confidentiality-Integrity-Availability.md); no step is renumbered. About 90 minutes with the exercise (est.); not counted in the path totals. |

+ 5 - 5
docs/wiki/_Sidebar.md

@@ -29,19 +29,19 @@ file does not match the manifest. -->
 21. [Roadmap](Roadmap.md)
 - [Full list (21)](Contents.md#core-path-read-in-this-order)
 </details>
-<details><summary><b>Foundations: OS and Linux</b> (12)</summary>
+<details><summary><b>Foundations: OS and Linux</b> (13)</summary>
 
 - [Linux for enterprise beginners](Linux-for-Enterprise-Beginners.md) (est. steps)
 - [The terminal and your first script](Terminal-and-Your-First-Script.md)
 - [Virtual machines and hypervisors: desktop to datacenter](Virtual-Machines-Hypervisors-Desktop-and-Datacenter-Options.md) (draft)
-<details><summary>Recovery, patching, virtual machines and Windows (9)</summary>
+<details><summary>Recovery, patching, virtual machines and Windows (10)</summary>
 
 - [Backups deep dive](Backups-Deep-Dive-3-2-1-1-0-Immutability-and-Restore-Testing.md) (draft) · [Backups, recovery and patching](Backups-Recovery-and-Patching.md) · [Business continuity and disaster recovery](Business-Continuity-and-Disaster-Recovery-BCP-and-DR.md) (draft) · [First hour on a new system](First-Hour-on-a-New-System-Updates-and-Baseline.md)
-- [Patch management and automatic security updates](Patch-Management-and-Automatic-Security-Updates.md) · [Radio and off-grid communication](Radio-Off-Grid-Communication-LoRa-Meshtastic-Reticulum-Ham-and-SIGINT.md) (draft) · [Red and blue, and choosing your lab OS](Red-and-Blue-Yin-and-Yang-and-Your-Lab-OS.md)
-- [Virtual machines, containers and cloud service models](Virtual-Machines-Containers-and-Cloud-Service-Models.md) · [Windows, Active Directory and macOS](Windows-Active-Directory-and-macOS-in-the-Enterprise.md)
+- [Patch management and automatic security updates](Patch-Management-and-Automatic-Security-Updates.md) · [Radio and off-grid communication](Radio-Off-Grid-Communication-LoRa-Meshtastic-Reticulum-Ham-and-SIGINT.md) (draft) · [RAID: continuity, not a backup](RAID-Levels-Parity-Rebuilds-and-Why-RAID-Is-Continuity-Not-a-Backup.md) (draft)
+- [Red and blue, and choosing your lab OS](Red-and-Blue-Yin-and-Yang-and-Your-Lab-OS.md) · [Virtual machines, containers and cloud service models](Virtual-Machines-Containers-and-Cloud-Service-Models.md) · [Windows, Active Directory and macOS](Windows-Active-Directory-and-macOS-in-the-Enterprise.md)
 </details>
 
-- [Full list (12)](Contents.md#foundations-os-and-linux)
+- [Full list (13)](Contents.md#foundations-os-and-linux)
 </details>
 <details><summary><b>Foundations: networking</b> (5)</summary>
 

+ 1 - 0
docs/wiki/_nav.yaml

@@ -99,6 +99,7 @@ pages:
     - {page: Linux-for-Enterprise-Beginners, title: "Linux for enterprise beginners", audience: "learner", status: "est. steps", desc: "The Linux families, package managers, services, permissions and logs you meet at work, for beginners; commands were not run by the author.", sidebar: true}
     - {page: Patch-Management-and-Automatic-Security-Updates, subgroup: "Recovery, patching, virtual machines and Windows", title: "Patch management and automatic security updates", audience: "learner", desc: "What unattended-upgrades does, how to configure it, where updates are logged, which four events deserve an alert, reboots, testing and rollback, for anyone running a Debian or Ubuntu host."}
     - {page: Radio-Off-Grid-Communication-LoRa-Meshtastic-Reticulum-Ham-and-SIGINT, subgroup: "Recovery, patching, virtual machines and Windows", title: "Radio and off-grid communication", audience: "learner", status: "draft", desc: "What still works when the internet and power are down: LoRa mesh, amateur radio, GMRS, FRS and CB, a legal-first SIGINT overview, and what a radio fallback could do for this project."}
+    - {page: RAID-Levels-Parity-Rebuilds-and-Why-RAID-Is-Continuity-Not-a-Backup, subgroup: "Recovery, patching, virtual machines and Windows", title: "RAID: continuity, not a backup", audience: "learner", status: "draft", desc: "RAID as a business continuity control and not a backup: levels, parity, the write penalty, rebuilds, the write hole and a computed six-drive exercise, with a free parity drill."}
     - {page: Red-and-Blue-Yin-and-Yang-and-Your-Lab-OS, subgroup: "Recovery, patching, virtual machines and Windows", title: "Red and blue, and choosing your lab OS", audience: "learner", desc: "Red, blue and purple teams, the written permission you need before any test, and setting up a lab computer you can safely break."}
     - {page: Terminal-and-Your-First-Script, title: "The terminal and your first script", audience: "learner", desc: "What a terminal, shell and command are, moving around files safely and chaining commands into a first script, for beginners on any operating system.", sidebar: true}
     - {page: Virtual-Machines-Hypervisors-Desktop-and-Datacenter-Options, title: "Virtual machines and hypervisors: desktop to datacenter", audience: "learner", status: "draft", desc: "What a virtual machine is, type 1 and type 2 hypervisors, the desktop and server options, a dated account of the VMware licensing changes, and a first VM with QEMU, for learners who need a lab.", sidebar: true}

TEMPAT SAMPAH
docs/wiki/images/raid-levels-parity-rebuilds-and-why-raid-is-continuity-not-a-backup-diagram-1.png


TEMPAT SAMPAH
docs/wiki/images/raid-levels-parity-rebuilds-and-why-raid-is-continuity-not-a-backup-diagram-2.png


TEMPAT SAMPAH
docs/wiki/images/raid-levels-parity-rebuilds-and-why-raid-is-continuity-not-a-backup-diagram-3.png


+ 89 - 3
tests/test_backups_deep_dive_lesson.py

@@ -25,7 +25,11 @@ LINK = re.compile(r"\]\(([A-Za-z0-9_-]+)\.md(?:#[^)]*)?\)")
 ADDR = re.compile(r"\b(?:\d{1,3}\.){3}\d{1,3}\b")
 PATH_TOKEN = re.compile(r"`((?:modules|stacks|scripts|docs|\.github|\.spacelift|tests)/[A-Za-z0-9_./-]+|board\.yaml|\.gitignore)`")
 STATUS_WORDS = ("Read", "Observed", "Not run", "**est.**", "General knowledge")
+RAID_LESSON = "RAID-Levels-Parity-Rebuilds-and-Why-RAID-Is-Continuity-Not-a-Backup"
+BCP_LESSON = "Business-Continuity-and-Disaster-Recovery-BCP-and-DR"
+RAID_SECTION = "## RAID is business continuity, not a backup"
 TOPICS = (
+    RAID_SECTION,
     "## From 3-2-1 to 3-2-1-1-0",
     "## Backup types: full, incremental, differential",
     "## Immutable and offline copies",
@@ -115,12 +119,94 @@ def test_every_linked_wiki_page_exists():
     assert not missing, missing
 
 
-def test_the_blast_radius_and_continuity_lessons_are_named_in_plain_text_not_linked():
-    # tests/test_blast_radius_lesson.py caps how many pages may link the blast radius lesson, and the continuity
-    # lesson may not be merged yet, so neither is linked from here.
+def test_the_blast_radius_lesson_is_named_in_plain_text_and_the_continuity_lesson_is_linked():
+    # tests/test_blast_radius_lesson.py caps how many pages may link the blast radius lesson, so it is not linked
+    # from here. The continuity lesson is merged and is linked (issue 421).
     body = text()
     assert "Plan-for-Failure-Blast-Radius" not in body
     assert "business continuity and disaster recovery" in body
+    assert f"]({BCP_LESSON}.md" in body
+    assert f"]({RAID_LESSON}.md" in body
+
+
+def raid_section(body: str) -> str:
+    return section(body, RAID_SECTION, "\n## From 3-2-1 to 3-2-1-1-0")
+
+
+def test_the_page_leads_with_raid_as_continuity_and_not_a_backup():
+    body = text()
+    opening = body.split("> Unfamiliar word or acronym?")[0]
+    assert "RAID" in opening and "not a backup" in opening, "the opening paragraph carries the framing"
+    assert body.index(RAID_SECTION) < body.index("## From 3-2-1 to 3-2-1-1-0"), "the RAID section comes first"
+    assert body.index(RAID_SECTION) < body.index("## Backup types"), "the RAID section comes before the backup types"
+    sec = raid_section(body)
+    for needed in (
+        "business continuity",
+        "availability",
+        "not a backup",
+        "at most one copy",
+        "deletion",
+        "corruption",
+        "ransomware",
+        "site",
+        "SP 800-34",
+        "cannot be a replacement for a solid backup strategy",
+        "Without a backup of the system separate from the system itself",
+        "Linux Raid Wiki",
+        "backup, backup, BACK UP",
+        "RAID is not a panacea",
+        "Patterson",
+        "backup versions of all information every night",
+    ):
+        assert needed in sec, needed
+    for link in (BCP_LESSON, RAID_LESSON, "The-CIA-Triad-Confidentiality-Integrity-Availability"):
+        assert f"]({link}.md" in sec, link
+
+
+def test_the_raid_section_has_a_table_that_says_what_each_event_does_to_raid_and_to_a_backup():
+    sec = raid_section(text())
+    rows = table_rows(sec)
+    assert len(rows) >= 7, "the guard collected too few rows"
+    events = " ".join(r[0] for r in rows).lower()
+    for needed in ("drive", "deleted", "ransomware", "corrupt", "controller", "fire"):
+        assert needed in events, needed
+    # a drive failure is the one row where RAID helps; every other row says RAID does not
+    first = rows[0]
+    assert "Yes" in first[1] and "drive" in first[0].lower()
+    assert sum("**No**" in r[1] for r in rows) >= 5
+    assert sum("**No**" in r[2] for r in rows) <= 2, "a backup is not a cure for everything either"
+
+
+def test_the_raid_section_guard_bites():
+    assert raid_section(f"x\n{RAID_SECTION}\nbody\n\n## From 3-2-1 to 3-2-1-1-0\ny") == "\nbody\n"
+    bad = ["a drive fails", "Yes", "Yes"], ["ransomware", "Yes", "Yes"]
+    assert sum("**No**" in r[1] for r in bad) == 0
+
+
+def test_the_banner_and_summary_say_the_raid_section_was_added_on_2026_11_01_from_reading():
+    body = text()
+    banner = body.split("## What you will be able to do")[0]
+    assert "2026-11-01" in banner and "issue 421" in banner
+    low = body.split("## What you will be able to do")[1].split("## What the wiki already says")[0].lower()
+    assert "raid" in low and "not a backup" in low
+
+
+def test_the_register_carries_the_raid_sources_read_on_2026_11_01():
+    rows = register_rows(text())
+    joined = " ".join(r[1] for r in rows)
+    for host in (
+        "nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-34r1.pdf",
+        "raid.wiki.kernel.org/index.php/How_to_protect_your_data",
+        "www2.eecs.berkeley.edu/Pubs/TechRpts/1987/CSD-87-391.pdf",
+    ):
+        assert host in joined, host
+    assert sum("2026-11-01" in r[-1] for r in rows) >= 3
+    assert not rows_missing_status(rows)
+
+
+def test_the_common_mistakes_table_names_the_raid_is_a_backup_mistake():
+    block = section(text(), "## Common mistakes", "## Claims register")
+    assert any("RAID" in r[0] and "backup" in r[0].lower() for r in table_rows(block))
 
 
 def test_the_lesson_is_registered_in_contents_and_reading_order_not_the_sidebar():

+ 690 - 0
tests/test_raid_lesson.py

@@ -0,0 +1,690 @@
+# SPDX-License-Identifier: Apache-2.0
+"""The RAID lesson: it leads with continuity and not backup, its drill runs, its figures are computed, it is registered.
+
+docs/wiki/RAID-Levels-Parity-Rebuilds-and-Why-RAID-Is-Continuity-Not-a-Backup.md teaches RAID as a business continuity
+control (issue 421). A page that lets RAID pass for a backup, an exercise answer typed by hand and wrong, a drill whose output
+differs from the page, a command that could reach a real disk, a vendor ranking, a dead link, a missing registration, a
+diagram with no picture or the wrong shape, or a register row with no URL and no date would each teach the wrong thing.
+"""
+
+import json
+import math
+import re
+import struct
+import subprocess
+import sys
+import textwrap
+from pathlib import Path
+
+ROOT = Path(__file__).resolve().parent.parent
+WIKI = ROOT / "docs" / "wiki"
+NAME = "RAID-Levels-Parity-Rebuilds-and-Why-RAID-Is-Continuity-Not-a-Backup"
+PAGE = WIKI / f"{NAME}.md"
+BCP = "Business-Continuity-and-Disaster-Recovery-BCP-and-DR"
+CIA = "The-CIA-Triad-Confidentiality-Integrity-Availability"
+BACKUPS = "Backups-Recovery-and-Patching"
+DEEP = "Backups-Deep-Dive-3-2-1-1-0-Immutability-and-Restore-Testing"
+DATE = "2026-11-01"
+EXERCISE = "## Exercise: size a six-drive shelf on paper"
+FRAMING = "## RAID keeps the system running; a backup keeps the data recoverable"
+LINK = re.compile(r"\]\(([A-Za-z0-9_-]+)\.md(?:#([^)]*))?\)")
+FENCE = re.compile(r"^```(\w*)\n(.*?)^```$", re.MULTILINE | re.DOTALL)
+WRAPPED = re.compile(
+    r"!\[(?P<alt>[^\]\n]*)\]\((?P<path>[^)\n]+)\)\n\n<details>\n<summary>Diagram source \(Mermaid\)</summary>\n\n```mermaid\n(?P<src>.*?)\n```\n\n</details>",
+    re.DOTALL,
+)
+URL = re.compile(r"\]\(https?://[^)\s]+\)")
+STATUS_WORDS = ("Read", "Observed", "Not run", "**est.**", "General knowledge", "Derived")
+IPV4 = re.compile(r"\b(?:\d{1,3}\.){3}\d{1,3}\b")
+BRITISH = ("defence", "behaviour", "colour", "organisation", "centre", "licence", "programme", "analyse", "favour", "realise", "offence", "grey")
+VENDORS = (
+    "seagate",
+    "western digital",
+    "toshiba",
+    "hgst",
+    "hitachi",
+    "samsung",
+    "synology",
+    "qnap",
+    "broadcom",
+    "adaptec",
+    "dell",
+    "netapp",
+    "wd red",
+    "ironwolf",
+    "barracuda",
+)
+TOPICS = (
+    "## What you will be able to do",
+    "## What the wiki already says (and the gap)",
+    FRAMING,
+    "## The words: striping, mirroring, parity, spares",
+    "## The levels, side by side",
+    "## Parity in one XOR, and the price of a small write",
+    "## When a drive fails: degraded, rebuild and the risk window",
+    "## The write hole and power loss",
+    "## Hardware, firmware, software and filesystem RAID",
+    "## What RAID does not protect against",
+    "## Where RAID sits in a continuity plan",
+    "## Where this shows up in this project",
+    "## Free path: a parity drill on your own computer",
+    "## Optional: an array on loopback files (shown, not run)",
+    EXERCISE,
+    "## Build, break, detect, evade, defend (on paper)",
+    "## Checkpoint",
+    "## Common mistakes",
+    "## Not verified, plainly",
+    "## Claims register",
+)
+
+# ---- the formulas the exercise answers come from -----------------------------------------------------------------------
+
+
+def usable_tb(level: str, drives: int, size_tb: float) -> float:
+    return {"RAID 0": drives * size_tb, "RAID 10": drives // 2 * size_tb, "RAID 5": (drives - 1) * size_tb, "RAID 6": (drives - 2) * size_tb}[level]
+
+
+def survive_for_certain(level: str, drives: int) -> int:
+    return {"RAID 0": 0, "RAID 10": 1, "RAID 5": 1, "RAID 6": 2}[level]
+
+
+def survive_best_case(level: str, drives: int) -> int:
+    return {"RAID 0": 0, "RAID 10": drives // 2, "RAID 5": 1, "RAID 6": 2}[level]
+
+
+def small_write_ios(level: str) -> int:
+    """Disk operations for one small write: 1 write; 2 writes to two copies; RAID 5 reads old data and old parity and writes both;
+    RAID 6 does the same with two parities (derived, not in the sources read)."""
+    return {"RAID 0": 1, "RAID 10": 2, "RAID 5": 4, "RAID 6": 6}[level]
+
+
+def random_writes_per_second(level: str, drives: int, per_drive: int) -> float:
+    return drives * per_drive / small_write_ios(level)
+
+
+def mttf_raid_hours(mttf_disk: float, data_disks: int, group: int, check_per_group: int, mttr: float) -> float:
+    """Patterson, Gibson and Katz (1987): MTTF_RAID = MTTF_disk^2 / ((D + C * nG) * (G + C - 1) * MTTR)."""
+    groups = data_disks / group
+    return mttf_disk**2 / ((data_disks + check_per_group * groups) * (group + check_per_group - 1) * mttr)
+
+
+def afr_from_drive_days(failures: int, drive_days: int) -> float:
+    return failures / (drive_days / 365)
+
+
+def chance_any_fails(afr: float, drives: int) -> float:
+    return 1 - (1 - afr) ** drives
+
+
+def chance_of_one_or_more_ure(bits_read: float, rate_per_bit: float) -> float:
+    return 1 - math.exp(-bits_read * rate_per_bit)
+
+
+def rebuild_hours(size_tb: float, mb_per_second: float) -> float:
+    return size_tb * 1e12 / (mb_per_second * 1e6) / 3600
+
+
+def xor_bytes(*blocks: bytes) -> bytes:
+    out = bytearray(len(blocks[0]))
+    for block in blocks:
+        for i, b in enumerate(block):
+            out[i] ^= b
+    return bytes(out)
+
+
+# ---- helpers on the page -----------------------------------------------------------------------------------------------
+
+
+def text() -> str:
+    return PAGE.read_text(encoding="utf-8")
+
+
+def slug(heading: str) -> str:
+    return re.sub(r"[^a-z0-9-]", "", re.sub(r"[^a-z0-9 -]", "", heading.lower()).strip().replace(" ", "-"))
+
+
+def headings(body: str) -> set[str]:
+    return {slug(h) for h in re.findall(r"^#+ (.+)$", body, re.MULTILINE)}
+
+
+def section(body: str, heading: str) -> str:
+    return body.split(f"\n{heading}\n")[1].split("\n## ")[0]
+
+
+def table_rows(block: str) -> list[list[str]]:
+    rows = [line for line in block.splitlines() if line.startswith("|") and not line.startswith("|---")]
+    return [[c.strip() for c in r.strip("|").split("|")] for r in rows[1:]]
+
+
+def register_rows(body: str) -> list[list[str]]:
+    return table_rows(body.split("## Claims register")[1])
+
+
+def rows_missing_status(rows: list[list[str]]) -> list[str]:
+    return [r[0] for r in rows if not any(w in r[-1] for w in STATUS_WORDS)]
+
+
+def sourced_rows_without_url_and_date(rows: list[list[str]]) -> list[str]:
+    exempt = ("The maintainer's framing", "General knowledge", "Derived by the author", "The author's own", "Constructed by the author")
+    bad = []
+    for row in rows:
+        if row[1].startswith(exempt):
+            continue
+        if not URL.search(row[1]) or DATE not in row[2]:
+            bad.append(row[0])
+    return bad
+
+
+def british_words(body: str) -> list[str]:
+    return sorted(w for w in BRITISH if re.search(rf"\b{w}\b", body))
+
+
+def vendor_names(body: str) -> list[str]:
+    low = body.lower()
+    return [v for v in VENDORS if re.search(rf"\b{re.escape(v)}\b", low)]
+
+
+def png_size(path: Path) -> tuple[int, int]:
+    data = path.read_bytes()
+    assert data[:8] == b"\x89PNG\r\n\x1a\n", path
+    return struct.unpack(">II", data[16:24])
+
+
+def too_tall(width: int, height: int) -> bool:
+    return height > 1.6 * width
+
+
+POSTURE = (
+    r"required_approving_review_count",
+    r"required approving review",
+    r"enforce_admins",
+    r"branch protection",
+    r"branch rule",
+    r"stale reviews",
+    r"no human approval",
+    r"github api",
+    r"gh api",
+)
+
+
+def posture_phrases(body: str) -> list[str]:
+    """Statements of this repository's own security settings must not be published."""
+    return [p for p in POSTURE if re.search(p, body, re.IGNORECASE)]
+
+
+# ---- the page ----------------------------------------------------------------------------------------------------------
+
+
+def test_the_banner_says_it_was_written_from_reading_and_names_what_was_not_run():
+    body = text()
+    assert body.startswith("# RAID: levels, parity, rebuilds, and why it is continuity and not a backup")
+    assert "Status: unverified draft" in body
+    assert "**Not run:**" in body and "**Not read:**" in body and DATE in body
+    assert "issue 421" in body
+    assert "defensive and educational" in body.lower()
+
+
+def test_the_page_leads_with_continuity_and_not_a_backup_and_every_topic_has_a_section():
+    body = text()
+    opening = body.split("> Unfamiliar word or acronym?")[0]
+    assert "business continuity" in opening and "not a backup" in opening
+    assert "RAID is not a backup" in body
+    missing = [t for t in TOPICS if f"\n{t}\n" not in body]
+    assert not missing, missing
+    assert body.index(FRAMING) < body.index("## The words: striping"), "the framing comes before the mechanics"
+    assert body.index("## What you will be able to do") < body.index(FRAMING)
+    abilities = section(body, "## What you will be able to do")
+    assert "not a backup" in abilities
+
+
+def test_the_framing_section_has_the_sources_the_maintainer_framing_rests_on():
+    sec = section(text(), FRAMING)
+    for needed in (
+        "availability",
+        "business continuity",
+        "at most one copy",
+        "SP 800-34",
+        "cannot be a replacement for a solid backup strategy",
+        "backup, backup, BACK UP",
+        "RAID is not a panacea",
+        "Patterson, Gibson and Katz",
+        "backup versions of all information every night",
+        "independent",
+    ):
+        assert needed in sec, needed
+    for link in (BCP, CIA, BACKUPS, DEEP):
+        assert f"]({link}.md" in sec, link
+
+
+def test_the_event_table_says_what_raid_survives_and_what_a_backup_survives():
+    sec = section(text(), FRAMING)
+    rows = table_rows(sec)
+    assert len(rows) >= 9, "the guard collected too few rows"
+    events = " ".join(r[0] for r in rows).lower()
+    for needed in ("drive", "deleted", "ransomware", "corrupt", "controller", "fire", "theft", "second drive", "power"):
+        assert needed in events, needed
+    assert "Yes" in rows[0][1] and "drive" in rows[0][0].lower()
+    no_raid = sum("**No**" in r[1] for r in rows)
+    no_backup = sum("**No**" in r[2] for r in rows)
+    assert no_raid >= 6, no_raid
+    assert no_backup <= 2, "a backup is not a cure for everything either, but the table must not say so for most rows"
+    assert any("not" in r[2].lower() or "only if" in r[2].lower() for r in rows), "the backup column has its own conditions"
+    assert not [r[0] for r in rows if len(r) != 3]
+
+
+def test_the_event_table_guard_bites():
+    rows = table_rows("| Event | RAID | Backup |\n|---|---|---|\n| a drive fails | Yes | Yes |\n| ransomware | Yes | Yes |\n")
+    assert sum("**No**" in r[1] for r in rows) == 0
+
+
+def test_every_linked_wiki_page_exists_and_every_anchor_is_a_real_heading():
+    found = LINK.findall(text())
+    assert len({t for t, _ in found}) >= 8, "the guard collected too few links"
+    missing = sorted({t for t, _ in found if not (WIKI / f"{t}.md").exists()})
+    assert not missing, missing
+    bad = [f"{t}#{a}" for t, a in found if a and a not in headings((WIKI / f"{t}.md").read_text(encoding="utf-8"))]
+    assert not bad, bad
+    linked = {t for t, _ in found}
+    for needed in (BCP, CIA, BACKUPS, DEEP, "Glossary", "Hashing-Encryption-and-Keys", "Terminal-and-Your-First-Script"):
+        assert needed in linked, needed
+
+
+def test_the_blast_radius_lesson_is_named_in_plain_text_so_its_link_cap_holds():
+    body = text()
+    assert "Plan-for-Failure-Blast-Radius" not in body
+
+
+def test_the_lesson_is_registered_in_nav_contents_reading_order_home_and_sidebar():
+    nav = (WIKI / "_nav.yaml").read_text(encoding="utf-8")
+    line = next(row for row in nav.splitlines() if f"page: {NAME}," in row)
+    assert 'status: "draft"' in line and "Recovery, patching, virtual machines and Windows" in line
+    for special in ("Contents.md", "Reading-Order.md", "Home.md", "_Sidebar.md"):
+        assert f"{NAME}.md" in (WIKI / special).read_text(encoding="utf-8"), special
+
+
+def test_the_backups_deep_dive_links_this_lesson_and_this_lesson_links_it_back():
+    assert f"]({NAME}.md" in (WIKI / f"{DEEP}.md").read_text(encoding="utf-8")
+    assert f"]({DEEP}.md" in text()
+
+
+def test_glossary_rows_point_at_real_headings_and_none_repeats_a_term():
+    heads = headings(text())
+    anchors = set()
+    rows = 0
+    glossary = (WIKI / "Glossary.md").read_text(encoding="utf-8")
+    for line in glossary.splitlines():
+        if f"{NAME}.md" in line:
+            rows += 1
+            anchors.update(re.findall(rf"{NAME}\.md#([a-z0-9-]+)", line))
+    assert rows >= 11, "expected glossary rows for the new terms"
+    assert anchors and anchors <= heads, sorted(anchors - heads)
+    terms = [m.group(1).lower() for m in re.finditer(r"^\| \*\*([^*]+)\*\* \|", glossary, re.MULTILINE)]
+    assert len(terms) > 100, "the guard collected too few glossary terms"
+    mine = [m.group(1).lower() for m in re.finditer(rf"^\| \*\*([^*]+)\*\* \|[^\n]*{NAME}\.md", glossary, re.MULTILINE)]
+    assert len(mine) == rows, (len(mine), rows)
+    repeated = sorted({t for t in mine if terms.count(t) > 1})
+    assert not repeated, repeated
+    for term in ("raid", "striping", "mirroring", "parity", "hot spare", "degraded array", "write hole"):
+        assert any(t.startswith(term) for t in mine), term
+    assert sorted({t for t in ["a", "b", "a"] if ["a", "b", "a"].count(t) > 1}) == ["a"], "the repeat guard bites"
+
+
+def test_american_spelling_no_em_dashes_no_addresses_and_no_vendor_names_outside_the_register():
+    body = text()
+    low = body.lower()
+    assert "—" not in body
+    assert not IPV4.findall(body), IPV4.findall(body)
+    assert not british_words(low), british_words(low)
+    prose = body.split("## Claims register")[0]
+    assert not vendor_names(prose), vendor_names(prose)
+    assert "raid" in low, "the guard collected nothing"
+    for banned in ("most reliable brand", "best brand", "we recommend buying", "buy the"):
+        assert banned not in low, banned
+
+
+def test_the_spelling_and_vendor_guards_bite():
+    assert british_words("the organisation's defence and an offence") == ["defence", "offence", "organisation"]
+    assert not british_words("the organization's defense and impact analyses")
+    assert vendor_names("Seagate and WD Red drives") == ["seagate", "wd red"]
+    assert not vendor_names("a NAS line sold for arrays")
+
+
+def test_every_table_has_a_named_first_header_cell():
+    bad = []
+    lines = text().splitlines()
+    tables = 0
+    for i, line in enumerate(lines[:-1]):
+        if line.startswith("|") and lines[i + 1].startswith("|---") and (i == 0 or not lines[i - 1].startswith("|")):
+            tables += 1
+            if not line.strip("|").split("|")[0].strip():
+                bad.append(i + 1)
+    assert tables >= 8, "the guard collected too few tables"
+    assert not bad, bad
+
+
+def test_no_security_posture_detail_of_this_repository_is_on_the_page_and_the_guard_bites():
+    body = text()
+    assert "raid" in body.lower(), "the guard collected nothing"
+    assert not posture_phrases(body), posture_phrases(body)
+    assert posture_phrases("check the branch protection settings")
+    assert not posture_phrases("check the settings in your own system")
+
+
+# ---- diagrams ----------------------------------------------------------------------------------------------------------
+
+
+def test_every_diagram_has_alt_text_a_source_a_picture_and_a_wide_shape():
+    body = text()
+    found = list(WRAPPED.finditer(body))
+    assert len(found) == 3, "expected three diagrams"
+    assert len(re.findall(r"```mermaid", body)) == len(found), "a Mermaid block has no picture above it"
+    manifest = json.loads((ROOT / "docs" / "diagrams.json").read_text())
+    for m in found:
+        alt = m["alt"].strip()
+        assert 20 <= len(alt) <= 150, alt
+        png = (PAGE.parent / m["path"]).resolve()
+        assert png.is_file(), m["path"]
+        assert png.relative_to(ROOT).as_posix() in manifest, m["path"]
+        assert m["src"].lstrip().startswith("flowchart LR"), m["path"]
+        width, height = png_size(png)
+        assert not too_tall(width, height), (m["path"], width, height)
+
+
+def test_the_diagram_guards_bite():
+    bare = "![alt text here](images/x.png)\n\nno details block, so no source\n"
+    assert not WRAPPED.search(bare)
+    good = "![alt text here](images/x.png)\n\n<details>\n<summary>Diagram source (Mermaid)</summary>\n\n```mermaid\nflowchart LR\n  a --> b\n```\n\n</details>"
+    assert WRAPPED.search(good)
+    assert not WRAPPED.search(good.replace("<details>\n", ""))
+    assert too_tall(100, 161) and not too_tall(100, 160)
+
+
+def test_the_diagrams_cover_what_raid_survives_the_layouts_and_the_risk_window():
+    found = list(WRAPPED.finditer(text()))
+    alts = " ".join(m["alt"].lower() for m in found)
+    for topic in ("backup", "level", "rebuild"):
+        assert topic in alts, topic
+    sources = " ".join(m["src"] for m in found)
+    for needed in ("RAID 0", "RAID 1", "RAID 5", "RAID 6", "RAID 10", "degraded", "ransomware", "deleted"):
+        assert needed in sources, needed
+
+
+# ---- the register ------------------------------------------------------------------------------------------------------
+
+
+def test_every_claims_register_row_has_a_status_a_url_and_the_read_date():
+    rows = register_rows(text())
+    assert len(rows) >= 18, "the guard collected too few rows"
+    assert not rows_missing_status(rows)
+    assert not sourced_rows_without_url_and_date(rows)
+    joined = " ".join(r[1] for r in rows)
+    for host in (
+        "www2.eecs.berkeley.edu/Pubs/TechRpts/1987/CSD-87-391.pdf",
+        "nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-34r1.pdf",
+        "raid.wiki.kernel.org/index.php/How_to_protect_your_data",
+        "raid.wiki.kernel.org/index.php/Scrubbing_the_drives",
+        "raid.wiki.kernel.org/index.php/Timeout_Mismatch",
+        "raid.wiki.kernel.org/",
+        "docs.kernel.org/admin-guide/md.html",
+        "docs.kernel.org/driver-api/md/raid5-ppl.html",
+        "docs.kernel.org/driver-api/md/raid5-cache.html",
+        "man7.org/linux/man-pages/man8/mdadm.8.html",
+        "man7.org/linux/man-pages/man8/losetup.8.html",
+        "openzfs.github.io/openzfs-docs/Basic%20Concepts/Pool%20Structure/RAIDZ.html",
+        "openzfs.github.io/openzfs-docs/man/master/8/zpool-scrub.8.html",
+        "learn.microsoft.com/en-us/windows-server/storage/storage-spaces/fault-tolerance",
+        "backblaze.com/cloud-storage/resources/hard-drive-test-data",
+    ):
+        assert host in joined, host
+    assert sum(DATE in r[2] for r in rows) >= 14
+
+
+def test_the_register_guards_bite():
+    assert rows_missing_status([["X", "y", "maybe"]]) == ["X"]
+    assert sourced_rows_without_url_and_date([["X", "[p](https://example.com/p)", "Read 2026-10-31"]]) == ["X"]
+    assert sourced_rows_without_url_and_date([["X", "a page", "Read 2026-11-01"]]) == ["X"]
+    assert not sourced_rows_without_url_and_date([["X", "General knowledge", "est."]])
+
+
+# ---- facts that can be checked on the page -----------------------------------------------------------------------------
+
+
+def test_the_levels_table_matches_the_formulas():
+    sec = section(text(), "## The levels, side by side")
+    rows = table_rows(sec)
+    names = [r[0] for r in rows]
+    assert len(rows) >= 6, "the guard collected too few rows"
+    for needed in ("RAID 0", "RAID 1", "RAID 5", "RAID 6", "RAID 10", "RAIDZ"):
+        assert any(n.startswith(needed) for n in names), needed
+    by = {r[0].split(" (")[0]: r for r in rows}
+    assert "(n - 1)" in by["RAID 5"][2] and "(n - 2)" in by["RAID 6"][2]
+    assert "n / 2" in by["RAID 10"][2] and "all n" in by["RAID 0"][2]
+    assert "one" in by["RAID 5"][3].lower() and "two" in by["RAID 6"][3].lower() and "none" in by["RAID 0"][3].lower()
+    assert "Not a backup" in sec or "not a backup" in sec
+
+
+def test_the_exercise_capacity_table_is_computed_here_and_matches_the_page():
+    ex = section(text(), EXERCISE)
+    cap = [r for r in table_rows(ex) if r[0].startswith("RAID") and len(r) == 7]
+    assert [r[0].split(" (")[0] for r in cap] == ["RAID 0", "RAID 10", "RAID 5", "RAID 6"], [r[0] for r in cap]
+    drives, size = 6, 8
+    for r in cap:
+        level = r[0].split(" (")[0]
+        assert int(r[1]) == drives
+        assert int(r[2]) == usable_tb(level, drives, size), level
+        assert r[3] == f"{usable_tb(level, drives, size) / (drives * size):.0%}", level
+        assert int(r[4]) == survive_for_certain(level, drives), level
+        assert int(r[5]) == survive_best_case(level, drives), level
+        assert int(r[6]) == small_write_ios(level), level
+
+
+def test_the_exercise_write_table_is_computed_here_and_matches_the_page():
+    ex = section(text(), EXERCISE)
+    rows = [r for r in table_rows(ex) if r[0].startswith("RAID") and len(r) == 2]
+    assert [r[0].split(" (")[0] for r in rows] == ["RAID 0", "RAID 10", "RAID 5", "RAID 6"]
+    for r in rows:
+        level = r[0].split(" (")[0]
+        assert float(r[1].replace(",", "")) == random_writes_per_second(level, 6, 150), level
+    assert "150" in ex and "est." in ex
+
+
+def test_the_exercise_reliability_figures_are_the_ones_the_formulas_give():
+    ex = section(text(), EXERCISE)
+    one_group = mttf_raid_hours(30_000, 100, 10, 1, 1)
+    wide = mttf_raid_hours(30_000, 100, 25, 1, 1)
+    day = mttf_raid_hours(30_000, 100, 10, 1, 24)
+    assert round(one_group) == 818_182 and round(wide) == 346_154 and round(day) == 34_091
+    for needed in (
+        f"{one_group:,.0f} hours",
+        f"{one_group / 8760:.1f} years",
+        f"{wide:,.0f} hours",
+        f"{day:,.0f} hours",
+        f"{day / 8760:.1f} years",
+        "820,000",
+        "346,000",
+    ):
+        assert needed in ex, needed
+    # The paper's own table agrees with the formula to the figure it prints.
+    assert abs(one_group - 820_000) / 820_000 < 0.005 and abs(wide - 346_000) / 346_000 < 0.005
+    assert mttf_raid_hours(30_000, 100, 10, 1, 24) < mttf_raid_hours(30_000, 100, 10, 1, 1) / 20, "a slower repair costs most of the margin"
+
+
+def test_the_exercise_failure_rate_and_rebuild_figures_are_computed_here():
+    ex = section(text(), EXERCISE)
+    afr = afr_from_drive_days(1_498, 31_553_350)
+    assert f"{afr:.2%}" == "1.73%"
+    assert "1,498" in ex and "31,553,350" in ex and "1.73%" in ex
+    year = chance_any_fails(0.0173, 6)
+    assert f"{year:.1%}" in ex, f"{year:.1%}"
+    bits = 5 * 8e12 * 8
+    assert bits == 3.2e14
+    pessimistic = chance_of_one_or_more_ure(bits, 1e-14)
+    better = chance_of_one_or_more_ure(bits, 1e-15)
+    assert f"{pessimistic:.0%}" in ex and f"{better:.0%}" in ex, (f"{pessimistic:.0%}", f"{better:.0%}")
+    assert f"{rebuild_hours(8, 150):.1f} hours" in ex and f"{rebuild_hours(8, 50):.1f} hours" in ex
+    assert "3.2" in ex and "1 in 10^14" in ex and "1 in 10^15" in ex
+    assert "I did not read" in ex or "not read" in ex.lower()
+
+
+def test_the_formula_guards_bite():
+    assert usable_tb("RAID 5", 6, 8) != 6 * 8
+    assert usable_tb("RAID 5", 6, 8) == 40 and usable_tb("RAID 6", 6, 8) == 32 and usable_tb("RAID 10", 6, 8) == 24
+    assert survive_best_case("RAID 10", 6) == 3 and survive_for_certain("RAID 10", 6) == 1
+    assert random_writes_per_second("RAID 5", 6, 150) == 225
+    assert mttf_raid_hours(30_000, 100, 10, 1, 2) != mttf_raid_hours(30_000, 100, 10, 1, 1)
+    assert round(afr_from_drive_days(1_498, 31_553_350), 4) == 0.0173
+    assert chance_of_one_or_more_ure(3.2e14, 1e-14) > chance_of_one_or_more_ure(3.2e14, 1e-15)
+    assert round(rebuild_hours(8, 150), 1) == 14.8
+
+
+def test_the_exercise_is_synthetic_and_says_so_and_the_answers_say_what_they_do_not_show():
+    ex = section(text(), EXERCISE)
+    assert "made-up" in ex and "Example Shelf" in ex
+    assert "independent" in ex and "correlated" in ex
+    assert "Not run" in ex or "not run" in ex
+    assert "worst case" in ex or "maximum" in ex
+
+
+# ---- the drill ---------------------------------------------------------------------------------------------------------
+
+
+def script() -> str:
+    found = [textwrap.dedent(b) for t, b in FENCE.findall(text()) if t == "python" and "# raid_drill.py - " in b]
+    assert len(found) == 1, f"expected one raid_drill.py block, found {len(found)}"
+    return found[0]
+
+
+def test_the_drill_runs_and_its_output_matches_the_page(tmp_path):
+    path = tmp_path / "raid_drill.py"
+    path.write_text(script())
+    done = subprocess.run(
+        [sys.executable, "-I", str(path)],
+        capture_output=True,
+        text=True,
+        timeout=60,
+        check=False,
+        cwd=tmp_path,
+        env={"TMPDIR": str(tmp_path), "PATH": "/usr/bin:/bin"},
+    )
+    assert done.returncode == 0, done.stderr
+    shown = next(b for t, b in FENCE.findall(text()) if t == "text" and b.startswith("== Parity"))
+    got = [line.rstrip() for line in done.stdout.strip().splitlines()]
+    want = [line.rstrip() for line in shown.strip().splitlines()]
+    assert got == want
+    assert not [p for p in tmp_path.iterdir() if p.name.startswith("raid-drill-")], "the script must delete its own lab folder"
+
+
+def test_the_drill_results_agree_with_an_independent_xor():
+    a, b, c = (bytes((i * k + 7) % 256 for i in range(16)) for k in (3, 5, 11))
+    parity = xor_bytes(a, b, c)
+    assert xor_bytes(a, c, parity) == b, "the lost drive comes back from the others and the parity"
+    new_a = bytes((x + 1) % 256 for x in a)
+    new_parity = xor_bytes(xor_bytes(a, new_a), parity)
+    assert new_parity == xor_bytes(new_a, b, c), "the small-write rule: new parity = (old data xor new data) xor old parity"
+    stale = xor_bytes(new_a, b, parity)
+    assert stale != c, "a stale parity rebuilds the wrong data"
+
+
+DRILL_BANNED = ("subprocess", "os.system", "sudo", "/dev/", "socket", "urllib", "requests", "os.remove", "shutil.move", "..\\")
+
+
+def drill_problems(body: str) -> list[str]:
+    found = [b for b in DRILL_BANNED if b in body]
+    if re.search(r"open\(\s*[\"']/", body):
+        found.append("an absolute path is opened")
+    return found
+
+
+def test_the_drill_never_touches_anything_outside_its_own_folder():
+    body = script()
+    assert "tempfile.mkdtemp" in body and "shutil.rmtree(lab)" in body and "finally:" in body
+    assert not drill_problems(body), drill_problems(body)
+    assert body.count("rmtree") == 1
+
+
+def test_the_drill_guard_bites():
+    assert drill_problems('open("/etc/passwd")') == ["an absolute path is opened"]
+    assert drill_problems("import subprocess") == ["subprocess"]
+    assert drill_problems("path = '/dev/sda'") == ["/dev/"]
+    assert not drill_problems("(lab / 'drive1.bin').write_bytes(data)")
+
+
+def test_the_drill_output_says_the_things_the_lesson_claims():
+    shown = next(b for t, b in FENCE.findall(text()) if t == "text" and b.startswith("== Parity"))
+    for needed in ("rebuilt drive 2 matches the original: True", "rebuilt drive 3 matches the original: False", "silent", "mirror", "backup"):
+        assert needed in shown, needed
+
+
+# ---- the optional loopback block: shown, never run ---------------------------------------------------------------------
+
+ALLOWED_DEVICE = re.compile(r"^/dev/(?:md/lab|loop<[A-D]>)$")
+
+
+def mdadm_block() -> str:
+    found = [b for t, b in FENCE.findall(text()) if t == "bash" and "mdadm" in b]
+    assert len(found) == 1, f"expected one mdadm block, found {len(found)}"
+    return found[0]
+
+
+def device_problems(block: str) -> list[str]:
+    return [d for d in re.findall(r"/dev/[A-Za-z0-9_/<>-]+", block) if not ALLOWED_DEVICE.match(d)]
+
+
+def test_the_loopback_block_is_marked_not_run_and_names_only_the_readers_own_files():
+    block = mdadm_block()
+    assert block.lstrip().startswith("# NOT RUN"), "the block says it was not run on its first line"
+    assert not device_problems(block), device_problems(block)
+    for needed in ("truncate -s", "losetup --find --show", "mdadm --create", "--level=5", "--fail", "--remove", "--add", "--stop", "losetup -d", "--zero-superblock"):
+        assert needed in block, needed
+    assert block.index("--stop") < block.index("losetup -d"), "the array is stopped before the loop devices are released"
+    prose = text().split("## Optional: an array on loopback files")[1].split("\n## ")[0]
+    assert "Not run" in prose and "root" in prose and "only on files you made" in prose
+    assert "mdadm --create" in prose and "existing array" in prose, "the warning about --create on an existing array is there"
+
+
+def test_the_loopback_guard_bites():
+    assert device_problems("mdadm --create /dev/md/lab /dev/sda1 /dev/loop<A>") == ["/dev/sda1"]
+    assert device_problems("mdadm --detail /dev/nvme0n1") == ["/dev/nvme0n1"]
+    assert not device_problems("mdadm --create /dev/md/lab /dev/loop<A> /dev/loop<B>")
+
+
+# ---- the rest ----------------------------------------------------------------------------------------------------------
+
+
+def test_the_project_table_cites_existing_files_or_says_none():
+    sec = section(text(), "## Where this shows up in this project")
+    rows = table_rows(sec)
+    assert len(rows) >= 5, "the guard collected too few rows"
+    for r in rows:
+        paths = re.findall(r"`((?:modules|stacks|scripts|docs|\.github|tests)/[A-Za-z0-9_./-]+)`", r[2])
+        assert all((ROOT / p).exists() for p in paths), r[0]
+        assert paths or r[2].startswith("None"), r[0]
+    assert sum(r[2].startswith("None") for r in rows) >= 2
+    assert "no RAID" in sec or "no word RAID" in sec
+
+
+def test_what_the_page_did_not_read_is_named():
+    part = section(text(), "## Not verified, plainly")
+    for needed in (
+        "datasheet",
+        "hardware RAID",
+        "ZFS",
+        "Storage Spaces",
+        "mdadm --create",
+        "RAID 2",
+        "Not run",
+        "SNIA",
+        "Backblaze",
+        "level 3",
+    ):
+        assert needed in part, needed
+
+
+def test_the_drill_and_exercise_say_run_or_not_run_for_every_command_block():
+    body = text()
+    blocks = [(t, b) for t, b in FENCE.findall(body) if t in ("bash", "python")]
+    assert len(blocks) >= 3, "the guard collected too few code blocks"
+    for t, b in blocks:
+        first = b.lstrip().splitlines()[0]
+        assert first.startswith(("# NOT RUN", "#!/usr/bin/env python3", "python3 -I raid_drill.py")), first
+    assert "**Observed**" in body or "Observed" in body.split("## Claims register")[1]