I do understand RAID 1. You have two drives that are mirrored. So when one drive fails, you have the full set of data on the other drive.
But with RAID 5 you are able to lose a complete drive out of a set of 3 for example. You have full data redundancy without sacrificing half of your capacity. How does this work?
In: 5
RAID 5 takes advantage of technology called Parity Calculations for redundancy.
Parity uses the Function XoR (exclusive Or). XoR takes in 2 binary digits (0 or 1) and if both are the same it returns 0, if they are different it returns 1
0 + 0 = 0
0 + 1 = 1
1 + 0 = 1
1 + 1 = 0
Now imagine having an array of 3 hard drives, 2 storing data and 1 storing the parity info. Take a string of bits from each drive and perform XoR
0 + 1 = 1
Now assume you lost a disk
0 + x = 1
Since you know the parity result, you can calculate that the missing but Must be 1, because if it was 0 the parity calculation would fail. In this way you can use only a single disks worth of space to store parity info for an entire array of disks vs having a mirrored copy.
RAID 5 doesn’t use a single disk for parity, but rather spreads the parity info across the entire array in order to improve overall performance. But even spread over the array the parity info is only 1 disks worth of space regardless of the size of the array.
In practice though RAID 5 is going the way of the dodo. The problem is that drives are now so large that if you replace a drive it can take more than 24 hours to rebuild the array. During that time your array is vulnerable because it is being stressed and the chances of blowing another drive is high. If you lose a 2nd drive, you lose all your data.
RAID 6 works like RAID 5, but has 2 separate parity calculations (losing 2 disks worth of space) allowing you to lose 2 drives without losing data.
But RAID 10 still provides far better overall performance.
Latest Answers