What it means
RAID spreads data across several drives so that the set behaves as one. The levels differ in how. RAID 0 stripes data for speed and has no redundancy. RAID 1 mirrors each drive. RAID 5 adds parity, extra data that lets the array work out the contents of one lost drive, and needs at least three drives. RAID 6 keeps two sets of parity and survives two failures. RAID 10 stripes across mirrored pairs. A redundant array keeps serving data when a drive dies and rebuilds onto a replacement. It protects availability against hardware failure. It keeps no earlier version of anything.
See the idea / Resilience
RAID survives a failed drive, not a bad write.
Follow one stripe of a RAID 5 array through a drive failure and a rebuild. Then see what the same array does with a bad write.
A three-drive RAID 5 array at Meridian. A stripe is one row of blocks across the drives. Each stripe holds two data blocks and one parity block. Parity is the XOR of the two data blocks. XOR is a bit-by-bit operation with one useful property: from any two of the three values you can work out the third. In this stripe, drive 1 holds 5A, drive 2 holds 3C and drive 3 holds the parity, 66. All values are hexadecimal. Compare a failed drive with a bad write.
01 / 04
Healthy
All three drives work. The stripe holds 5A, 3C and parity 66. The array can lose any one of the three.
More about this step
Parity is the XOR of the data blocks: 5A XOR 3C is 66. Any one of the three values can be worked out from the other two, which is what makes a rebuild possible. A stripe is one row of blocks across the drives. XOR is a bit-by-bit operation. The values are hexadecimal.
Step through at your own pace.
Keep in mindOne stripe with one-byte blocks. Real parity moves between drives from stripe to stripe. RAID 0 has no redundancy. RAID 1 and RAID 10 use mirrors instead of parity, and RAID 6 uses two parity sets to survive two failures. Rebuild time is not shown. The lesson’s ledger uses RAID 10, where the same limit applies: a mirror copies a bad write at once.
Read the visual, step by step
Drive 2 fails
- Healthy. All three drives work. The stripe holds 5A, 3C and parity 66. The array can lose any one of the three. Parity is the XOR of the data blocks: 5A XOR 3C is 66. Any one of the three values can be worked out from the other two, which is what makes a rebuild possible. A stripe is one row of blocks across the drives. XOR is a bit-by-bit operation. The values are hexadecimal.
- Fail. Drive 2 fails. The array keeps serving the file. On each read it works out the missing block from drive 1 and parity. 5A XOR 66 is 3C, the block that was on drive 2. Users notice nothing except slower reads. The array is now degraded, which means it has no redundancy left.
- Replace. Kael swaps in a new, empty drive. Until the rebuild finishes, a second drive failure would destroy the array. RAID 5 survives one failure. During the rebuild every remaining drive is read from end to end, which is when a second weak drive tends to show itself.
- Rebuild. The array computes 5A XOR 66, which is 3C, and writes it to the new drive. All three drives hold the stripe again. The same calculation runs for every stripe on the array. When it finishes, the array can again lose any one drive.
A bad write
- Healthy. All three drives work. The stripe holds 5A, 3C and parity 66. The array can lose any one of the three. Parity is the XOR of the data blocks: 5A XOR 3C is 66. Any one of the three values can be worked out from the other two, which is what makes a rebuild possible. A stripe is one row of blocks across the drives. XOR is a bit-by-bit operation. The values are hexadecimal.
- Overwrite. An application writes 00 over the block on drive 2. The array carries out the write and updates parity to match. This is the array doing its job. A write is a write, whether it is correct or corrupt. The new parity is 5A XOR 00, which is 5A.
- Check. The array reports healthy. Parity matches the data on the drives, so there is nothing to rebuild. No drive failed, so no alarm fires. From the array’s point of view the stripe is consistent. The old parity value 66 was replaced along with the data.
- Restore. RAID holds no earlier copy of 3C. Only a backup taken before the write can bring it back. This is why the lesson keeps the backups after moving the ledger to RAID. RAID answers a dead drive. A backup answers a deleted, encrypted or corrupted file.
One stripe with one-byte blocks. Real parity moves between drives from stripe to stripe. RAID 0 has no redundancy. RAID 1 and RAID 10 use mirrors instead of parity, and RAID 6 uses two parity sets to survive two failures. Rebuild time is not shown. The lesson’s ledger uses RAID 10, where the same limit applies: a mirror copies a bad write at once.
Flow references: Patterson, Gibson and Katz: A Case for Redundant Arrays of Inexpensive Disks (RAID)
AN ILLUSTRATIVE SCENARIO
Parity rebuilds a drive, not a mistake
A three-drive RAID 5 array at Meridian holds 5A and 3C in one stripe, with parity 66. When drive 2 fails, the array computes 5A XOR 66 and gets 3C back, first for each read and then onto a replacement drive. When an application instead overwrites 3C with 00, the array stores the bad value, updates parity and reports healthy. Only a backup still holds 3C.
Put it to work
- Choose the level from what the system must survive and how fast it must rebuild, not from which level gives the most space.
- Monitor drive health and array state, and alert the moment an array becomes degraded, because it has no redundancy until the rebuild ends.
- Keep separate backups that the production system cannot change, and test restoring from them.
How to check your work
On a test array, pull one drive and confirm the data stays readable, an alert fires, and a replacement rebuilds. Then delete a test file and confirm you can bring it back from backup, not from the array.
Connect the ideas
- Backup
A copy of data kept so integrity and availability can be restored after loss, preferably beyond the production identity’s reach.
- Availability
The property that authorized people can use a system or record when they need it.
- RTO
The longest time a system may stay unavailable after a disruption before the harm becomes unacceptable. It is a target set in the business impact analysis, and a timed restore shows whether it can be met.
- Ransomware
Malware or an operator model that denies availability of data, often by encryption, sometimes with theft for extra pressure.