21 - RAID Systems
370 words
2 min read
Visual companion
Python
Type and operator map
Python Week 1: the first filter for runtime behavior
View
Revision summary
What this note is really saying
Short form
# 21 - RAID Systems ## 🎯 Learning Objectives After reading this topic, you will be able to: - Explain RAID levels 0-6 and their trade-offs - Compute parity using XOR - Compare RAID levels by cost, performance, and reliability ## 📖 Core Content ### 21.1 RAID Overview **RAID** (Redundant Array of Independent Disks)...

21 - RAID Systems
🎯 Learning Objectives
After reading this topic, you will be able to:
- Explain RAID levels 0-6 and their trade-offs
- Compute parity using XOR
- Compare RAID levels by cost, performance, and reliability
📖 Core Content
21.1 RAID Overview
RAID (Redundant Array of Independent Disks) combines multiple disks into one logical unit for:
- Performance: Striping (parallel I/O)
- Reliability: Redundancy (mirroring or parity)
21.2 RAID Levels
(Diagram)
| Level | Description | Min Disks | Space Efficiency | Read | Write | Fault Tolerance |
|---|---|---|---|---|---|---|
| 0 | Striping only | 2 | 100% | Excellent | Excellent | None |
| 1 | Mirroring | 2 | 50% | Good | Good | 1 disk |
| 2 | Bit-level + Hamming ECC | 3 | ~70% | Good | Poor | 1 disk |
| 3 | Byte-level + dedicated parity | 3 | ~75% | Good | Poor | 1 disk |
| 4 | Block-level + dedicated parity | 3 | ~75% | Good | Poor (bottleneck) | 1 disk |
| 5 | Block-level + distributed parity | 3 | ~75% | Good | Good | 1 disk |
| 6 | Block-level + dual distributed parity | 4 | ~66% | Good | Poor | 2 disks |
21.3 Parity Computation (XOR)
Parity = XOR of all data bits:
Recovery: D1=P⊕D2⊕D3⊕⋯⊕Dn
Worked Example
Data blocks: 0100, 0101, 0100, 0001 Parity = 0100 ⊕ 0101 ⊕ 0100 ⊕ 0001
- Bit 1: 0⊕0⊕0⊕0 = 0
- Bit 2: 1⊕1⊕1⊕0 = 1
- Bit 3: 0⊕0⊕0⊕0 = 0
- Bit 4: 0⊕1⊕0⊕1 = 0 Parity = 0100 If disk 2 fails: Recover = parity ⊕ remaining data = 0100 ⊕ 0100 ⊕ 0100 ⊕ 0001 = 0101
📝 Practice Questions
Q1. Compare RAID 0, RAID 1, and RAID 5.
AnswerRAID 0: Striping only — best performance, no fault tolerance. RAID 1: Mirroring — 50% space, can lose one disk. RAID 5: Distributed parity — good balance of performance, space (~75%), and single-disk fault tolerance.
Q2. What is the XOR parity for data blocks 1010, 1100, 0110?
Answer1010 ⊕ 1100 = 0110 0110 ⊕ 0110 = 0000Parity = 0000
Q3. Which RAID level can survive two simultaneous disk failures?
AnswerRAID 6 — it uses dual distributed parity. Requires at least 4 disks and can tolerate any 2 disk failures.
🔗 Cross-References
- Previous Topic: 20 - Storage Systems
- Next Topic: 22 - File Organization
- Related: BSCS4022 (OS) — Storage, fault tolerance
- Textbook: Chapter 10 (Storage and File Structure) Join Discord Previous20 - Storage SystemsNext22 - File Organization