Neural Sync Active
21 - RAID Systems
Registry Synced
21 - RAID Systems
370 words
2 min read
Reading compass
Now ยท ๐ฏ Learning Objectives
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