RAID
GitBook docs section concerning RAID types.
In computing, RAID, which stands for "Redundant Array of Independent Disks", (originally "Redundant Array of Inexpensive Disks"), is a technique for installing several hard disks in a computer (or connected to it) in such a way that they appear in the system and can be used as if they were a single storage volume.
The purposes of RAID are: to increase performance, to make the system resilient to the loss of one or more disks, and to be able to replace them without interrupting service. RAID exploits, in different ways depending on the type of implementation, the principles of data redundancy and parallelism in data access to ensure, compared to a single disk, increases in performance, increases in available storage capacity, improvements in fault tolerance and therefore greater reliability. The most common modes are RAID 0, 1, 5 and 10. Modes 3 and 4 have been virtually replaced by mode 5. Some systems use nested modes such as mode 10 or other proprietary modes.
RAID can also be implemented in normal PCs: low-cost RAID cards are available when this is not already present on more sophisticated motherboards. However, it is a technique historically used in servers or workstations where large volumes or high data storage performance are required: for example, to host a database or a digital audio or video editing station. RAID is also commonly found in NAS and, always, in storage systems for blade architectures.
Standard RAID levels
RAID 0
2
C × N
0
Low implementation cost; high write and read performance thanks to the parallelism of I/O operations on concatenated disks.
Inability to use hot-spare disks; drastically reduced reliability, even compared to that of a single disk.
RAID 1
2
C
N - 1
Reliability, i.e. resistance to failure, which increases linearly with the number of copies; read speed (in certain implementations and under certain conditions).
Low scalability; costs increase linearly with the number of copies; write speed reduced to that of the slowest disk in the set.
RAID 2
7
C × (2P - P - 1) / N
1
Protection against incorrect readings from all discs.
A dedicated controller is required to synchronise the reading of all discs; a large number of discs are required to achieve acceptable data capacity.
RAID 3
3
C × (N - 1)
1
Write speed equal to read speed.
Reading a block involves all disks, and therefore reads cannot be parallelised.
RAID 4
3
C × (N - 1)
1
Fault tolerance; fast read speeds thanks to parallel structure; option to add hot-spare disks.
The disk used for parity can be the bottleneck of the system; slow writing due to parity modification and calculation (4 disk accesses for each I/O operation).
RAID 5
3
C × (N − 1)
1
Parity is distributed, so there is no disk bottleneck problem as in RAID 4. Read and write speeds are faster than RAID 4 (because the disk dedicated to parity in RAID 4 can now be used for parallel reads).
Slow writes due to parity modification and calculation (4 disk accesses per I/O operation), but still faster than a single disk and increases as the number of disks increases. On a P410 controller, a RAID 5 consisting of 5 10,000 RPM disks, sequential read/write is comparable to that of an SSD; with 10 disks, it is more than double.
RAID 6
4
C × (N − 2)
2
Extremely high fault tolerance thanks to dual redundancy.
Very slow writing due to parity modification and calculation (6 disk accesses for each I/O operation), N+2 disks required, very expensive due to redundancy and complexity of the controller structure. Write Hole problem. Writes on different devices are not atomic as a whole: this means that a power failure during writing can lead to data loss. For example, with a system with 3 disks in RAID 5, if you wanted to modify block n, you would have to perform the following operations: read block n-1, read parity, calculate new parity, write block n, and write parity. The problem arises if the power fails during these last two operations.
C = capacity of the smallest disk; N = number of disks; P = parity disks
RAID 0: non-redundant partitioning

The RAID 0 system divides data equally between two or more disks, typically through striping, but without maintaining any parity or redundancy information that increases reliability (the term RAID, although widely used, is therefore inappropriate). RAID 0 is generally used to increase system performance, or for the convenience of using a large number of small physical disks as if they were a small number of large virtual disks.
The reliability of the system, measured as mean time between failures (MTBF), is inversely proportional to the number of elements, because it is equal to the ratio between the average reliability of the disks and the number of disks present. A two-disk system, for example, is half as reliable as a single disk. Since the file system uses all the disks, the failure of one disk makes such a large portion of the file system inaccessible that it often prevents any operation, although the data can be recovered, albeit incomplete and damaged. RAID 0 is very useful for creating servers that require large amounts of storage space, for which redundancy is irrelevant or managed otherwise (see RAID 1+0 and RAID 0+1), but where having a large number of volumes would be costly, such as an NFS server forced to expose dozens of mount points, or impossible, such as a Microsoft Windows system that has a maximum limit of 128 logical volumes.
RAID 1: replication

The RAID 1 system, also known as mirroring, keeps an exact copy of all data on at least two disks. It is useful when redundancy is considered more important than optimal use of disk storage capacity. In fact, the set limits its volume to that of the smallest disk. On the other hand, since a system with n disks can withstand the failure of n - 1 components, reliability increases linearly with the number of disks present.
In terms of performance, the RAID 1 system typically increases results for read operations, because many implementations are able to perform several operations in parallel: while the reading of a block is still in progress on one disk, they can perform another on a different disk. In any case, the read speed reaches that of the fastest disk when storage devices with different performances are present: a single read operation is requested initially and simultaneously on all disks, but ends when the first response is received. Conversely, the write speed drops to that of the slowest disk, because this type of action requires the same operation to be replicated on every disk in the set.
A common practice is to create an additional copy of a disk (also known as a Business Continuance Volume or BCV) that can be separated from the original RAID system and used independently. In some implementations, these types of copies can be separated and added incrementally, rather than requiring a complete RAID rebuild.
RAID 2: bit-level segmentation

A RAID 2 system divides data at the bit level (rather than the block level) and uses a Hamming code for error correction, which allows single-bit errors to be corrected and double errors to be detected. These disks are synchronised by the controller so that the head of each disk is in the same position on every disk. This system is very efficient in environments where numerous read or write errors occur, but nowadays, given the inclusion of Hamming code correction (ECC) directly in the disk controller, RAID 2 is not used and is considered obsolete.
RAID 3: byte-level partitioning with parity disk

A RAID 3 system uses byte-level striping with one disk dedicated to parity. RAID-3 is extremely rare in practice. One of the side effects of RAID-3 is that it cannot perform multiple requests simultaneously. This is because each individual data block has its own definition spread across all the disks in the RAID and will reside in the same location, so every I/O operation requires the use of all disks.
Redundancy
In the event of a failure, the parity disk is accessed and the data is reconstructed. Once the failed disk is replaced, the missing data can be restored and operation can resume. Data reconstruction is fairly straightforward. Consider an array of 5 disks in which the data is contained on disks X0, X1, X2 and X3, while X4 represents the parity disk.
RAID 4: block-level partitioning with parity disk

The RAID 4 system uses block-level data partitioning and stores parity values on one of the disks, much like RAID 3, where partitioning is at the byte level. This allows each disk in the system to operate independently when a single block is required.
If the disk controller allows it, a RAID 4 system can serve several read requests simultaneously. In reading, the transfer capacity is comparable to RAID 0, but writing is penalised because writing each block also involves reading the corresponding parity value and updating it.
RAID 5: block-level partitioning with distributed parity

A RAID 5 system uses block-level data partitioning, distributing parity data evenly across all the disks that comprise it. It is one of the most popular implementations, both in software and hardware, where virtually every integrated storage device has RAID-5 among its options.
Every time a block of data (sometimes called a chunk) needs to be written to the disk system, a parity block is generated within the stripe (which is the name given to a series of consecutive blocks. A block often consists of many disk sectors, sometimes as many as 256). If another block, or some portion of the same block, is written to the same stripe, the parity block is recalculated and rewritten. The disk used to store the parities is changed between one stripe and the next; in this way, the parity blocks are distributed.
It should be noted that the parity block is not read when reading data from the disk, as this would be an unnecessary overhead and would decrease performance. The parity block is read, however, when reading a sector results in a CRC error. In this case, the sector in the same relative position in the remaining data blocks of the stripe, together with the parity block, are used to reconstruct the missing block. In this way, the CRC error is hidden from the calling computer. Similarly, if a disk should fail within the system, the parity blocks of the remaining disks are mathematically combined on the fly with the remaining data blocks to reconstruct the data from the failed disk.
This procedure is usually called Interim Data Recovery Mode. The main computer is not aware that a disk has been damaged. Reading and writing to the disk system continues as before, albeit with some loss of performance.
In a RAID 5 system that has only one parity block per stripe, the failure of a second disk results in the loss of all data in the system.
The maximum number of disks is theoretically unlimited, but a common practice is to keep the maximum number of disks at 14 or less for implementations that have only one parity block per stripe. The reasons for this limit are that the probability of two disks in the system failing in succession increases as the number of disks increases. When the number of disks in a RAID-5 system increases, the MTBF of the system as a whole can even become less than that of a single disk. This happens when the probability of a second disk failing out of the remaining (N - 1) disks, between the time of detection, replacement and recreation of the first failed disk, becomes greater than the probability of a single disk failing.
RAID 6: block-level partitioning with distributed double parity

A RAID 6 system uses block-level striping with parity data distributed twice across all disks. It was not included among the original RAID levels.
In RAID-6, the parity block is generated and distributed between two parity stripes, on two separate disks, using different parity stripes in the two directions.
RAID-6 is more redundant than RAID-5, but it is very inefficient when used with a limited number of disks.
Proprietary RAID levels
Although all RAID implementations differ from the idealised specifications, some companies have developed completely proprietary systems that are very different from all others.
Double parity
One of the most common modifications to existing RAID levels is "double parity", also known as "diagonal parity". As in RAID 6, two different types of parity are created, but unlike RAID 6, the second type is not just an additional copy of the first. Instead, many double parity implementations calculate the additional parity on a different set of blocks. While RAID 5 and RAID 6 systems traditionally calculate parity on a standard set of blocks (A1, A2, A3, AP), double parity also uses different sets; for example, in the diagram below, RAID 5 and RAID 6 calculate parity with respect to all blocks starting with A. The double parity system, on the other hand, also uses blocks numbered with 1 to derive a different parity.
RAID 7
The RAID 7 system is a registered trademark of Storage Computer Corporation. It adds a caching system to RAID-3 or RAID-4 to increase performance.
Last updated