tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: swap-on-raidframe vs raidctl -P

der Mouse writes:
> >> One would be a way to configure raidframe for uses (like swap) that
> >> don't care about data preservation when the partition is not in use;
> >> parity rewrite at boot would be dummied out for such partitions.
> > Consider a RAID 5 set, used for swap, where there is a stripe with
> > bad parity.  Let the blocks of that stripe be A, B, and P.  A "small
> > write" to A will read P, compute P', and write out A' and P'.
> How can it compute P' without having B on hand?  I must be missing
> something.

Sorry.. in the description above I neglected to mention that A will 
have to be read as well....

In the normal case, P is equal to A XOR B.
With a change from A to A', P' is computed as P' = P XOR A XOR A'.
After this, P' is equivalent to A' XOR B, and any of P', A', or B 
can be reconstructed via an XOR of all the others.

The same arguments can be made for a stripe of blocks A, B, C, D, and P.
P equals A XOR B XOR C XOR D.  When changing D to D', P' = P XOR D XOR D'.
After this, P' is equal to A XOR B XOR C XOR D', and any of A, B, C, 
D' or P' can be computed via an XOR of all the others.


Greg Oster

Home | Main Index | Thread Index | Old Index