Kahibaro
Discord Login Register

RAID levels

Understanding RAID Levels

RAID (Redundant Array of Independent Disks) combines multiple physical disks into logical units to improve performance, reliability, or both. In this chapter we focus specifically on how the common RAID levels work, their trade‑offs, and how to choose between them. Implementation tools (like mdadm, hardware RAID controllers, and filesystems with built‑in RAID such as Btrfs/ZFS) are discussed in other chapters; here we stick to concepts that apply across implementations.

We will assume all disks in an array are the same size $S$. When we say “usable capacity” we mean the space available for data, not counting redundancy.

RAID 0 — Striping (Performance, No Redundancy)

RAID 0 splits data into blocks and distributes (stripes) them across all disks.

Characteristics:

Key concept:

RAID 0 trades all redundancy for maximum performance and capacity. It is not a “safe” RAID level; backups become even more important.

RAID 1 — Mirroring (Redundancy, Simpler)

RAID 1 duplicates data across two or more disks. Each disk holds a full copy (mirror) of the data.

Characteristics:

Capacity formula:

RAID 5 — Striping with Distributed Parity (Balanced)

RAID 5 stripes data across disks, like RAID 0, but also stores parity information distributed across all disks. This parity allows reconstruction of data if a single disk fails.

Parity concept (high level):

Parity is calculated over blocks on each stripe. For a stripe with data blocks $D_1, D_2, \dots, D_{N-1}$, parity $P$ is computed with XOR:

$$
P = D_1 \oplus D_2 \oplus \dots \oplus D_{N-1}
$$

If one block is lost (e.g., disk failure), it can be reconstructed:

$$
D_1 = P \oplus D_2 \oplus \dots \oplus D_{N-1}
$$

This is why RAID 5 can tolerate 1 disk failure.

Characteristics:

Limitations and modern concerns:

Because of this, RAID 5 is considered less suitable for very large arrays and high‑capacity disks.

RAID 6 — Striping with Double Distributed Parity

RAID 6 extends RAID 5 by storing two independent parity blocks per stripe, allowing survival of two simultaneous disk failures.

Characteristics:

Trade‑off:

You trade more usable capacity (losing 2 disks worth) and more write overhead for improved fault tolerance — often a good trade‑off for modern storage sizes.

RAID 10 — Mirrored Stripes (RAID 1+0)

RAID 10 (often written RAID 1+0) combines mirroring and striping:

  1. Disks are grouped into mirrored pairs (RAID 1).
  2. These mirrors are then striped (RAID 0) for performance.

Failure patterns:

Characteristics:

RAID 10 vs RAID 5/6:

Less Common / Special RAID Levels

These are less common or more vendor‑specific, but worth knowing conceptually.

RAID 2, 3, 4 (Rarely Used)

In practice, you will mostly encounter RAID 0, 1, 5, 6, and 10.

Nested RAID Levels (RAID 0+1, 50, 60)

Nested (or hybrid) RAID levels layer one RAID type on top of another:

These are more common in large storage appliances or hardware RAID setups than in simple Linux servers, but the concepts mirror the basic levels already discussed.

Comparing RAID Levels

Capacity Efficiency

With $N$ disks of size $S$:

You can think of redundancy overhead for:

Fault Tolerance Summary

Performance Characteristics (High‑Level)

Very simplified guide (actual numbers depend on implementation, workload, and hardware):

Choosing a RAID Level

Choosing the right level is a balance of performance, capacity, and fault tolerance:

Remember:

RAID in Software vs Filesystem RAID

Linux can provide RAID using:

The fundamental RAID levels and trade‑offs described here apply conceptually to all of these, even if the implementation details differ. Subsequent chapters on Linux storage management will cover how to configure specific RAID types in practice.

Views: 22

Comments

Please login to add a comment.

Don't have an account? Register now!