The following subsections describe the characteristics of each Linux RAID level.
Characteristics:
Two or more disks are combined into one virtual MD device.
The disks are appended to each other, so writing linearly to the MD device fills up disk 0 first, then 1, and so on.
The disks do not have to be of the same size.
Advantages:
Can be used to build a very large MD device.
No parity calculation overhead is involved.
Disadvantages:
Not a "true" RAID because it is not fault-tolerant.
One disk crash will probably result in loss of most or all data.
Should never be used in mission-critical environments.
Characteristics:
Two or more disks are combined into one virtual MD device.
Also called "stripe" mode.
Stripe size determines how data is written to disk. For example, writing 16 K bytes to a RAID-0 array of three disks with stripe size of 4 K bytes is broken down into:
4 K bytes of disk 0
4 K bytes to disk 1
4 K bytes to disk 2
4 K bytes to disk 0
The disks should be the same size but they do not have to be the same size.
Advantages:
Can be used to build a very large MD device.
I/O performance is greatly improved by spreading I/O load across many controllers and disks.
No parity calculation overhead is involved.
Disadvantages:
Not a "true" RAID because it is not fault-tolerant.
One disk crash is liable to result in the loss of the whole array.
Should never be used in mission-critical environments.
Characteristics:
Consists of two or more disks to provide a two-way or N-way mirrored MD device.
Writes result in writing identical data to all active disks in the array.
Reads can be performed on any active disk of the array.
Data is intact as long as there is at least one "good" active disk in the array.
The disks should be the same size. If they are different sizes, the size of the RAID-1 array is determined by the smallest disk.
Advantages:
100% redundancy of data.
Under certain circumstances, a RAID-1 array can sustain multiple simultaneous disk failures.
Kernel MD code provides good read-balancing algorithm.
No parity calculation overhead is involved.
Disadvantages:
Write performance is often worse than on a single device.
Characteristics:
Consists of three or more striped disks.
Parity information is kept on one disk. When a disk fails, parity information is used to reconstruct all data.
The disks should be the same size. If they are different sizes, the size of the RAID-4 array is determined by the smallest disk.
Advantages:
Like RAID-0, I/O performance is greatly improved by spreading the I/O load across many controllers and disks.
Disadvantages:
The parity disk becomes a bottleneck. Therefore, a slow parity disk degrades I/O performance of the whole array.
Cannot sustain a two-disk simultaneous failure.
Characteristics:
Consists of three or more striped disks.
Parity information is distributed evenly among the participating disks.
The disks should be the same size. If they are different sizes, the size of the RAID-5 array is determined by the smallest disk.
Advantages:
Like RAID-0, I/O performance is greatly improved by spreading the I/O load across many controllers and disks.
Read performance is similar to RAID-0.
Disadvantages:
Writes can be expensive when required read-in blocks for parity calculations are not in the cache.
Cannot sustain a two-disk simultaneous failure.