Skip to content

Penguins in a Strange Land

Just another WordPress weblog

RAID-6 makes RAID more complex. The other ones are quite simple. Either duplication of blocks (RAID-1), reordering of blocks (RAID-0), or parity using the ⊻ (XOR) properties of A ⊻ B ⊻ B = A.

But what about RAID-6 parity and the way it is stored? You can’t just store the parity in two places:
1. layout: A B C D Pa Pb;
2. lost C and D;
3. If Pa = Pb, then there’s no way to reconstruct C, D or both.

Yesterday I found a paper from NetApp describing their implementation. You can find the PDF in their site here.

The gist is that the other parity block is constructed diagonally and it skips a disk in each interaction. Like this:
A1 B1 C1 Pa1 A1 ⊻ B1 ⊻ C1 Pb1 A1 ⊻ B2 ⊻ C3
A2 B2 C2 Pa2 A2 ⊻ B2 ⊻ C2 Pb2 B1 ⊻ C2 ⊻ Pa3
A3 B3 C3 Pa3 A3 ⊻ B3 ⊻ C3 Pb3 C1 ⊻ Pa2 ⊻ A3

What does this means? The fact that in the new parity calculation a drive is missing, it means that there’s always a row were you can restore the missing block from one of the drives. With that new block, you can then use the standard parity to get the block for the other drive. With a new diagonal now missing only one block, you can then proceed to the next row, following the same route.

Imagine drive A and B fails and you replace them with two new drives, X and Y respectively:

X1 Y1 C1 Pa1 A1 ⊻ B1 ⊻ C1 Pb1 A1 ⊻ B2 ⊻ C3
X2 Y2 C2 Pa2 A2 ⊻ B2 ⊻ C2 Pb2 B1 ⊻ C2 ⊻ Pa3
X3 Y3 C3 Pa3 A3 ⊻ B3 ⊻ C3 Pb3 C1 ⊻ Pa2 ⊻ A3

The restoration steps:

  1. Y1C2Pa3Pb2
  2. X1 = Y1C1 ⊻ Pa1
  3. Y2 = X1C3Pb1
  4. X2 = Y2C2Pa2
  5. X3 = C1Pa2Pb3
  6. Y3 = X3C3Pa3

Et voilà. Drives X and Y are restored with contents of A and B.
How about Linux’s RAID6 implementation? I still have to analyze it.

With the output of a ‘find’ command, or other, sorted list of entries:
(o=; while read f; do [ -n "$o" ] && [ "${f#$o/}" == "$f" ] && echo "$o"; o="$f"; done; echo "$o") < list

Meaning: show a line only if next line doesn’t include this one (if last line is a directory, it still shows).

Compare the output of the following two lines. They must match:
$ openssl x509 -noout -modulus -in server.pem | openssl md5
$ openssl rsa -noout -modulus -in server.key | openssl md5

$ sort a <(sed -e p b) | uniq -u
Meaning: list unique lines in (contents of file ‘a’ plus duplicated contents of file ‘b’). ’sort’ is required for ‘uniq’ to work.

Here’s the relative pricing graph:

Of course, the location also varies greatly. But notice how, for Hotel Vis, it varies so much in just four days.

So what places am I going to see in Croatia?

All the places that I can, in the following cities, as time permits:

  1. Zagreb, from 17th of August to the 20th
  2. Dubrovnik, from the 20th to the 24th
  3. Split, from the 24th to the 25th
  4. Zadar, from the 25th to the 26th
  5. Pula, from the 26th to the 29th
    • Including a trip to Venice!

And then back to Zagreb, for my plane back to Portugal.

Oooh, this is exciting! What perils await me? What sites, peoples, adventures?

Almost ready for Croatia.

Credit card fully paid, debit card charged up, hotel in Zagreb reserved.

Where should I go next, from Zagreb? Got a Croatia book, but I still need to find out how good the public transportation system is there.

Coming soon, my full schedule.

A new blog has descended upon the blogosphere.

Hopefully, this one will be useful.

See you soon,
Luciano