RAID 5 combines the performance and capacity benefits of striping with fault tolerance through distributed parity, allowing a storage array to survive the loss of one drive without losing data. It requires a minimum of three disks and uses an XOR-based parity system to enable full drive reconstruction.
RAID 5
With RAID 0, we increase the performance and capacity of our drives. However, there's no fault tolerance, so if one of those drives dies, we lose our data. With RAID 1, we are now mirroring that data, so we have fault tolerance and redundancy within our data. However, the problem is that it doesn't increase the speed of those drives. With RAID 5, we actually have both of those.
RAID 5 does striping just like RAID 0, and we know striping increases the performance and capacity of a drive or a volume. But what we also have with this is parity, which gives us some ability to lose a drive but not lose our data.
So just like RAID 0, we're going to write the first block of data to the first disk, the second block of data to the second disk, and then we're going to write a block of data that's the parity bits.
How do these parity bits work? It does depend on the RAID configuration that we have, so we're just going to take a look at RAID 5, which uses an XOR function. We don't need to be too concerned about an XOR function, but essentially, if we're comparing bits here, we have a bit zero and zero. Those are the same, and so we're going to say a zero. And down here at the bottom, one and one will be a zero as well. But if we have different bits, 0 1 or 1 0, those are going to be ones in the parity bit.
Now, if we were to lose half of the bits and not know what they were, we could recreate that. Here we have a zero, and we know that the second bit is going to be the same because we've got a zero in the parity section, so that's going to be a zero. Here we have another zero, and we know that the parity bit is different — it says it's different — so this is going to be a one. Here we have a one, and once again we are going to be different, so that's going to be a zero. And then we have a one right here on the first disk, and this is a zero, so we know that they are the same, so this will be one.
We can recreate what this column of bits has. Well, your disks do the same thing: the parity bit allows us to recreate that data.
The way RAID 5 stores these parity bits is kind of interesting. It starts out with the first block, which is A1, then the second block, which is A2, then the third block, which is A3, and then it figures out what the parity bit is and creates that on disk 4. Now the second block of data that we have, B1, B2 and B3 — the parity bit gets stored on disk 3. And then we have C1, C2 and C3, and the parity bit gets stored on disk 2.
You can see that the parity bit shifts as it goes along. So we see it, and then it resets and shifts again, so it starts back over here, and so on and so forth. We see it shift and use different disks for those parity bits.
So what have we accomplished by doing this? Since we're striping across many disks, we increase the speed and the capacity of those disks, so we can write and read faster. But what else have we done? Because of the parity bits, we also have created fault tolerance, and now we could lose one disk and still be fine.
This works on many variations of disks. We do have to have at least three disks for RAID 5, but we could have four disks or five disks. In any one of these scenarios, we could lose one of the disks, but then rebuild that disk.
TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.
Explore free tools and programs →