LFCE 117 ๐ง RAID โ Concepts
RAID is a storage virtualization technique that combines multiple physical disks into a single logical unit. The acronym stands for Redundant Array of Independent Disks, and the “redundant” part is optional depending on the level. RAID exists to solve two problems that a single disk cannot: capacity and throughput limits on one side, and the risk of a single disk failure destroying all data on the other. Different RAID levels trade capacity, performance, and fault tolerance against each other, and the correct choice depends on which of those three properties the workload values most.
This chapter covers the conceptual foundation of RAID: the three core techniques of mirroring, striping, and parity, and the five levels that the LFCE expects you to understandโRAID 0, 1, 5, 6, and 10. It explains what each level does mechanically, what it costs in usable capacity, what it survives in terms of disk failures, and what it does not protect against. By the end, you will be able to read a RAID level description and predict its performance characteristics, its capacity overhead, and its failure semantics without consulting a table.
Key point: RAID is not a backup. It protects against disk failure, not against deletion, corruption, ransomware, or a controller that writes garbage to every disk simultaneously. A RAID array with no separate backup is a single logical volume with a single logical point of failure.
Why RAID exists
The single-disk capacity problem. A single disk has a fixed capacity and a fixed maximum throughput. When an application needs more space than one disk provides, or more read/write bandwidth than one spindle can deliver, RAID combines multiple disks into a volume that is larger and faster than any individual member. RAID 0 does this without redundancy; the other levels add redundancy at the cost of usable capacity .
The single-disk failure problem. Disks fail. The failure rate is low per drive-hour, but an array of dozens of drives experiences failures regularly. RAID 1, 5, 6, and 10 store redundant information so that the array continues to serve data when one or more member disks fail. The array enters a degraded state, and a rebuild restores redundancy once a replacement disk is installed .
The performance asymmetry problem. Different workloads have different I/O patterns. A database does many small random reads and writes. A video server does long sequential reads. RAID levels are tuned for different patterns: RAID 5 spreads parity across disks to avoid the write bottleneck of a dedicated parity disk, while RAID 10 mirrors and stripes to favor write-heavy random I/O. The choice of level is a performance decision as much as a redundancy decision .
The rebuild risk problem. When a disk fails in a parity-based array (RAID 5 or 6), the array must read from every surviving disk to reconstruct the missing data. This rebuild process is I/O-intensive, takes hours for large disks, and during the rebuild the array has no redundancy for a second failure. RAID 6 exists because the rebuild window in RAID 5 with large drives is long enough that a second failure is a realistic risk .
a. The three core techniques
Every RAID level is a combination of three techniques. Understanding them individually makes the levels predictable.
Mirroring writes identical data to two or more disks. A read can be served from any mirror member, which can improve read performance. A write must reach every mirror member before it is considered complete, which slightly reduces write performance. Mirroring provides fault tolerance equal to the number of mirrors minus one: a two-way mirror survives one disk failure; a three-way mirror survives two .
Striping splits data into chunks and distributes those chunks across multiple disks. A large read or write can be served in parallel by multiple disks, which increases throughput. Striping alone provides no redundancy: if any member disk fails, the data on that disk is lost, and the array is unusable. RAID 0 is pure striping .
Parity stores a calculated value that allows the data on a failed disk to be reconstructed from the surviving disks. The parity calculation is typically XOR: for a stripe of data blocks D1, D2, and D3, the parity block P is D1 XOR D2 XOR D3. If D2 is lost, it can be recovered as D1 XOR D3 XOR P. Parity provides redundancy with less capacity overhead than mirroring, but the calculation and the need to read old data before writing new data make writes slower than mirrored writes .
b. RAID 0: striping without redundancy
RAID 0 requires at least two disks. Data is striped across all members. There is no mirror and no parity. The usable capacity is the sum of all member disks. Read and write performance scales with the number of disks, up to the limits of the controller and the bus.
RAID 0 provides zero fault tolerance. If any member disk fails, the entire array is lost. There is no rebuild, because there is no redundant information to rebuild from. RAID 0 is appropriate only for data that can be regenerated or restored from another source: scratch space, temporary files, or a cache that is backed by a durable store elsewhere .
c. RAID 1: mirroring
RAID 1 requires at least two disks. Every write goes to both disks. The usable capacity is the capacity of one disk, regardless of how many mirrors are in the set. Read performance can be higher than a single disk because reads can be distributed across mirrors. Write performance is roughly that of a single disk, sometimes slightly lower because the write must complete on every mirror.
RAID 1 survives the failure of any one disk in a two-way mirror. The array continues to serve reads and writes from the surviving disk. When the failed disk is replaced, the array rebuilds by copying the surviving disk to the new one. RAID 1 is the simplest redundant level and the easiest to reason about, which is why it is often used for boot volumes and small critical datasets .
d. RAID 5: striping with distributed parity
RAID 5 requires at least three disks. Data is striped across all members, and parity is also striped across all members. No single disk holds all the parity. The usable capacity is the capacity of all disks minus one disk’s worth: an N-disk RAID 5 array has the capacity of Nโ1 disks.
RAID 5 survives the failure of one disk. When a disk fails, the array reads the surviving data and parity blocks and reconstructs the missing data on the fly. Performance in the degraded state is lower, especially for reads, because every read of a missing block requires a reconstruction calculation. When a replacement disk is installed, the array rebuilds by reading all surviving disks and writing the reconstructed data to the new disk. RAID 5 is a common choice for general-purpose storage where capacity efficiency matters more than write performance .
The write penalty is the defining characteristic of RAID 5. A small write requires reading the old data and old parity, calculating the new parity, and writing the new data and new parity. This is four I/O operations for one logical write. Large sequential writes can be combined into full-stripe writes that avoid the read-modify-write cycle, which is why RAID 5 performs better for sequential workloads than for random small writes .
e. RAID 6: striping with dual parity
RAID 6 requires at least four disks. It uses two independent parity blocks per stripe, distributed across the members. The usable capacity is the capacity of all disks minus two disks’ worth: an N-disk RAID 6 array has the capacity of Nโ2 disks.
RAID 6 survives the failure of any two disks. This is its purpose. During the rebuild of a RAID 5 array after a single disk failure, the array has no redundancy. If a second disk fails during that window, the array is lost. RAID 6 eliminates that window for a single failure and provides a second failure tolerance during the rebuild of the first. The cost is additional parity calculation overhead, which makes writes slower than RAID 5, and the loss of an additional disk’s capacity .
f. RAID 10: mirrored stripes
RAID 10 is a nested level: it combines RAID 1 and RAID 0. The most common implementation mirrors first and then stripes: data is written to a mirror pair, and the mirror pairs are striped together. RAID 10 requires at least four disks, and the number of disks is typically even.
The usable capacity is half the total raw capacity, because every block is stored twice. Read performance is high because reads can be served from any mirror in the stripe. Write performance is also high because the stripe distributes writes across multiple mirror pairs, and each write only needs to reach two disks (the mirror pair) rather than calculating parity. RAID 10 survives the failure of one disk in each mirror pair. It does not survive the failure of both disks in the same mirror pair .
Complete Example Session
# ============================================
# PART 1: THE THREE TECHNIQUES
# ============================================
# Mirroring: identical data on two disks
# Disk A: [block 1][block 2][block 3]
# Disk B: [block 1][block 2][block 3]
#
# Striping: data split across disks
# Disk A: [block 1][block 3][block 5]
# Disk B: [block 2][block 4][block 6]
#
# Parity: calculated redundancy
# Disk A: [D1][D2][P]
# Disk B: [D3][P][D4]
# Disk C: [P][D5][D6]
# ============================================
# PART 2: RAID 0 CAPACITY AND FAILURE
# ============================================
# Four 1 TB disks in RAID 0
# Usable capacity: 4 TB
# Fault tolerance: 0 disks
# If disk 2 fails: entire array lost
# Read performance: 4x single disk (theoretical)
# Write performance: 4x single disk (theoretical)
# ============================================
# PART 3: RAID 1 CAPACITY AND FAILURE
# ============================================
# Two 1 TB disks in RAID 1
# Usable capacity: 1 TB
# Fault tolerance: 1 disk
# If disk 1 fails: array continues on disk 2
# Read performance: up to 2x single disk
# Write performance: approximately 1x single disk
# ============================================
# PART 4: RAID 5 CAPACITY AND FAILURE
# ============================================
# Four 1 TB disks in RAID 5
# Usable capacity: 3 TB (N-1)
# Fault tolerance: 1 disk
# If disk 3 fails: array degrades, reads reconstruct
# Rebuild: reads all surviving disks, writes to replacement
# Write penalty: 4 I/O per small write
# ============================================
# PART 5: RAID 6 CAPACITY AND FAILURE
# ============================================
# Six 1 TB disks in RAID 6
# Usable capacity: 4 TB (N-2)
# Fault tolerance: 2 disks
# If disk 2 and disk 5 fail: array continues
# Write penalty: 6 I/O per small write
# Rebuild window protected against second failure
# ============================================
# PART 6: RAID 10 CAPACITY AND FAILURE
# ============================================
# Four 1 TB disks in RAID 10 (two mirror pairs)
# Usable capacity: 2 TB
# Fault tolerance: 1 disk per mirror pair
# If disk 1 and disk 3 fail: array continues
# If disk 1 and disk 2 fail: array lost
# Read/write performance: high, no parity calculation
# ============================================
# PART 7: PARITY CALCULATION
# ============================================
# XOR parity for a stripe:
# D1 = 0x1A, D2 = 0x2B, D3 = 0x3C
# P = D1 XOR D2 XOR D3
# P = 0x1A XOR 0x2B = 0x31
# 0x31 XOR 0x3C = 0x0D
#
# If D2 is lost:
# D2 = D1 XOR D3 XOR P
# D2 = 0x1A XOR 0x3C XOR 0x0D = 0x2B
# ============================================
# PART 8: DEGRADED STATE
# ============================================
# RAID 5 with one failed disk:
# State: degraded
# Redundancy: none
# Reads: reconstructed from parity
# Writes: parity recalculated without failed disk
# Risk: second failure destroys the array
# ============================================
# PART 9: REBUILD PROCESS
# ============================================
# RAID 5 rebuild after disk replacement:
# 1. New disk inserted
# 2. Controller marks it as spare
# 3. For each stripe, data is reconstructed from
# surviving data and parity
# 4. Reconstructed data written to new disk
# 5. Array returns to optimal state
# Duration: hours for multi-TB disks
# ============================================
# PART 10: RAID IS NOT BACKUP
# ============================================
# RAID protects against: disk failure
# RAID does not protect against:
# - Accidental deletion
# - Filesystem corruption
# - Ransomware encryption
# - Controller writing garbage to all disks
# - Site disaster (fire, flood, theft)
#
# A backup is a separate copy on separate media.
The ten parts covered the three techniques, the five levels, parity calculation, degraded state, rebuild process, and the backup boundary.
Quick Reference
The five levels
| Level | Minimum disks | Usable capacity | Fault tolerance | Write performance |
|---|---|---|---|---|
| RAID 0 | 2 | N ร disk size | 0 disks | Highest (striping) |
| RAID 1 | 2 | 1 ร disk size | 1 disk | Single-disk |
| RAID 5 | 3 | (Nโ1) ร disk size | 1 disk | Moderate (parity) |
| RAID 6 | 4 | (Nโ2) ร disk size | 2 disks | Lower (dual parity) |
| RAID 10 | 4 | (N/2) ร disk size | 1 per mirror pair | High (no parity) |
Techniques by level
| Level | Mirroring | Striping | Parity |
|---|---|---|---|
| RAID 0 | No | Yes | No |
| RAID 1 | Yes | No | No |
| RAID 5 | No | Yes | Single, distributed |
| RAID 6 | No | Yes | Dual, distributed |
| RAID 10 | Yes | Yes | No |
Failure semantics
| Level | Single disk failure | Second disk failure (same array) |
|---|---|---|
| RAID 0 | Array lost | โ |
| RAID 1 (2-way) | Survives | Array lost |
| RAID 5 | Survives (degraded) | Array lost |
| RAID 6 | Survives (degraded) | Survives (degraded) |
| RAID 10 | Survives if not in same mirror pair | Array lost if same pair |
Best Practices
โ Do This:
# Use RAID 1 for boot volumes and small critical data
# Simple, predictable, survives one disk failure # โ
# Use RAID 6 instead of RAID 5 for large disks
# Rebuild window in RAID 5 with multi-TB drives is long # โ
# Use RAID 10 for write-heavy databases
# No parity penalty, high random write performance # โ
# Monitor array health and rebuild progress
# A degraded array is one failure away from data loss # โ
# Maintain a separate backup of any RAID array
# RAID is availability, not durability # โ
โ Don’t Do This:
# Use RAID 0 for any data that cannot be regenerated
# One disk failure destroys everything # โ
# Treat RAID as a backup
# Deletion, corruption, and ransomware affect all disks # โ
# Build a RAID 5 array from large consumer disks
# Unrecoverable read errors during rebuild can kill it # โ
# Ignore a degraded array
# The next failure is the last one # โ
Common Pitfalls
| Pitfall | Why It Happens | Fix |
|---|---|---|
| Array lost after one disk failure | RAID 0 used for critical data | Use a redundant level |
| Second failure during rebuild destroys array | RAID 5 has no redundancy while degraded | Use RAID 6 for large disks |
| Rebuild takes days | Large disk size and heavy I/O load | Monitor progress; avoid heavy load during rebuild |
| Write performance worse than expected | RAID 5/6 parity penalty | Use RAID 10 for write-heavy workloads |
| Capacity less than expected | Parity or mirror overhead | Calculate usable capacity before building |
Real-World Examples
1. RAID 0 for scratch space
Four SSDs in RAID 0 for temporary build cache.
Data is regenerable; speed matters more than redundancy.
2. RAID 1 for boot volume
Two disks mirrored for the OS.
Simple, survives one disk failure, easy to recover.
3. RAID 5 for general file storage
Four disks, 3 TB usable.
Good capacity efficiency, survives one failure.
4. RAID 6 for large archival storage
Eight disks, 6 TB usable.
Survives two failures, protects rebuild window.
5. RAID 10 for database
Six disks, 3 TB usable.
No parity penalty, high random write performance.
6. Parity calculation
D1 XOR D2 XOR D3 = P
0x1A XOR 0x2B XOR 0x3C = 0x0D
7. Degraded array warning
mdadm: /dev/md0 is degraded
One disk has failed. Redundancy is lost.
8. Rebuild in progress
mdadm: resync = 45.2% (1234567/2734567)
Rebuilding /dev/sdd1
9. RAID 10 failure boundary
Disks: sda, sdb (mirror pair 1), sdc, sdd (mirror pair 2)
sda fails: survives
sdc fails: survives
sda and sdb fail: array lost
10. RAID is not backup
RAID array: /dev/md0
Backup: separate disk, separate server, separate media
Visual
The three techniques
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ MIRRORING (RAID 1) โ
โ โ
โ Disk A: [D1][D2][D3][D4] โ
โ Disk B: [D1][D2][D3][D4] โ
โ โ
โ Every block is duplicated. โ
โ Survives one disk failure. โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ STRIPING (RAID 0) โ
โ โ
โ Disk A: [D1][D3][D5][D7] โ
โ Disk B: [D2][D4][D6][D8] โ
โ โ
โ Data is split across disks. โ
โ No redundancy. Any failure loses everything. โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ DISTRIBUTED PARITY (RAID 5) โ
โ โ
โ Disk A: [D1][D2][P3][D4] โ
โ Disk B: [D5][P6][D7][D8] โ
โ Disk C: [P1][D9][D10][D11] โ
โ โ
โ Parity rotates across disks. โ
โ Survives one disk failure. โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Capacity comparison (four 1 TB disks)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ FOUR 1 TB DISKS โ
โ โ
โ RAID 0: [โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ] 4 TB โ
โ RAID 1: [โโโโโโโโโโโโโโโโ] 2 TB (two-way mirror) โ
โ RAID 5: [โโโโโโโโโโโโโโโโโโโโโโโโโโ] 3 TB (N-1) โ
โ RAID 6: [โโโโโโโโโโโโโโโโโโโโ] 2 TB (N-2) โ
โ RAID 10: [โโโโโโโโโโโโโโโโ] 2 TB (half) โ
โ โ
โ More redundancy = less usable capacity. โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Failure tolerance
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ DISK FAILURE SCENARIOS โ
โ โ
โ RAID 0: โ
โ [โ][โ][โ][โ] โโโบ ARRAY LOST โ
โ โ
โ RAID 1: โ
โ [โ][โ] โโโบ array continues โ
โ [โ][โ] โโโบ ARRAY LOST โ
โ โ
โ RAID 5: โ
โ [โ][โ][โ][โ] โโโบ degraded, continues โ
โ [โ][โ][โ][โ] โโโบ ARRAY LOST โ
โ โ
โ RAID 6: โ
โ [โ][โ][โ][โ][โ][โ] โโโบ degraded, continues โ
โ [โ][โ][โ][โ][โ][โ] โโโบ ARRAY LOST โ
โ โ
โ RAID 10: โ
โ [โ][โ] (pair 1) [โ][โ] (pair 2) โโโบ continues โ
โ [โ][โ] (pair 1) [โ][โ] (pair 2) โโโบ ARRAY LOST โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
RAID is not backup
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ WHAT RAID PROTECTS AND WHAT IT DOES NOT โ
โ โ
โ PROTECTS: โ
โ โ Physical disk failure โ
โ โ
โ DOES NOT PROTECT: โ
โ โ Accidental deletion (rm -rf) โ
โ โ Filesystem corruption โ
โ โ Ransomware encryption โ
โ โ Controller writing garbage to all disks โ
โ โ Fire, flood, theft โ
โ โ Human error โ
โ โ
โ A backup is a separate copy on separate media. โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Summary
| Item | Value |
|---|---|
| RAID 0 | Striping, no redundancy, N disks usable |
| RAID 1 | Mirroring, 1 disk usable per mirror, survives 1 failure |
| RAID 5 | Striping + distributed parity, Nโ1 usable, survives 1 failure |
| RAID 6 | Striping + dual parity, Nโ2 usable, survives 2 failures |
| RAID 10 | Mirrored stripes, N/2 usable, survives 1 per mirror pair |
| Core techniques | Mirroring, striping, parity |
| Parity calculation | XOR across data blocks |
| Write penalty | RAID 5: 4 I/O per small write; RAID 6: 6 I/O |
| Backup relationship | RAID is not backup |
Key takeaways:
- RAID levels are combinations of mirroring, striping, and parity. Every level can be described in terms of which techniques it uses and which it omits.
- Usable capacity is reduced by redundancy. RAID 1 and RAID 10 lose half the raw capacity to mirroring. RAID 5 loses one disk’s worth to parity. RAID 6 loses two.
- Fault tolerance is not the same as backup. RAID survives disk failure. It does not survive deletion, corruption, or a controller that writes garbage to every member simultaneously.
- RAID 5 has a write penalty and a rebuild risk. Small writes require read-modify-write. Rebuilds with large disks take long enough that a second failure is a real risk, which is why RAID 6 exists.
- RAID 10 favors performance over capacity. It provides the read performance of striping and the fault tolerance of mirroring, at the cost of half the raw capacity.
- RAID 0 has no redundancy and should be used only for regenerable data. A single disk failure destroys the entire array.
Remember: RAID is a storage availability technique, not a data durability technique. It keeps a system running when a disk fails. It does not keep data recoverable when a human deletes it, when ransomware encrypts it, or when a controller writes corruption across every member. The five levels covered hereโ0, 1, 5, 6, and 10โcover the vast majority of production deployments. The next chapter covers how to build and manage them with mdadm, the Linux software RAID manager.
Stop using slow, ad-bloated tool sites! ๐คฎ
๐ Search “KandZ Tools” on Google to use many professional utilities for free.
KandZ.me is the ultimate minimalist hub for:
โ
Finance (Mortgage, Interest, Inflation)
โ
Tech (Base64, JSON, Dev Suite, IP)
โ
Health (BMI, BMR, TDEE)
โ
Productivity (Timer, Workspace, QR)
โก๏ธ Fast & Private
๐ No data leaves your device
๐ 100% Free
๐ Use it now: https://tools.kandz.me
๐ Bookmark itโyouโll need it later!