4
$\begingroup$

I know that RAID-5 consists of block-level striping across multiple disks, but using an additional parity-check block on each disk .. and that at least two disks are required for striping.

And it's obvious that each parity block is specific to each disk it belongs to (and so there is no need for allocating an additional disk).

RAID 5
Image from Wikipedia.

However I've been unable to understand why in fact there is an additional disk required for parity checks, as I found on this article:

The minimum number of disks in a RAID 5 set is three (two for data and one for parity).

Any idea?

$\endgroup$
11
$\begingroup$

I think you've misunderstood what the parity data is. They're not parity checks, so it's not true that "each parity block is specific to each disc it belongs to." The parity data is to allow recovery from a failed disc.

Let's go back to RAID-4 for a second, and assume we have three discs: discs $0$ and  $1$ are data and disc $2$ is parity. "Parity" means that the $b$th block of disc $2$ is the xor of the $b$th blocks of discs $0$ and $1$. The point is that, if any single disc fails, we can recover its data because the $b$th block of any disc is the xor of the $b$th block on the other two discs. For this to work, it's crucial that the parity data is on a separate discs. If you only had two discs and put the parity data on those discs (e.g., each disc was two-thirds data blocks and one-third parity blocks) then the failure of a single drive would destroy some blocks and their corresponding parity data, so you'd be unable to recover the data using just what was left on the remaining disc.

RAID-5 is the same idea except that, instead of putting all the parity data on the last disc, it's spread across all the discs. So, for a three-disc set-up, a third of the blocks would have parity data on disc $2$, a third on disc $1$ and a third on disc $0$.

The point of using RAID-5 rather than RAID-4 is that every time you write data, the corresponding parity block must be updated. If all parity data is on the same disc, that disc will be written to much more than the other discs ($k$ times as much, in a $k$-disc sytem), so it will fail faster. Spreading the parity data across the discs evens out the wear on them.

$\endgroup$
  • $\begingroup$ if I understood correctly, the parity block on each disk, as illustrated on the figure above such as Ap, is computed using hamming code for storing parity information for A1, A2 and A3? $\endgroup$ – Kais Oct 27 '18 at 21:30
  • $\begingroup$ Wikipedia says it's the XOR, and the word "parity" usually implies that. (Though Wikipedia also uses "parity" for RAID-6, which allows recovery from two failed discs so isn't actually parity.) $\endgroup$ – David Richerby Oct 27 '18 at 21:48
  • 1
    $\begingroup$ I would guess that the fact that a dedicated parity disk creates a performance bottleneck is even more a concern than it wearing out faster. $\endgroup$ – Jörg W Mittag Oct 27 '18 at 21:48
  • $\begingroup$ @DavidRicherby Ok, but XOR supports 2 bits as input. How it is used for processing 3 bits of A1, A2 and A3? $\endgroup$ – Kais Oct 27 '18 at 21:56
  • 5
    $\begingroup$ $A_1\oplus A_2\oplus A_3$. $\endgroup$ – David Richerby Oct 27 '18 at 22:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.