We will be using RAID to provide us with redundancy. So what is RAID?
Redundant Array of Independent Disks (RAID), is basically a storage technology that can be used to provide safer storage by using an array of disk. Several RAID configurations that we are interested in, are RAID 0, RAID 1, RAID 5, RAID 6. For more details about RAID, you can refer to Wikipedia.
RAID 0 (AKA striping)
This configuration does not provide any data redundancy. It is basically using 2 or more disk together like a single disk. If one of the disk fail, the whole array will fail, all your data will be lost.
RAID 1 (AKA mirror)
Basically you use two or more disk together all storing the same data. If you have 3 drive, and 2 of them failed, you still have all your data intact. For n number of drive, you can have up to n-1 drive to fail while still having you data intact.
RAID 5
Basically you use three or more disk together. 1 disk worth of space used for parity while the rest is for data. In other words, if you have n drive, you can only use up to n-1 drive worth of space. The parity is distributed into all drive. In this configuration you can have 1 disk fail and still keeping all data intact.
Some might be wondering what is parity, so let me explain a little about parity. For example, using even parity (the column sums to an even number), a file is stored in disk 1 2 and 3, then the parity is stored in disk 4.
Disk 1's content: 1 1 1 0 0 1 0 1 0 1 0 0 0
Disk 2's content: 1 0 1 0 1 0 1 0 1 0 1 0 1
Disk 3's content: 0 0 1 1 0 0 1 1 0 0 1 0 1
Disk 4's content: 0 1 1 1 1 1 0 0 1 1 0 0 0 (even parity)
If Disk 2 fail, we can rebuild the content because column must sum to an even number.
Disk 1's content: 1 1 1 0 0 1 0 1 0 1 0 0 0
Disk 3's content: 0 0 1 1 0 0 1 1 0 0 1 0 1
Disk 4's content: 0 1 1 1 1 1 0 0 1 1 0 0 0 (even parity)
First column is 1 + 0 + 0 = 1, so the first bit in disk 2 must be 1.
Second column is 1 + 0 + 1 = 2, so the second bit is disk 2 must be 0.
So on and so forth.
RAID 6
RAID 6 is similar to RAID 5 but it has 2 sets of parity thus using 2 disk worth of space for parity and you need four or more disk. In this configuration you can have 2 disk fail and still keeping all data intact and if you have n drive, you can only use up to n-2 drive worth of space.
The parity math here gets a little more complicated so I will post the details in the next post. Merry Christmas!
Please note that RAID requires all the disk to be of the same size. If you use different size, the smallest size among them will be used for building the array. For example, four disk, 200 GB, 400 GB, 400 GB, 400 GB in RAID 5, it will be viewed as four 200 GB disk the total usable space will be 600 GB (4-1 disk worth of space). All the pictures are taken from Wikipedia, I take no credit in them.
No comments:
Post a Comment