0

RAID 5 requires a minimum of three disks in order to work. Say each disk is 2 TB, and you have four disks, for a total of 8 TB. In RAID 5, your total capacity drops to 6 TB. Why? If the "spare disk" (albeit distributed) is only storing parity bits for all your files, why does it need an entire disk to do so? It makes sense why you lose drives in other configurations, as they are usually mirrors, but this I do not understand. I also do not understand the way RAID actually works in-depth, and would like a further explanation.

1 Answer 1

3

The disk is not a "spare". It's used for parity information.

The data between all other drives is run through an XOR computation, the result of which is stored on the parity drive. Due to the nature of XOR, if any of the drives that were used in the computation are lost, the information can be restored from the information on all other drives.

XOR stands for exclusive or and is a binary operation which results in 1 if one and only one of the inputs is 1, otherwise the result is 0.

So let's look at an example with 3 disks. If you have a 1 on the first disk and a 0 on the second disk, you put a 1 on the parity disk.

1 XOR 0 = 1

If any of the 3 disks would go offline, running the same XOR operation on the remaining disks will return the value that was on the disk which is now offline.

? XOR 0 = 1 => 1
1 XOR ? = 1 => 0
1 XOR 0 = ? => 1
3
  • But since RAID 5 uses distributed parity, why does it remove an ENTIRE disk from the total? Would it be useless otherwise, and more like RAID 0? I don't understand why it can't just give you all the space while storing parity bits here and there.
    – DrKumar
    Mar 31, 2014 at 12:00
  • 2
    The amount of the parity information required to fully restore any drive is the size of that drive. The fact that the amount is distributed over the entire volume has no impact on that fact. Mar 31, 2014 at 12:03
  • Note that this answer is describing RAID-4, not RAID-5. On RAID-4, there's a single parity drive but he parity is distributed across all drives in the array in RAID-5. There's no parity disk in RAID-5. The points in the answer are still perfectly valid, though. May 4, 2014 at 22:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .