TimeLinux1

Wednesday, September 29, 2010

Linux HowTo: RAID Concepts

RAID or Redundant Array of Independent Disks is a method of data protection in the event of hard disk drive failure. As you know, all your data lives in the form of files on some form of media -- Hard Drives, CD Drives, DVDs, USBs, SD Cards etc. So if you are concerned about the data protection and recoverability, it helps to maintain multiple copies of the data on different media. RAID works similar to that but on large number of hard drives arranged in the form an array. This is especially important for Enterprises and Businesses who value their data immensely. Here are some RAID or simply raid concepts--I've deliberately tried to keep it more readable by not including specific commands. If you are looking for specific raid commands, try googling for them, there are tons of resources, tutorials & user-groups out there that can be helpful..

-RAID    =    redundant array of independent disks
        - makes several independent disks to appear logically as one.
        - eliminates spof  (single point of failure)
        - spreads IO for performance
       
-Raid terms:
        - Array    = a collection of disks logically grouped to appear as one to the application.
        - stripe width    = the number of parallel units of data that can be read or written simultaneously = usually equal to the number of disks in the array. The more the better.
        - stripe size    = the amount of data to be written simultaneously.
                = less stripe size means more disks (spreads) . more stripe size means less disks (faster)
                = is usually a dynamically configurable parameter (unlike stripe width which is fixed = n disks)
        - chunk size    = subset of stripe size. Also called striping unit.
                = the amount of data written to each disk in one swipe as part of the stripe size.
                = the optimum value depends on IO rate. Ideally each IO request should be serviced by a single disk.

Raid types:

-Striping:
        - also called raid 0.
        - The technique of writing chunks of data across a set of disks.
        - data is also read back in the same fashion, in chunks.
        - the idea is spreading read-write across several disks will have better bandwidth and performance than a single disk.
        - while disks in raid 0 can be of different sizes, but it is recommended to have same size. This prevents concentration
            of data in the bigger disks of the array.
        - raid 0 gives good performance but poor recoverability. If one disk in the array fails, the whole array fails.

-Mirroring
        - also called raid 1.
        - The technique of writing the same data on multiple disks.
        - The number of mirrored disks is the size of the array. eg 4 disks, 2 mirrors=> size of array = 2.
        - raid 1 gives high recoverability but lesser performance.

-Parity
        - Is the XOR information that can be used to recreate lost data in case of disk failure in an array.
        - This comes useful in a raid 4 or raid 5.
        - XOR truth table says 0 if both 1s or both 0s. 1 if one 1 and one 0. eg 1xor1 = 0, 1xor0=1, 0xor1=1

-raid 4
        - also called dedicated parity in which one disk is dedicated for storing parity info.
        - requires 3 disks at minimum.
        - parity information is generated and stored along with each write operation.

-raid 5
        - also called distributed parity in which parity info is stored successively on each participating disk in the array.
        - requires 3 disks at minimum.
        - parity information is generated and stored along with each write operation.
        - performance is slightly better than raid 4 because the parity is spread across all the disks.

-Note:   
        -The three basic raid architectures are raid 0, raid 1, raid 5. (not raid 4?)
        -These basic raid architectures can be combined in a variety of combinations to produce "hybrid" or "nested" archs.
            eg:    raid 0+1, raid 1+0, raid 5+0
        -In either raid 0+1 and raid 1+0, the actual usable disk space is half the available disks.
        -eg:    if 10 disks are available, the actual usable disk space is 5 disks.
        -However, fault tolerance of raid 1+0 > raid 0+1

No comments:

Post a Comment