What is RAID in Operating Systems

What is RAID in Operating Systems

The performance growth of secondary storage devices is much less than compared with the rate for processors and main memory. The two major challenges facing the storage industry today are:

  • Disk I/O throughput should be increased
  • Data accessibility at the time of hard disk failure.

We can overcome these problems with the help of RAID (Redundant Array of Independent Disks). The basic idea behind RAID is to combine multiple small, inexpensive disk drives into an array to accomplish performance or redundancy goals not attainable with one large and expensive drive. This array of drives will appear to the computer as a single logical storage unit or drive. The main functions of RAID are:

  • Storing the same data in different places on multiple hard disks improves the storage performance
  • Provide better throughput
  • Data fault tolerance

Better performance is accomplished by sharing the workload in parallel among multiple physical hard drives. Fault tolerance is achieved through data redundant operation where if one drive fails or has a sector failure, a mirrored copy of the data can be found on another drive.

In the operating system, RAID appears to be a single logical hard disk, instead of multiple hard disks. The RAID controller controls how the data is stored and accessed across the physical and logical arrays (collection of hard disks). There are 7 levels in RAID. Let’s understand each level one by one.

RAID Level 0 (Striping / Span)

The first level of RAID is level 0 is often called stripping. The idea behind this level is the stored data is divided into a number of parts called strips and loaded these strips across the member of the disks array. For a better understanding consider the below figure.

RAID-0

Advantages:

  1. It is a very fast method.
  2. It is a performance-oriented disk mapping method.
  3. The performance is better than a single drive because the workload is balanced by the array members.
  4. This method is useful for high-performance systems.

Disadvantages:

  1. No redundancy of data.
  2. It offers no fault tolerance.
  3. When any disk member fails, it affects the entire array.

RAID Level 1 (Mirroring)

RAID level 1 uses at least two duplicate hard drives and stores the exact same blocks of information between them. The RAID level is often called Mirroring. If one of the mirrored drives is failed due to a mechanical problem or does not respond, then the remaining drive will continue to serve and provide correct data. For a better understanding consider the below figure.

RAID-1

Advantages

  1. It provides high reliability.
  2. Fault tolerance and recovery from failure are simple.
  3. It has good performance.

Disadvantages

  1. Because of mirroring data, it is expensive to implement.
  2. RAID 1 implementation requires a minimum of two drives.

RAID Level 2 (Error – Correction Code)

RAID 2 does not use the standard way of mirroring, striping, or parity to store data. It implements these methods by separating data at the bit level and then saving the bits over a number of different data disks and redundancy disks. Hamming code is used to compute the parity of the redundant bits to check and correct errors. The strips are very small at this level, often as small as a single byte or word. The hamming code is calculated across corresponding bit positions on each data disk, and the bits of the code are stored in the corresponding bit positions on multiple disks. RAID level 2 is rarely implemented in real life.


RAID Level 3

RAID 3 is organized in a similar fashion as RAID 2, except that RAID 3 requires only a single redundant disk. RAID 3 employs parallel access with data distributed in small strips. Instead of an error-correcting code, a simple parity bit is computed for the set of individual bits in the same position on all of the data disks. In the event of drive failure, the parity drive is accessed and data is reconstructed from the remaining devices.

Advantages

  1. Because data are stripped in very small strips, RAID 3 can achieve very high data transfer rates.
  2. Any I/O request can be involved in the parallel transfer of data from all of the data disks.

Disadvantages

  1. It is rarely implemented.
  2. It processes only one I/O at a time.

RAID Level 4

This level uses a dedicated parity drive to protect stripped data disks as in RAID level 0. Parity information for the stripe is calculated and stored on a parity disk. If one of the data disks failed then information is re-build on a separate disk using the parity information. If the parity disk fails then the parity information is recalculated on a spare disk. It is better suited to I/O transactions rather than large file transfers. The main disadvantage is the parity drive can be a bottleneck during write operations.


RAID Level 5

It is the most common type of RAID level. It is organized in a similar fashion to RAID 4. The only difference is that RAID 5 distributes the parity stripe across all disks. RAID 5 eliminates the write bottlenecks. The only bottleneck it has is the parity calculations process. But with modern CPUs and software of RAID, it is not a very big bottleneck. RAID 5 required a minimum of 3 disks to implement.

Advantages

  1. It has the highest (read) data transmission rate.
  2. It has a low ratio of ECC (parity) disks to data disks, which means high efficiency.

Disadvantages

  1. It has the most complex controller designs.
  2. It is difficult to rebuild in the event of disk failure.
  3. It does have a high overhead for small writes. To change 1 byte in a file, the entire stripe must be read, the byte has to change, the parity information needs to recalculate, and the entire stripe has to be rewritten.
  4. The disk failure has a medium impact on throughput.

RAID Level 6

In the RAID 6 method, two different parity calculations are carried out and stored in separate blocks on different disks. Because of this, it needs N+2 disks (2 for parity).

Advantages

  1. It provides extremely high data availability.
  2. Three disks have to fail within the MTTR (Mean Time To Repair) interval for causing data to become unavailable.
Scroll to Top