RAID Levels
Lecture 9 Β· schemes that provide redundancy at lower cost by using disk striping combined with parity bits. Different RAID organizations (levels) have differing cost, performance and reliability characteristics.
The seven levels
| Level | Elaborated name | Note |
|---|---|---|
| RAID 0 | Block striping; non-redundant | Used in high-performance applications where data loss is not critical. |
| RAID 1 | Mirrored disks with block striping | Offers best write performance. Popular for storing log files in a database system. |
| RAID 2 | Memory-Style Error-Correcting-Codes (ECC) with bit striping | Provides error correction, not just simple redundancy. |
| RAID 3 | Bit-Interleaved Parity | One parity bit; recover by XOR of the other disks. |
| RAID 4 | Block-Interleaved Parity | Fault tolerance + better small-read performance than RAID 3. |
| RAID 5 | Block-Interleaved Distributed Parity | No dedicated parity-disk bottleneck; general-purpose choice. |
| RAID 6 | P + Q Redundancy scheme | Survives two simultaneous disk failures. |
This mapping table is a guaranteed exam question (Final Spring 2026, Q6 β 3 marks). Learn the seven elaborated names by heart.
RAID 0 & RAID 1
RAID Level 0 β Block striping; non-redundant. Used in high-performance applications where data loss is not critical.
No redundancy at all: one disk fails β everything is lost.
No redundancy at all: one disk fails β everything is lost.
RAID Level 1 β Mirrored disks with block striping. Offers the best write performance. Popular for applications such as storing log files in a database system.
RAID 2 β Memory-Style ECC with bit striping
RAID 2 is an organization in which data is striped at the bit level across multiple disks, and extra disks store error-correcting code (ECC) bits, usually a Hamming code. It is called memory-style ECC because it works like old main memory systems, where extra check bits were stored to detect and correct errors.
I. A data word is broken into individual bits
II. These bits are written across several data disks
III. Additional ECC disks store check bits
IV. On a failure or a mis-read, the ECC bits detect AND correct the error
Architecture example: 4 data disks D1βD4 and 3 ECC disks C1βC3. A single 4-bit data unit is striped bit by bit across the 4 data disks, and 3 Hamming-code check bits are stored on the ECC disks.
RAID 3 β Bit-Interleaved Parity
A single parity bit is enough for error detection and correction, since we know which disk has failed.
- When writing data, the corresponding parity bits must also be computed and written to a parity-bit disk.
- To recover data on a damaged disk, compute the XOR of the bits from all other disks (including the parity disk).
4-bit data striped over 4 disks: D1=1, D2=0, D3=1, D4=1, parity P=1. If D3 fails:
D1 β D2 β D4 β P = D31 β 0 β 1 β 1 = 1 β Advantages of RAID 3
- High read/write speed for large sequential data
- Can recover from one disk failure
- Storage overhead lower than mirroring (only one parity disk)
- Simple parity-based recovery
Disadvantages of RAID 3
- Parity disk can become a bottleneck
- All disks must participate in every operation (a single datum is striped over all)
- Not efficient for many small independent requests in parallel
- Rarely used in modern systems
RAID 4 β Block-Interleaved Parity
- Data is divided into blocks (a block can hold several bits/bytes).
- Different blocks are stored on different disks (one disk stores one block of data).
- One extra disk stores parity β the parity block is the XOR of all the data blocks.
- If one disk fails, the lost data block can be reconstructed from the remaining data blocks and the parity block.
RAID 4 provides fault tolerance and better small-read performance than RAID 3 β but the parity disk can become a bottleneck.
The lectureβs worked example β data 4627
| D1 | D2 | D3 | D4 | P | |
|---|---|---|---|---|---|
| Decimal | 4 | 6 | 2 | 7 | 7 |
| 3-bit binary | 100 | 110 | 010 | 111 | 111 |
P = Block-1 β Block-2 β Block-3 β Block-4
Β Β = 4 β 6 β 2 β 7 = 100 β 110 β 010 β 111
Β Β = 010 β 010 β 111
Β Β = 000 β 111
Β Β = 111 = 7
Β Β = 4 β 6 β 2 β 7 = 100 β 110 β 010 β 111
Β Β = 010 β 010 β 111
Β Β = 000 β 111
Β Β = 111 = 7
Disk D3 fails. To recover its data block:
D1 β D2 β D4 β P = D34 β 6 β 7 β 7 = 100 β 110 β 111 β 111 = 010 = 2 β Live parity & recovery calculator
| Bit position | D1 | D2 | D3 | D4 | # of 1s | P = XOR |
|---|---|---|---|---|---|---|
| Bit 2 (MSB) | 1 | 1 | 0 | 1 | 3 (odd) | 1 |
| Bit 1 | 0 | 1 | 1 | 1 | 3 (odd) | 1 |
| Bit 0 (LSB) | 0 | 0 | 0 | 1 | 1 (odd) | 1 |
Parity block P = 111β = 7
Recovering D3 = P β (all surviving disks) = 010β = 2 β β matches the original block
Recovering D3 = P β (all surviving disks) = 010β = 2 β β matches the original block
Try the final-exam data 9, 6, 8 with 4 bits and D1 failed.
RAID 5 β Block-Interleaved Distributed Parity
Data is divided into blocks, and the parity block is also stored at the block level β but it is distributed among all disks. It is called distributed parity because parity is not kept on one dedicated disk; instead the parity blocks are rotated across all disks.
| D1 | D2 | D3 | D4 | Stripe | Parity |
|---|---|---|---|---|---|
| P0 | 5 | 3 | 6 | Data1 β 536 | P0 = 5 β 3 β 6 = 0 |
| 7 | 9 | P1 | 3 | Data2 β 793 | P1 = 7 β 9 β 3 = 13 |
| 4 | 2 | 8 | P2 | Data3 β 428 | P2 = 4 β 2 β 8 = 14 |
Disk D2 fails β recover each stripe:
Data1 β D1(P0) β D3 β D4 = 0 β 3 β 6 = 5 β
Data2 β D1 β D3(P1) β D4 = 7 β 13 β 3 = 9 β
Data3 β D1 β D3 β D4(P2) = 4 β 8 β 14 = 2 β
Data2 β D1 β D3(P1) β D4 = 7 β 13 β 3 = 9 β
Data3 β D1 β D3 β D4(P2) = 4 β 8 β 14 = 2 β
Advantages of RAID 5
- Good balance of performance, reliability and storage efficiency
- No dedicated parity-disk bottleneck
- Suitable for general-purpose file and database servers
- Can recover from one disk failure
Disadvantages of RAID 5
- Write operations are more complex because parity must be updated
- Slower writes than RAID 0
- Cannot survive two simultaneous disk failures
- Rebuild after failure can be slow
RAID 6 β Block-Interleaved Dual Distributed Parity
RAID 6 is similar to RAID 5, but it stores two independent parity blocks for each stripe instead of one. Each stripe contains two parity blocks, distributed across the disks. If one or even two disks fail, the data can still be reconstructed β so RAID 6 gives stronger protection than RAID 5.
| D1 | D2 | D3 | D4 | D5 | Stripe |
|---|---|---|---|---|---|
| P1 | 5 | 3 | 6 | Q1 | Data1 β 536 |
| 7 | Q2 | P2 | 9 | 3 | Data2 β 793 |
| 4 | P3 | 2 | 8 | Q3 | Data3 β 428 |
How dual parity works
- One parity block is usually based on XOR β if one disk fails it works the same as RAID 5.
- The second parity block is generated by another independent coding method β it is only used if two disks fail simultaneously.
- Because there are two independent parity values, RAID 6 can recover data even if two disks fail at the same time.
Advantages β survives two simultaneous disk failures Β· higher reliability than RAID 5 Β· parity is distributed, so no single parity bottleneck Β· suitable for large-capacity storage systems.
Disadvantages β more storage overhead than RAID 5 Β· writes are slower because two parity blocks must be updated Β· controller logic is more complex Β· rebuilds can still take a long time.
Choice of RAID level
Factors:
- Monetary cost
- Performance β number of I/O operations per second, and bandwidth during normal operation
- Performance during failure
- Performance during rebuild of a failed disk, including the time taken to rebuild it
| Level | Verdict |
|---|---|
| RAID 0 | Used only when data safety is not important β e.g. data can be recovered quickly from other sources. |
| Levels 2 & 4 | Never used, since they are subsumed by 3 and 5. |
| Level 3 | Not used anymore, since bit-striping forces single-block reads to access all disks, wasting disk-arm movement β which block striping (level 5) avoids. |
| Level 6 | Rarely used, since levels 1 and 5 offer adequate safety for most applications. |
Level 1 vs Level 5 β the decisive comparison.
- Level 1 provides much better write performance: level 5 requires at least 2 block reads and 2 block writes to write a single block, whereas level 1 only requires 2 block writes. So level 1 is preferred for high-update environments such as log disks.
- Level 1 has a higher storage cost β but disk capacities grow ~50 %/year while access times have barely improved (Γ3 in 10 years), and I/O requirements have grown greatly. Once you have bought enough disks to satisfy the required I/O rate, they often have spare storage capacity, so there is often no extra monetary cost for Level 1.
- Level 5 is preferred for applications with a low update rate and large amounts of data; Level 1 is preferred for all other applications.
Applied in the project: Task 3 β RAID 4 recovery β Β· Exam practice: Final Spring 2026 Q6βQ8 β