Archives
 
 
 
  Special
 
 
 
  About Us
 
 
 

Newsletter
Free E-mail Newsletter from BYTE.com

 
    
           
Visit the home page Browse the four-year online archive Download platform-neutral CPU/FPU benchmarks Find information for advertisers, authors, vendors, subscribers Request free information on products written about or advertised in BYTE Submit a press release, or scan recent announcements Talk with BYTE's staff and readers about products and technologies

ArticlesHow Error Correction Works


September 1995 / BYTE Lab Product Report / Best Overall Disk Arrays / How Error Correction Works

RAID 5 uses a technique that (1) writes a block of data across several disks (i.e., striping), (2) calculates a code from this data and stores the code on another disk (i.e., parity), and (3) in the event of a single-disk failure, uses the data on the working drives and the calculated code to "interpolate" what the missing data should be (i.e., rebuilding). A RAID 5 array "rotates" data and parity among all the drives on the array, in contrast with RAID 3, which stores all calculated parity values on one particular drive. The following is a simplified explanation of how RAID 5 calculates ECCs (error-correction codes).

Say, for example, that you have a five-drive array on which you intend to store four values: The numbers 172, 106, 240, and 156. For the purpose of this example, the RAID controller stores the value 172 as the binary number 10101100 on disk 1 of the array, the value 106 as the binary number 01101010 on disk 2, and so on as shown in the table "Error Detection: Bit by Bit" . When our four values have been written to disks 1 through 4, the RAID controller examines the sum of each bit position. If the sum of the numbers of bit position x on disks 1 through 4 is an odd number, then the value of that bit position on disk 5 is assigned a 1; if the sum is an even number, the bit position on disk 5 is assigned a 0.

Now assume that disk 2 fails. The RAID controller can no longer see the value 0 at bit 7 on disk 2. However, the controller knows that its value can be only a 0 or a 1. And as disks 1, 3, 4, and 5 are still operating, the controller can perform the following calculation: 1 + ? + 1 + 1 = an odd number. Since 1 + (0) + 1 + 1 = an odd number (3), the missing value on disk 2 must be 0. The RAID controller then performs the same calculation for the remaining bit positions. In this way, data missing due to a drive failure is rebuilt.


Error Detection: Bit by Bit

A RAID controller examines the sum of each bit position to assign an
even or an odd number to disk 5. If a disk fails, it assigns a 0 or a
1 to the missing value and performs a simple calculation. It repeats
this process across each bit position, rebuilding the data as it goes.

      CONTENTS
      ON DISK: BIT 7  BIT 6  BIT 5  BIT 4  BIT 3  BIT 2  BIT 1  BIT 0
Disk 1  172     1      0      1      0      1      1      0      0
Disk 2  106     0      1      1      0      1      0      1      0
Disk 3  240     1      1      1      1      0      0      0      0
Disk 4  156     1      0      1      1      1      1      0      0

Sum            odd    even   even   even   odd    even   odd    even
Disk 5 (parity) 1      0      0      0
      1      0      1      0


Up to the BYTE Lab Product Report section contentsGo to previous article: Best Overall Disk ArraysGo to next article: Best for Database ServersSearchSend a comment on this articleSubscribe to BYTE or BYTE on CD-ROM  
Flexible C++
Matthew Wilson
My approach to software engineering is far more pragmatic than it is theoretical--and no language better exemplifies this than C++.

more...

BYTE Digest

BYTE Digest editors every month analyze and evaluate the best articles from Information Week, EE Times, Dr. Dobb's Journal, Network Computing, Sys Admin, and dozens of other CMP publications—bringing you critical news and information about wireless communication, computer security, software development, embedded systems, and more!

Find out more

BYTE.com Store

BYTE CD-ROM
NOW, on one CD-ROM, you can instantly access more than 8 years of BYTE.
 
The Best of BYTE Volume 1: Programming Languages
The Best of BYTE
Volume 1: Programming Languages
In this issue of Best of BYTE, we bring together some of the leading programming language designers and implementors...

Copyright © 2005 CMP Media LLC, Privacy Policy, Your California Privacy rights, Terms of Service
Site comments: webmaster@byte.com
SDMG Web Sites: BYTE.com, C/C++ Users Journal, Dr. Dobb's Journal, MSDN Magazine, New Architect, SD Expo, SD Magazine, Sys Admin, The Perl Journal, UnixReview.com, Windows Developer Network