Parity data in a RAID environment is calculated using the BooleanXOR function. For example,here is a simple RAID 4 three-disk setup consisting of two drives that hold 8 bits of data eachand a third drive that will be used to hold parity data.Drive 1:
01101101
Drive 2:
11010100
To calculate parity data for the two drives, an XOR is performed on their data.i.e.
01101101
XOR
11010100
=
10111001
The resulting parity data,
10111001
, is then stored on Drive 3, the dedicated parity drive.Should any of the three drives fail, the contents of the failed drive can be reconstructed on areplacement (or "hot spare") drive by subjecting the data from the remaining drives to the sameXOR operation. If Drive 2 were to fail, its data could be rebuilt using the XOR results of thecontents of the two remaining drives, Drive 3 and Drive 1:Drive 3:
10111001
Drive 1:
01101101
i.e.
10111001
XOR
01101101
=
11010100
The result of that XOR calculation yields Drive 2's contents.
11010100
is then stored on Drive 2,fully repairing the array. This same XOR concept applies similarly to larger arrays, using anynumber of disks. In the case of a RAID 3 array of 12 drives, 11 drives participate in the XOR calculation shown above and yield a value that is then stored on the dedicated parity drive.
Organization
Organizing disks into a redundant array decreases the usable storage capacity. For instance, a 2-disk RAID 1 array loses half of the total capacity that would have otherwise been available using both disks independently, and a RAID 5 array with several disks loses the capacity of one disk.Other types of RAID arrays are arranged, for example, so that they are faster to write to and readfrom than a single disk.There are various combinations of these approaches giving different trade-offs of protectionagainst data loss, capacity, and speed. RAID levels 0, 1, and 5 are the most commonly found,and cover most requirements.
Leave a Comment