RAID, which stands for Redundant Array of Inexpensive Disks, is a method of aggregating together several disks to form a larger and/or more secure storage volume. There are many different types of RAID arrays, most of which fall into one of six different levels. Each level has benefits and detractors. This article will be concerned with describing the most typical RAID configurations.
RAID is implemented in one of two ways: Software RAID, or hardware RAID. Software RAID is typically used on personal computers for RAID 0 or RAID 1. Software RAID is cheaper to implement, and is usually supported by at the OS level. Unfortunately, the additional processing overhead often results in performance hits that are unacceptable for anything beyond personal use. For more enterprise-level installations, hardware RAID is preferable. Though more expensive, performance is greatly increased due to dedicated equipment which handles the RAIDing process at the drive level, allowing the operating system to see the RAID array as a normal disk.
Please note that the additional safety provided by RAID arrays of level 1 or greater is not sufficient to render additional backup solutions unnecessary. Backups of important information should always have multiple copies, preferably with at least one copy kept in a secure external location.
RAID 0 is the the riskiest level, and is used to create arrays that are as large as the member disks pooled together. This has limited use, but can be used to achieve performance gains on disk reads and simplification of multi-drive storage.
Most frequently, RAID 0 is used in gaming systems or some file servers in which quicker disk-read times are important. Since the data is pooled across two or more drives, each drive can seek the information independently, which for many smaller reads can result in a performance boost. In optimal situations, this can result in seek times half that of a single drive and transfer speeds of twice that of a single drive.
Since RAID 0 pools the storage of two disks together without introducing any redundancy, the possibilities of disk failure and data loss are dramatically higher than storing on a single disk. With each disk added to the array, the probability of failure increases proportionally. It should also be noted that RAID 0 implementations are limited by the size of their smallest disk. If a RAID 0 array is created with a 60GB disk and an 80GB disk, the size of the array will be 120GB, not 140GB.
RAID 1 arrays perform what could be seen as the opposite of RAID 0 arrays: Rather than spreading the data across two disks to maximize array size and performance, RAID 1 arrays mirror all data on all disks.
RAID 1 arrays are most often used on personal machines or OS disks on servers where redundancy is paramount. A typical RAID 1 array consists of two disks. At any time, one disk can fail and be replaced with no interruption of service due to the dead disk. While a two drive array has a failed disk, and then while the replacement disk is being rebuilt, it is just as vulnerable to failure as a single disk. RAID 1 arrays can achieve performance increases similar to those of RAID 0, due to each drive being able to seek the data independently. Also, RAID 1 arrays facilitate easy backups, as at any time one of the disks can be removed and backed up independently before being added back to the array.
Due to the fact that all data is being mirrored across all drives, RAID 1 arrays are only as large as their smallest member. An array with a 60GB disk and an 80GB disk would only be 60GB.
RAID 5 is probably the most common RAID implementation. It typically functions with a minimum of 3 disks, and can easily scale up to gigantic, fairly secure storage arrays. RAID 5 is often seen as a sweet spot between array size, redundancy, and cost.
RAID 5 functions by storing information about the array as a whole on each of the independent disks by using parity bits. When a disk dies and is replaced, the contents of the disk are still intact across the remaining drives. What this means is that at any time a drive can fail without affecting the array as a whole, and replacement drive can later be added without any data loss. Additionally, the OS and applications can continue to operate as if there was never a failure while a replacement drive is being installed and recovered.
Similar to other RAID levels, the size of a RAID 5 array is limited by the size of the smallest member. A RAID 5 array loses one disk per array to parity data, so the size of the array can be calculated as (N-1)*S, where N is the number of disks and S is the size of the smallest drive in the array. An array consisting of 3 80GB disks would be 160GB, and an array of one 60GB disk and three 80GB disks would be 180GB.
Like the other levels, RAID 5 has limitations. The chief detractor of RAID 5 is that the redundancy of the array comes at the cost of individual disk lifespans. Since any disk write will incorporate the writing of parity data to other disks, any given write will require many disks may need to be active. This also has implications on drive performance, though in practice RAID 5 performance is only somewhat lower than that of RAID 0.
Standard RAID 5 configurations are incapable of surviving multiple simultaneous disk failures. Since only a single copy of parity data is kept across the array, a second failure results in the loss of irrecoverable data. As such, RAID 5 arrays are most vulnerable when rebuilding after the replacement of a failed disk: All disks are occupied by rebuilding the data on the replacement drive and due to constant writing are more likely to fail themselves. Some arrays incorporate additional features to reduce the likelihood of multiple disk failure, the most common being a hot spare drive that will be populated with data as soon as an active drive fails.
RAID 6 addresses some of the vulnerability of RAID 5 by doubling the parity blocks. This enables RAID 6 to endure two simultaneous disk failures without loss of data.
RAID 6 is basically the same as RAID 5 with an added layer of redundancy. RAID 6 implementations are still fairly new and as such can be more expensive, but are well-suited to large arrays with many disks. Due to the doubling of parity blocks, two disks of storage space are lost per array, and of course array size is still limited by the smallest member disk. This means that array size is calculated by (N-2)*S, where N is the number of disks and S is the size of the smallest drive in the array. RAID 6 arrays can continue function after the loss of two drives, even if the replacements are both simultaneously in the rebuild phase.
RAID 6 suffers from the same problems as RAID 5 in terms of disk lifespans, exacerbated somewhat due to twice as much parity data being present on each disk. Read times are just as quick as RAID 5, but write times are increased because of additional parity writes. RAID 6 is not well-suited to smaller arrays due to these performance issues, but does well on larger arrays of 6 disks or more.
Additional/Non-Standard RAID Levels
RAID 1+0 is a combination of RAID 1 layered on top of RAID 0. This allows a standard RAID 1 array to be much larger, while still allowing for RAID 1's redundancy. Depending on which disks sustain failure, a RAID 1+0 array could lose up to half of its disks and remain functional without data loss. The capacity of a RAID 1+0 array is calculated by (N*S)/2.
- Note, RAID 1+0 is not the same as RAID 0+1, which cannot typically sustain multiple disk failures, but can replicate data from one segment of the array to another, which is desirable for some configurations.
RAID 5E, 5EE, and 6E arrays are the same as standard RAID 5 and 6 arrays, Enhanced with an additional hot spare drive that is used for additional storage of parity data. If a disk fails, the array will compress itself into a standard RAID 5 or RAID 6 array and be able to sustain the normal failures for that RAID level. When the damaged disk is replaced, the array will expand once again into the Enhanced form. This configuration is not recommended for arrays of fewer than 10 disks, as the compression and expansion process is very I/O intensive and could result in severely reduced performance and increased likelihood of disk failure.
Other: RAID tutorial