Friday, September 23, 2011

Understanding RAID

In this post i am going to talk about Redundant Array of Independent Disks, popularly known as RAID. Having seen it live, i understand it almost perfectly now. So lets get to it.

RAID 0
There is no redundancy in this type of RAID. The data writing method is called striping. It basically just groups the hard disks. Eg, 2 hard disks of 300 GB are installed. Once RAID 0 is configured, the effective disk size would be 600 GB. If one of the disks fail, the data is gone.

RAID 1
This is redundant, also called mirroring and does exactly that. Everything that is written on 1 disk, exactly the same is written on the other. Eg, 2 hard disks of 300 GB, Effective Disk size would be 300 GB, as 1 is the mirror of other ( cannot be said which is primary and which is secondary, as both are identical ). If one of them fails, the other is still working, the faulty disk can be removed and a new can be installed. We can also have a hot spare in this. Hot spare is a hard disk, installed as a backup, it is automatically made active when one of the disks fail. Minimum and maximum hard disks in this is 2 of same capacity each.

RAID 0 1
This is basically RAID 0 and RAID 1 put together. The hard disks have to be even in number. Consider this Eg, 4 hard disks of 300 GB each, configuring RAID 0 1, the effective Disk size would be 600 GB. Heres how. the 1st two hard disks would work in RAID 0, i.e 300 + 300 = 600. The 3rd and 4th would also work in RAID 0 i.e. 300 + 300 = 600. Now both these RAID 0 are mirror of each other i.e. RAID 1, giving 600 GB disk size eventually. Minimum hard disk in this is 4 of same capacity each.

RAID 5
This type of RAID is redundant. It does striping, but has a separate dedicated disk maintaining something called as a parity bit, which helps in rebuilding the data, if a hard disk fails. Eg, there are 3 hards of 300 GB each, RAID 5 is configured, the effective disk size would be 600 GB, because the 3rd hard disk is dedicated for parity check. Now if one of the 2 disks fails, another ( new one of 300 GB ) can be installed or the hot spare would be used and the data would be rebuild with the help of the 3rd disk maintaining parity. It is the most popular type of RAID. Minimum hard disk in this is 3 of same capacity each.

RAID 6
It is due to RAID 6 that i have written this post, i had not heard of it before, started searching for it, saw it live and then thought of sharing with you all :)
RAID 6 is basically RAID 5 with an extra backup disk. RAID 5 can survive if one hard disk fails, but what if even before a new hard disk is rebuild, a second hard disk fails, the data would be gone. This is exactly the reason for using RAID 6, it increases the backup hard disk to 2, so if 2 hard disks fail together, data can still be rebuilt. Eg. 4 hard disks of 300 GB each, the effective hard disk size would be 600 GB, with one hard disk for parity and one for backup. Minimum number of hard disk in this 4 of same capacity each.

Hope the concept is clear, please comment if an doubts. Also, do try it if you can, its fun :)