The main benefit of RAID 5 over RAID 0 is that you get the added protection of being able to lose a drive without catastrophic data loss. The benefit over RAID 1 is that you only lose a third of your space, not half of it, while getting just shy the throughput of a RAID 0 array at average loads with typical read/write distribution.
You need at least three disks for a RAID 5 array - three data disks with distributed parity. If you were to do it with two disks, you'd essentially have RAID 1.
RAID is definitely worth it if you have the money. Which level to run depends on your budget and how much you value your data. RAID 0 is asking for trouble, and RAID 1 is useful only if you can't afford more than two disks. Next step up is RAID 5, which is what most people do for home use, as RAID 5 is best on a budget. If you want to go all out and avoid the performance penalties incurred from calculating and writing the block parity in a RAID 5 setup, you'll want to stack a RAID 0 array on top of a RAID 1 array for RAID 01/10/1+0/whatever they choose to call it today. That, however, takes at least 4 disks, and it's not really applicable for your average home setup.
Gawwad wrote:
As far as I know, RAID 5 uses two HDD's in RAID 0 and one in RAID 1 for backing up.
Should work with 3 HDD's, though I'm not sure what happens when the RAID 0 exeeds the space of the RAID 1 HDD.
RAID 5 works with the principle of parity. RAID 5 is block level striping, but it's easier to explain at the bit level, so here goes.
You have 5 disks in a RAID 5 array, A, B, C, D and E. In this example, we're focusing on one bit, parallel across the disks. We're going to go with these values:
Now, E holds the parity for this particular bit, so we need to calculate the parity based on the values on the remaining disks. This is done with a boolean XOR calculation. The truth table for XOR looks like this:
The calculation we're performing on these is (((A XOR B) XOR C) XOR D) = E, or, with our values applied, (((1 XOR 0) XOR 1) XOR 1) = E.
(((1 XOR 0 =) 1 XOR 1 =) 0 XOR 1) = 1. That means that E, our parity, is 1.
Our values are now:
Now, suppose we lose disk C. Oh noes. What do we do? Well, having these values
, we simply omit drive C from the calculation, and append an XOR of the parity at the end. That is, (((A XOR B) XOR D) XOR E) = C. Performing the calculation, we get (((1 XOR 0 =) 1 XOR 1 =) 0 XOR 1) = 1! Tadaa! We've gotten the value of C, thanks to the magic of the XOR gate. That's how parity works in RAID arrays.
Last edited by mikkel (2008-02-24 02:25:49)