2

When I come to RAID 5 explanations I very often see pictures showing 4 discs with three data blocks and one parity block. As example calculation (on same sites, sometimes) I always see only 3 discs. Most likely because it makes more sense: I can XOR two blocks and create the parity, so three discs needed. On all these pictures the parity block has the same size as the three data blocks.

How can this be? How ist the RAID 5 parity calculated when I have 4 discs, so three even sized blocks that need to build a parity?

(PS. Even doubling the size of parity (from two blocks each) wouldn't help understanding this. Because this would than be RAID 6, wouldn't it?)

AyJayKay
  • 103
  • 6
  • Parity can be calculated for any positive number of operands. An even parity means that the sum is even. Odd parity indicates that the sum of operands is odd. See [Wikipedia](https://en.wikipedia.org/wiki/Parity_bit). – Axel Kemper Apr 26 '19 at 10:59
  • Sorry for confusion: I am not talking about the size of one block. I don't care whether its even or odd bit numbers. I am confused by the splitting of data blocks. How can one create a parity of size X from three blocks, each of size X? Because this is what you see on all the [pictures](https://en.wikipedia.org/wiki/Standard_RAID_levels#RAID_5) – AyJayKay Apr 26 '19 at 11:11
  • @AxelKemper in your link I again see a [raid 5 example with three discs](https://en.wikipedia.org/wiki/Parity_bit#Redundant_array_of_independent_disks) :) – AyJayKay Apr 26 '19 at 11:27

1 Answers1

5

Imagine that you have three data disks A, B, and C and an odd parity disk P.

The following table shows three data bytes and the resulting parity byte:

  A: 0 1 0 1 0 1 0 1
  B: 0 0 1 1 0 0 1 1
  C: 0 0 0 0 1 1 1 1
  P: 0 1 1 0 1 0 0 1

In case, for example, that disk B fails, we are left with A, C and P. The missing B byte can be reconstructed by calculating the odd parity of the surviving disks:

  A: 0 1 0 1 0 1 0 1
  C: 0 0 0 0 1 1 1 1
  P: 0 1 1 0 1 0 0 1
[ B: 0 0 1 1 0 0 1 1 ]
Axel Kemper
  • 10,544
  • 2
  • 31
  • 54