Submitted by Dave Burford
Parity
Redundancy information calculated from the actual data values. Data are typically the blocks or bytes distributed across the drives in the array.
How Parity Works
Because computer data is stored as binary numbers (0’s and 1’s) called bits, Boolean (logical) operators can be used to transform data. Logical operator outcomes are represented as “true” (1) or “false” (0). One of these operators is the Exclusive OR, written XOR. The XOR operator is "true" if and only if one of its operands is true.
Here is a simple example:
Suppose we have bits A and B and want to calculate C using XOR:
A=1 B=0
A XOR B = C
C=0
Uh Huh. So what right?
The interesting (and useful) thing about XOR is that if performed twice in a row, it "undoes itself". This allows for calculating any single missing value from a set of values. Additionally, this operation can be done on any number of bits. This property of XOR means XOR is typically used to calculate parity.
For a fuller appreciation of what is going on try this: suppose we have stored on a hard drive the letters A, B, and C. Here are the actual values:
A=01000001
B=01000010
C=01000011
To calculate parity:
A XOR B XOR C = Parity
01000001
01000010 XOR =
00000011
01000011 XOR =
10000000 = Parity
Suppose we “lost” the value for B, we can use A, C and Parity to calculate B.
A XOR C XOR Parity = B
01000001
01000011 XOR =
00000010
10000000 XOR =
10000010 = B (go ahead and look above to check, you know you want to)
Pretty nifty. Here’s the thing, a RAID 5 calculates and stores party for every bit that is stored on the RAID. This takes time and hard disk space.
You can use the Calculator included as part of Windows (%SystemRoot%\system32\calc.exe) to do your own XOR calculations. Just use the Scientific view and binary values.
January 2008
