On Tue, Dec 4, 2012 at 10:52 PM, Jim Klimov <jimkli...@cos.ru> wrote:

> On 2012-12-03 18:23, Jim Klimov wrote:
>> On 2012-12-02 05:42, Jim Klimov wrote:
>>> >> 4) Where are the redundancy algorithms specified? Is there any simple
> >>     tool that would recombine a given algo-N redundancy sector with
> >>     some other 4 sectors from a 6-sector stripe in order to try and
> >>     recalculate the sixth sector's contents? (Perhaps part of some
> >>     unit tests?)
I'm a bit late to the party, but from a previous list thread about
redundancy algorithms, I had found this:


Particularly the
functions "vdev_raidz_reconstruct_p", "vdev_raidz_reconstruct_q",
(and possibly "vdev_raidz_reconstruct_general") seem like what you are
looking for.

As I understand it, the case where you have both redundancy blocks, but are
missing two data blocks, is the hardest (if you are missing only one data
block, you can either do straight xor with the first redundancy section, or
some LFSR shifting, xor, and then reverse LFSR shifting to use the second
redundancy section).

Wikipedia describes the math to restore from two missing data sections
here, under "computing parity": http://en.wikipedia.org/wiki/Raid6#RAID_6

I don't know any tools to do this for you from arbitrary input, sorry.

zfs-discuss mailing list

Reply via email to