Jon,

The analogy in your book could work,  the RAID hardware (or software) would 
need an algorithm to determine whether addition or subtraction is required, 
and then apply each as necessary.   It turns out that using an XOR operation 
is much simpler.

The parity data in a RAID 5 array is calculated using an XOR operation.

The XOR operation returns FALSE if the two inputs are the same,  TRUE if 
they are different.    ie:

1 XOR 1 = 0
0 XOR 0 = 0
1 XOR 0 = 1
0 XOR 1 = 1

It doesn't matter which section you have lost,  the same XOR operation will 
calculate the missing data.  Comparing all possible combinations, you will 
find that:
data1 XOR data2 = parity
data1 XOR parity = data2
data2 XOR data1 = parity
data2 XOR parity = data1
parity XOR data1 = data2
parity XOR data2 = data1

This operation works the same on larger chunks of data as well,  applying 
the XOR operation on a bit-by-bit basis.
10110100 XOR 01110001 = 11000101

Wikipedia is a good starting point for info on XOR and RAID arrays.

Regards,
Dana Harding

----- Original Message ----- 
From: "Jon" <[EMAIL PROTECTED]>
To: "CLUG General" <[email protected]>
Sent: Tuesday, October 10, 2006 9:34 PM
Subject: [clug-talk] RAID Question


> I'm going to bed soon, promise. Just one more question about RAID5: In a
> 3 disk RAID5, the parity bit can be used to derive the missing
> information if one of the disks fails. I think.
>
> The rather simplistic example in my book has is the following (each
> column represents one disk)
>
> 22   12   34
> 65   68    3
> 13    9    4
>
> the parity bits are 34, 68, and 13.
>
> So, my question is - say, for example, that disk 3 goes down. I am
> therefore left with
>
> 22   12
> 65   68
> 13    9
>
> How does the system know when to add and when to subtract to get the
> missing values? Like how does it know not to do 22-12 and end up with 10
> instead of 34?
>
> Or 65 + 68 = 133 instead of 68-65 = 3?
>
> Pointers, thoughts, and links welcome.
>
> Thanks!
>
> J
>
> -- 
> http://www.jonwatson.ca
> +1.403.875.6048
>
> _______________________________________________
> clug-talk mailing list
> [email protected]
> http://clug.ca/mailman/listinfo/clug-talk_clug.ca
> Mailing List Guidelines (http://clug.ca/ml_guidelines.php)
> **Please remove these lines when replying 


_______________________________________________
clug-talk mailing list
[email protected]
http://clug.ca/mailman/listinfo/clug-talk_clug.ca
Mailing List Guidelines (http://clug.ca/ml_guidelines.php)
**Please remove these lines when replying

Reply via email to