|
|
 |
|
 |
|
 |
 |
 |
 |
 |
 |
 |
|
 |
 |
 |
 |
 |
 |
 |
 |
 |
|
2. What Is RAID?
Two simple ideas are the keys to understanding RAID technology:
- Multiple disks accessed in parallel will give greater throughput than a single disk.
- Redundant data on multiple disks provides fault tolerance.
The first idea is self-evident. Provided that the RAID hardware and software perform true parallel accesses on multiple drives, there will be a performance improvement over a single disk.
The second idea is also self-evident. With a single hard disk, you cannot protect yourself against the costs of a disk failure --- the time required to obtain and install a replacement disk, reinstall the operating system, restore files from backup tapes, and repeat all the data entry performed since the last backup was made. With multiple disks and a suitable redundancy scheme, your system can stay up and running when a disk fails, and even while the replacement disk is being installed and its data restored.
To create an optimal cost-effective RAID configuration, we need to simultaneously achieve the following goals:
- Maximize the number of disks being accessed in parallel.
- Minimize the amount of disk space being used for redundant data.
- Minimize the overhead required to achieve items 1 and 2.
The original Patterson article compared five different schemes for achieving these goals. They were given the names "RAID 1" through "RAID 5". Some of these RAID schemes are not implemented in practice, but they serve as logical steps toward the above goals. Since then, the name "RAID 0" has been applied to a scheme that uses multiple disks in parallel with no redundancy, while the name "RAID 10" has been used for a scheme combining RAID 0 and RAID 1.
Here is a brief description of the seven RAID schemes. While reading these explanations, keep in mind that RAIDZONE on Windows NT supports RAID 0 (striping), RAID 1 (mirroring), RAID 5 (striping with striped parity), and RAID 10 (mirrored striping). |
|
|
|
2.1 RAID 0 (Striping)
As mentioned above, RAID 0 is a scheme that achieves maximum parallel disk accesses with no redundancy. There is no extra overhead associated with striping. Sequential blocks of data are written across multiple disks in stripes, as follows: |
|
|
|
 |
|
|
|
The size of a data block, which is known as the "stripe width", varies with the implementation, but is always at least as large as a disk's sector size. When it comes time to read back this sequential data, all disks can be read in parallel. In a multi-tasking operating system, there is a high probability that even non-sequential disk accesses will keep all of the disks working in parallel. |
|
|
|
2.2 RAID 1 (Mirroring)
RAID 1 is usually called "mirroring". It provides complete redundancy by writing identical copies of all data on a pair of disks. Multiple pairs of disks can be installed in a system. |
|
|
|
 |
|
|
|
The overhead of performing duplicate writes is relatively low, since they can be done in parallel.
In addition to fault tolerance, mirroring also gives improved read performance. Since the drives are duplicates, data can be read from both drives in parallel. |
|
|
|
2.3 RAID2 (Bit Striping with ECC)
RAID 2 performs data striping with a block size of one bit, so that all disks in the array must be read to perform any read operation. This implies that the disk spindles must be synchronized. A RAID 2 system would normally have as many data disks as the word size of the computer, typically 32.
In addition, RAID 2 requires the use of extra disks to store an error-correcting code for redundancy. With 32 data disks, a RAID 2 system would require 7 additional disks for a Hamming-code ECC. Such an array of 39 disks was the subject of a U.S. patent granted to Unisys Corporation in 1988, but no commercial product was ever released. |
|
|
|
 |
|
|
|
For a number of reasons, including the fact that modern disk drives contain their own internal ECC, RAID 2 is not a practical disk array scheme. |
|
|
|
2.4 RAID3 (Bit Striping with Parity)
RAID 3 is very similar to RAID 2, except that the Hamming-code ECC is replaced by a single parity disk. This parity disk is written in the same way as the parity bit in normal Random Access Memory (RAM), where it is the Exclusive Or of the 8, 16 or 32 data bits.
In RAM, parity is used to detect single-bit data errors, but it cannot correct them because there is no information available to determine which bit is incorrect. With disk drives, however, we rely on the disk controller to report a data read error. Knowing which disk's data is missing, we can reconstruct it as the Exclusive Or (XOR) of all remaining data disks plus the parity disk. |
|
|
|
 |
|
|
|
As a simple example, suppose we have 4 data disks and one parity disk. The sample bits are: |
|
|
|
|
Disk 0 |
Disk 1 |
Disk 2 |
Disk 3 |
Parity |
|
0 |
1 |
1 |
1 |
1 |
|
|
|
|
The parity bit is the XOR of these four data bits, which can be calculated by adding them up and writing a 0 if the sum is even and a 1 if it is odd. Here the sum of Disk 0 through Disk 3 is "3", so the parity is 1.
Now if we attempt to read back this data, and find that Disk 2 gives a read error, we can reconstruct Disk 2 as the XOR of all the other disks, including the parity. In the example, the sum of Disk 0, 1, 3 and Parity is "3", so the data on Disk 2 must be 1.
As with RAID 2, RAID 3 must read all data disks for every read operation. This requires synchronized disk spindles for optimal performance, and works best on a single-tasking system with large sequential data requirements. An example might be a system used to perform video editing, where huge video files must be read sequentially. |
|
|
|
2.5 RAID 4 (Striping with Fixed Parity)
RAID 4 is the same as RAID 3, except that the stripe width is greater than the disk sector size. This means that individual read requests can be filled from a single disk. This will give improved performance on a multi-tasking or multi-user operating systems, or in any application where read requests are not completely sequential (like a typical database application). |
|
|
|
 |
|
|
|
The major drawback of RAID 4 is that a single disk is used for all parity data. This makes the parity disk a "hot spot", which must be written every time there is a write operation on any other disk. Because the parity disk becomes a real bottleneck in RAID 4, this scheme is rarely implemented in practice. It is completely overshadowed by RAID 5. |
|
|
|
2.6 RAID 5 (Striping with Striped Parity)
RAID 5 uses a stripe width greater than the disk sector size, and also stripes the parity across all disks. This scheme provides all the advantages of RAID 4, and it avoids the bottleneck of a single parity disk. |
|
|
|
 |
|
|
|
RAID 5 will give superior performance on all multi-tasking read operations (sequential or random), and on sequential reads in a single-tasking environment. In all these cases, all disks can be read in parallel.
Writes incur a performance penalty on RAID 5. To update the parity block requires two extra reads (of the old data block and the old parity block), and one extra write (of the parity block). This penalty is reduced to one extra read for sequential writes, because the parity block will already be in the cache. However, this write performance penalty may not be significant on most systems. It is typically stated that only about 10% of all disk activity on client/server systems is write operations. If that figure is true for your system, the RAID 5 write penalty may have no great effect on performance.
You can avoid the RAID 5 write performance penalty, at some additional cost in extra disks, by using RAID 10. |
|
|
|
2.7 RAID 10 (Striped Mirrors)
RAID 10 was not mentioned in the original 1988 article that defined RAID 1 through RAID 5. The term is now used to mean the combination of RAID 0 (striping) and RAID 1 (mirroring). Disks are mirrored in pairs for redundancy and improved performance, then data is striped across multiple disks for maximum performance. In the diagram below, Disks 0 & 2 and Disks 1 & 3 are mirrored pairs. |
|
|
|
 |
|
|
|
Obviously, RAID 10 uses more disk space to provide redundant data than RAID 5. However, it also provides a performance advantage by reading from all disks in parallel while eliminating the write penalty of RAID 5.
In addition, RAID 10 gives better performance than RAID 5 while a failed drive remains unreplaced. Under RAID 5, each attempted read of the failed drive can be performed only by reading all of the other disks. On RAID 10, a failed disk can be recovered by a single read of its mirrored pair. |
|
|
|
Note: RAID Systems Need Tape Backups
It is worth remembering an important point about RAID systems. Even when you use a redundancy scheme like mirroring or RAID 5 or RAID 10, you must still do regular tape backups of your system. There are several reasons for insisting on this, among them:
- Regular tape backups allow you to recover from data loss that is not related to a disk failure. This includes human errors, hardware errors, and software errors.
- RAID does not protect you from multiple disk failures. While one disk is offline for any reason, your disk array is not fully redundant.
- Murphy's Law: "Whatever can go wrong will go wrong." Every computer should wear a belt and suspenders.
|
|
|
 |
|
|