Raid

RAID - Redundant Array of Inexpensive (Independent) Disks. RAID is an architectural feature that does not directly deal with the design of the disk but rather how to group a quantity of these disks together to get one or more of features found on expensive high end storage devices.

The Raid controller makes several disks appear to be a single disk and depending on how they are arranged, this can provide more storage, faster access to storage and/or better protection against disk failure and data loss.

Raid was intially available in 6 levels 0-5 with each level offering various combinations of these three features. Additional and often proprietary levels exist. Also systems that combine certain pairs of levels exist.

Raid Level 0 - consists of dividing the storage up into stripes consisting of several sectors grouped together with each succeeding stripe appearing on the next drive of the Raid device in a round robin fashion. This is called striping. If a single large block of data made of several strips is requested, some systems are designed to read subsequent strips off of the different drives at the same time, thus giving extremely high data throuhput.

Raid Level 0 works well with large blocks of data. However, Level 0 has several disadvantages.

  • 1) It works very poorly if a single sector or small number of sectors are desired because the whole stripe is retrieved anyway. And the parallel read facilities is also lost since most systems will not process different reads in parallel.
  • 2. If a disk has a mean failure of 20,000 hours, increasing the number of disks increases the chance that one of the will fail in less than 20,000 hours and since the data is spread across several disks, the failure of one disk equates to a complete failure of the Raid system.

    Raid Level 1 - consists of duplicates of each set of disks with identical data on both. Striping is used to store the data. This provides excellent reliability and quick read if provided with advanced controllers. While one set of disks is handling a read request, the second set of disks can handle a second read. Remember getting to the data is the slowest part of access.

    Disadvantages of Level 1

  • Writing gains no advantage because both copies of the disk must be updated. It may even take a little longer because if one of the disk sets is handling a previous request, the system must wait for that to finish before indicating that the read is successful.
  • There are two disks and they serve the function of one. The cost of disk storage doubles to gain the security of redundancy.

    Raid Level 2 - discards striping and goes the opposite way. The data is broken up into very small units - word, byte or even bit and each piece is assigned to a different drive. Error checking data such as Hamming code is generated and also saved with the data. The spindles (disks) of all disk units are synchronized so that all bits of a unit of data and error code are read at once. The error code allows the data to be regenerated even if one of the drives fails.

    Disadvantages of Level 2

  • The down side of this scheme is that the use of error correcting data becomes cost effective with a large number of disks. A 32 bit byte with 6 bits of Hamming data and a word parity bit requires 39 drives and the error data is still 19% of storage. Additionally the controller must be able to perform the Hamming code check for every bit transfered.
  • Even though the protocol allows very small units of access, the standard hardware protocols use sectors size access. If a level 2 Raid system uses a 10 disk design, a 10 byte file would take up 1 sector on each of the 10 drives.

    Raid Level 3 - uses the above technique with only the parity bit thus giving a much higher data percentage. If an error is detected, the read is re-issued at time cost, but only if error is detected. Normally, a parity bit only determines that something is wrong and not where. However, it is easy to physically (electrically) determine if a particular drive fails and therefore the location of the bad data is known.

    Although the throughput of Level 2 & 3 is high, the number of seperate i/o reqeuests is not much better than with a single drive. It can still only do 1 request at a time. Additionally, synchronized spindles are a requirement.

    Raid Level 4 - implements access and the parity scheme at the sector level. Level 4 works like level 0 (interleaving) with the addition of a form of parity stored on an additional drive. Each sector on the drive set is exclusive ORed together and the resulting stripe is written to the additional drive. The sector on a lost drive can be regenerated from the remaining drives. Buffering is used to hold the sectors being accessed thus avoiding the need for synchronization. Level 4 also supports multiple independent writes and so small block writes are faster. A system with as few as two disks is practical.

    The inefficency of this design comes with small changes to data. Not only does the data have to be written out, but all the associated sectors must be read in and a new parity calculated and written out. An alternative is to just read in the old data before it is changed and the parity data and adjust it accordingly. But that still takes four additional disk accesses.

    Additionally, the parity drive is constantly being accessed even if not all of the drives in a stripe set are not accessed.

    Raid Level 5 - uses the concept of Level 4 but distributes the parity stripe across all of the drives so the demand on each drive is about equal. A system with as few as 3 disks is practical.

    However, this also means that an attempt recover from a drive crash while possible is more complicated.