| |

LFCS 93 🐧 RAID — Concepts

ā±ļø Estimated read: 11 min | |

Redundant Array of Independent Disks—RAID—is not a backup strategy. It is a method of combining multiple physical drives into a single logical unit to achieve one of three goals: increased performance, increased fault tolerance, or both. The LFCS exam expects you to understand the trade-offs between the common RAID levels and to recognize which level fits a given scenario. The concepts are stable across hardware and software implementations, but the exam focuses on Linux software RAID managed by mdadm, where the kernel handles the parity calculations and disk management rather than a dedicated controller card .

Key point: RAID trades capacity for redundancy or speed. RAID 1 and RAID 10 sacrifice half of the raw capacity for fault tolerance. RAID 5 sacrifices the capacity of one drive for parity. RAID 0 sacrifices fault tolerance entirely for speed.


Why RAID exists

The performance problem. A single spinning disk has a physical limit on how fast it can read and write. By spreading data across multiple disks—a technique called striping—RAID can read and write in parallel, increasing throughput. This is the foundation of RAID 0, which offers no redundancy but significant speed gains .

The failure problem. Disks fail. A RAID 1 array mirrors data across two disks, so if one fails, the other contains an exact copy. The array continues to operate, and the failed disk can be replaced and rebuilt without downtime. This is the simplest form of redundancy .

The capacity problem. Mirroring is expensive—it halves usable capacity. RAID 5 offers a middle ground: it stripes data across three or more disks and stores parity information distributed across all drives. If any single disk fails, the parity can reconstruct the lost data. The cost is one disk’s worth of capacity, regardless of array size .

The double-failure problem. RAID 5 protects against one disk failure. If a second disk fails during the rebuild process, the array is lost. RAID 6 extends the parity scheme to two independent parity blocks, allowing the array to survive two simultaneous disk failures. The cost is two disks’ worth of capacity and slower write performance due to the additional parity calculation .

The rebuild problem. Rebuilding a failed disk in RAID 5 or 6 places heavy random I/O load on all remaining disks. For large drives (2 TB or more), the rebuild time can be hours or days, and the stress increases the likelihood of a second failure. RAID 10, by contrast, rebuilds by copying from a single mirror partner, with minimal impact on the rest of the array .

The trade-off. RAID 0 maximizes speed and capacity but has zero fault tolerance. RAID 1 maximizes simplicity and read performance but halves capacity. RAID 5 balances capacity and redundancy but has slow rebuilds and write penalties. RAID 6 survives double failures but is even slower on writes. RAID 10 offers the best performance and fastest rebuilds but is the most expensive in terms of raw capacity .


a. RAID 0, 1, and 10: striping and mirroring

RAID 0 (striping) splits data into blocks and writes them across all disks in the array. A file is not stored on one disk; it is scattered across every disk. This allows parallel reads and writes, multiplying throughput. The minimum is two disks. There is no redundancy: if any disk fails, the entire array is lost, and data recovery is impossible without external backups .

RAID 1 (mirroring) writes identical copies of data to two disks. Every write goes to both drives. Reads can come from either drive, potentially doubling read throughput if the controller or software can parallelize them. The usable capacity is the size of one disk. If one disk fails, the other continues to serve data. RAID 1 is the simplest redundant configuration and requires exactly two disks for a basic mirror .

RAID 10 (mirroring plus striping) combines the two. It creates multiple RAID 1 mirrors and then stripes data across those mirrors. For example, with four disks, two pairs are mirrored, and data is striped across the two mirrors. This provides the fault tolerance of RAID 1 with the performance of RAID 0. The minimum is four disks. RAID 10 can survive multiple disk failures as long as no single mirror pair loses both disks. Rebuilds are fast because data is copied from the surviving mirror partner, not reconstructed from parity .


b. RAID 5 and 6: distributed parity

RAID 5 uses block-level striping with parity distributed across all disks. For each stripe of data, parity is calculated and written to one disk. On the next stripe, the parity moves to a different disk. This avoids the write bottleneck of dedicating a single parity disk. If one disk fails, the missing data is reconstructed by reading the surviving data and parity blocks and recalculating the lost value. The minimum is three disks, and the usable capacity is (N-1) disks .

The write penalty is the critical concept. Updating a single block requires reading the old data, reading the old parity, calculating the new parity, and writing both the new data and new parity. This is known as the read-modify-write cycle. For random small writes, RAID 5 is significantly slower than RAID 1 or RAID 10 because every write touches multiple disks .

RAID 6 extends RAID 5 with a second independent parity block. This allows the array to survive two simultaneous disk failures. The minimum is four disks, and the usable capacity is (N-2) disks. The write penalty is even higher because two parity blocks must be calculated and written. RAID 6 is appropriate when large drives make rebuild times long and the risk of a second failure during rebuild is unacceptable .


c. Choosing a RAID level

The choice depends on the workload and the acceptable risk. For a database with heavy random writes, RAID 10 is the standard recommendation because parity calculations make RAID 5 and 6 too slow . For bulk storage where capacity matters more than write speed, RAID 5 or 6 offers better efficiency. For a simple boot mirror, RAID 1 is sufficient.

The capacity math is straightforward. With four 1 TB disks: RAID 0 gives 4 TB, RAID 1 gives 1 TB (if all four are mirrored together) or 2 TB (if two mirrors), RAID 5 gives 3 TB, RAID 6 gives 2 TB, and RAID 10 gives 2 TB. The fault tolerance also scales: RAID 0 survives zero failures, RAID 5 survives one, RAID 6 survives two, and RAID 10 survives one per mirror pair.


Complete Example Session

# ============================================
# PART 1: UNDERSTANDING THE TRADE-OFF
# ============================================

RAID 0: speed, no redundancy.
RAID 1: redundancy, half capacity.
RAID 5: redundancy, one-disk overhead, slow writes.
RAID 6: double redundancy, two-disk overhead, slower writes.
RAID 10: redundancy and speed, half capacity, fast rebuilds.
# ============================================
# PART 2: RAID 0 CAPACITY AND FAULT TOLERANCE
# ============================================

# 4 disks Ɨ 1 TB
# Usable: 4 TB
# Fault tolerance: 0 disks
# Performance: best read/write
# ============================================
# PART 3: RAID 1 CAPACITY AND FAULT TOLERANCE
# ============================================

# 2 disks Ɨ 1 TB
# Usable: 1 TB
# Fault tolerance: 1 disk
# Read performance: improved (parallel reads)
# Write performance: slightly reduced (both disks written)
# ============================================
# PART 4: RAID 5 CAPACITY AND FAULT TOLERANCE
# ============================================

# 4 disks Ɨ 1 TB
# Usable: 3 TB
# Fault tolerance: 1 disk
# Write penalty: read-modify-write for every small update
# ============================================
# PART 5: RAID 6 CAPACITY AND FAULT TOLERANCE
# ============================================

# 4 disks Ɨ 1 TB
# Usable: 2 TB
# Fault tolerance: 2 disks
# Write penalty: double parity calculation
# ============================================
# PART 6: RAID 10 CAPACITY AND FAULT TOLERANCE
# ============================================

# 4 disks Ɨ 1 TB
# Usable: 2 TB
# Fault tolerance: 1 disk per mirror (up to 2 if different mirrors fail)
# Rebuild: fast, linear copy from mirror partner
# ============================================
# PART 7: THE REBUILD RISK
# ============================================

# RAID 5 rebuild on large drives:
# - Random I/O on all remaining disks
# - Hours or days of degraded performance
# - Elevated risk of second failure
# RAID 10 rebuild:
# - Linear read from mirror, linear write to new disk
# - Minimal impact on array performance
# ============================================
# PART 8: SOFTWARE VS HARDWARE RAID
# ============================================

# Software RAID (mdadm):
# - Managed by Linux kernel
# - No proprietary controller
# - Easy to move between systems
# Hardware RAID:
# - Dedicated controller card
# - OS sees a single disk
# - Requires driver, less portable
# ============================================
# PART 9: RAID IS NOT BACKUP
# ============================================

# RAID protects against disk failure.
# It does not protect against:
# - Accidental deletion
# - Filesystem corruption
# - Malware
# - Controller failure
# - Theft or disaster

The nine parts trace the conceptual landscape: the trade-off statement, capacity and fault tolerance for each level, the rebuild risk for parity RAID, the software vs hardware distinction, and the backup caveat.


Quick Reference

RAID Levels Compared

LevelMin DisksFault ToleranceUsable CapacityWrite Performance
02None100%Best
121 disk50%Slightly reduced
531 disk(N-1)/NPoor (random)
642 disks(N-2)/NWorst (random)
1041 per mirror50%Good

mdadm Concepts (for the next chapter)

TermMeaning
/dev/md0RAID array device
/proc/mdstatKernel RAID status
mdadm --detailArray details
SpareReplacement disk

Best Practices

āœ… Do This:

RAID 10 for databases
<!-- Random write performance is critical -->     # āœ…
RAID 6 for large drives
<!-- Survives second failure during rebuild -->   # āœ…
RAID 1 for boot devices
<!-- Simple, reliable mirror -->                  # āœ…

āŒ Don’t Do This:

RAID 0 for critical data
<!-- Any disk failure loses everything -->        # āŒ
RAID 5 with 4 TB drives
<!-- Rebuild takes days; second failure likely --> # āŒ
RAID as backup
<!-- Does not protect against deletion or malware --> # āŒ

Common Pitfalls

PitfallWhy It HappensFix
RAID 5 write performanceRead-modify-write cycleUse RAID 10 for random writes
Lost data after double failureRAID 5 only survives oneUse RAID 6 or RAID 10
Rebuild takes too longLarge drive, parity reconstructionPlan for redundancy at 2+ disks
RAID treated as backupConfusion about purposeImplement separate backup strategy

Real-World Examples

1. RAID 0 Scratch Space

# Temporary data, speed matters, loss acceptable
mdadm --create /dev/md0 --level=0 --raid-devices=2 /dev/sdb /dev/sdc

2. RAID 1 Boot Mirror

# Two disks, identical copies
mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb /dev/sdc

3. RAID 5 Bulk Storage

# Three disks, one parity
mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/sdb /dev/sdc /dev/sdd

4. RAID 6 Large Array

# Four disks, double parity
mdadm --create /dev/md0 --level=6 --raid-devices=4 /dev/sdb /dev/sdc /dev/sdd /dev/sde

5. RAID 10 Database

# Four disks, mirrored stripes
mdadm --create /dev/md0 --level=10 --raid-devices=4 /dev/sdb /dev/sdc /dev/sdd /dev/sde

6. Check Status

cat /proc/mdstat

7. Detail View

mdadm --detail /dev/md0

8. Mark Failed

mdadm --fail /dev/md0 /dev/sdb

9. Remove Failed

mdadm --remove /dev/md0 /dev/sdb

10. Add Replacement

mdadm --add /dev/md0 /dev/sdf

Visual

RAID 0: Striping

ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”  ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│  Disk 1      │  │  Disk 2      │
│  Block A     │  │  Block B     │
│  Block C     │  │  Block D     │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜  ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
       │                 │
       ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
                ā–¼
         ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
         │  /dev/md0    │
         │  A B C D     │
         ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

Data is split across disks. No redundancy.

RAID 1: Mirroring

ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”  ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│  Disk 1      │  │  Disk 2      │
│  Block A     │  │  Block A     │
│  Block B     │  │  Block B     │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜  ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
       │                 │
       ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
                ā–¼
         ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
         │  /dev/md0    │
         │  A B         │
         ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

Identical copies. One disk can fail.

RAID 5: Striping with Distributed Parity

ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│ Disk 1   │ │ Disk 2   │ │ Disk 3   │
│ Block A  │ │ Block B  │ │ Parity   │
│ Parity   │ │ Block C  │ │ Block D  │
│ Block E  │ │ Parity   │ │ Block F  │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

Parity rotates across disks. One disk can fail.

RAID 6: Double Parity

ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│ Disk 1   │ │ Disk 2   │ │ Disk 3   │ │ Disk 4   │
│ Block A  │ │ Block B  │ │ P1       │ │ P2       │
│ P2       │ │ Block C  │ │ Block D  │ │ P1       │
│ Block E  │ │ P1       │ │ P2       │ │ Block F  │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

Two parity blocks. Two disks can fail.

RAID 10: Mirrored Stripes

ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│ Disk 1   │ │ Disk 2   │ │ Disk 3   │ │ Disk 4   │
│ Block A  │ │ Block A  │ │ Block B  │ │ Block B  │
│ Block C  │ │ Block C  │ │ Block D  │ │ Block D  │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
     │            │            │            │
     ā””ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”˜            ā””ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
           ā–¼                         ā–¼
      ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”               ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
      │ Mirror  │               │ Mirror  │
      │ A C     │               │ B D     │
      ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜               ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
           │                         │
           ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
                       ā–¼
                ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
                │  /dev/md0    │
                │  A B C D     │
                ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

Mirror pairs, striped together. Fast rebuilds.


Summary

ItemValue
RAID 0Striping, no redundancy, max speed
RAID 1Mirroring, 1 disk tolerance, 50% capacity
RAID 5Distributed parity, 1 disk tolerance, (N-1) capacity
RAID 6Double parity, 2 disk tolerance, (N-2) capacity
RAID 10Mirrored stripes, fast rebuilds, 50% capacity
Minimum disksR0:2, R1:2, R5:3, R6:4, R10:4
Write penaltyR5/R6 suffer on random writes
Rebuild riskR5/R6 high for large drives

Key takeaways:

  • RAID is about redundancy, not backup. It protects against disk failure, not against deletion, corruption, or disaster .
  • RAID 0 offers speed at the cost of all fault tolerance. A single disk failure destroys the array.
  • RAID 1 is simple and reliable. Mirroring halves capacity but provides the easiest recovery path.
  • RAID 5 balances capacity and redundancy but has a write penalty. Every small write requires a read-modify-write cycle across multiple disks .
  • RAID 6 survives double failures but is slower on writes. The second parity block doubles the parity calculation overhead .
  • RAID 10 offers the best performance and fastest rebuilds. It is the standard choice for databases and write-heavy workloads .
  • Rebuild risk is real. For large drives, RAID 5 and 6 rebuilds can take days and stress the remaining disks, increasing the chance of a second failure .

Remember: RAID combines disks for speed or safety. RAID 0 is fast but fragile. RAID 1 is safe but wasteful. RAID 5 is a compromise that works for read-heavy data but struggles with random writes. RAID 6 protects against double failures at a performance cost. RAID 10 is the performance leader with fast recovery. Choose based on the workload, and never treat RAID as a substitute for backups.

Was this helpful?


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!