Follow us on Twitter! Subscribe to us on Youtube! Fan us on Facebook! Follow us on Google+ Connect with us on LinkedIn
Kurt R
Mobile Computer Wizard
I have been in the computer services field since 2003 and have used a handful of high level data recovery companies. I have found Gillware to have a great staff both on the technical side and the customer service side. Their recovery's have worked out the handful of times we had to send something their way.
Gillware, Inc. Top Ten Reviews - Number 1 Data Recovery Company
Gillware, Inc. BBB Business Review

Sales Hours
24 / 7 / 365

Customer Service Hours
Mon-Fri: 8am-5pm
(Central Time)

Toll-Free: 877.624.7206
Local: 608 237 8780
Fax: 608 237 2520

Gillware Inc.
10 Terrace Court
Suite 103
Madison, WI 53718

Email:


RAID 5

RAID Setup and Data Recovery Tips from Gillware's CEO, Brian Gill

To assist in setting up your RAID-5 correctly and to help when you need RAID data recovery, Brian has written a couple of great guides.

RAID-5 General Setup Tips from a Data Recovery Expert (pdf)

RAID-5 Failure Common Sense Tips (pdf)

Want to know more? Visit Brian's blog or connect with him on LinkedIn

Single level RAID 5 is a RAID configuration that combines striping with redundancy. The striping portion of RAID 5 is very similar that of RAID 0, but the redundancy portion is quite different from RAID 1. RAID 5 systems create redundancy by calculating parity blocks and distributing these parity blocks among all disks in the array. A minimum of three disks is required for a RAID 5 system. The maximum number of disks is limited by the RAID controller. RAID 5 systems are very popular since they have the performance benefits of striping with the added security of redundancy. Even better is that the storage efficiency (the ratio of the RAID system capacity to the total capacity of all individual disks) is much higher than that of RAID 1 (which is 50%).

Before getting into the details of how data is stored in a RAID 5 system, let's take a look at parity and how exactly redundant storage efficiency can exceed 50%. Calculating parity is nothing more than applying the XOR binary operator to the data stored on the disks. XOR stands for "exclusive OR" meaning that the output will equal 1 if and only if the two bits being XOR'd are different. The following is a truth table for the XOR function that illustrates this clearly.

A B A XOR B
0 0 0
0 1 1
1 0 1
1 1 0

The XOR function has a very unique property that lends itself to efficient data redundancy. If XOR is applied twice in a row, it negates itself. So if we have A and XOR it twice with B, we get A as the result:

A XOR B XOR B = A

The following example will demonstrate how to get 80% redundant storage efficiency out of an array of 5 disks. For 80% efficiency, we must store real data on 4 disks and use only 1 disk for redundancy. Let's store the string "RAID" on our 4 non-redundant disks.

Here's how our string is represented in binary:

Text in file R A I D
ASCII code 5 2 4 1 4 9 4 4
Raw binary data 0 1 0 1 0 0 1 0 0 1 0 0 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 0 0 1 0 0

Here is our string in our disk array at 80% efficiency with the redundancy portion (parity) taking just 20%. The data on Disk E is the parity and is calculated by applying XOR to all the other data like this: E = A XOR B XOR C XOR D

Disk A Disk B Disk C Disk D Disk E
0
1
0
1
0
0
1
0
0
1
0
0
0
0
0
1
0
1
0
0
1
0
0
1
0
1
0
0
0
1
0
0
0
0
0
1
1
1
1
0
R A I D PARITY
Real Data

Now say that Disk C fails and we're left with the data from Disk A, B, D, and E. We can rebuild the data from Disk C by applying XOR to the data on the remaining disks. Since the data on Disk E = A XOR B XOR C XOR D, applying XOR to all remaining data reduces to

(A XOR B XOR C XOR D) XOR A XOR B XOR D

Now, reformat to

(A XOR A) XOR (B XOR B) XOR (D XOR D) XOR C Since XOR is applied twice in a row to the data from A, B, and D, all we are left with at the end is C. This is of course the data from our failed disk representing the letter "I". The following chart illustrates the calculation:

Disk A Disk B Disk D Disk E A xor B xor D xor E = C
0
1
0
1
0
0
1
0
0
1
0
0
0
0
0
1
0
1
0
0
0
1
0
0
0
0
0
1
1
1
1
0
0
1
0
0
1
0
0
1
R A D PARITY I

Raid 5 by Example

Raid 5 arrays are built for performance and redundancy. Instead of reading/writing 1 file to 1 disk, RAID 5 arrays read/write 1 file to multiple disks in parallel. They also calculate a parity block when writing so that data can be recovered if a disk fails. The following is a simple example illustrating how RAID 5 works.

Say we have a text file that consists of three characters "ABC" and a RAID 5 array of three disks with a stripe/block size of four bits (equal to one half of a character).

Here's a data representation of our text file:

Text in file A B C
ASCII code 4 1 4 2 4 3
Raw binary data 0 1 0 0 0 0 0 1 0 1 0 0 0 0 1 0 0 1 0 0 0 0 1 1

Here's what happens when we save the file:

The first block of four bits (first half of letter A) is written to Disk 1 and the second block of four bits (second half of letter A) is written to Disk 2. Disk 3 is parity for Block 0. Next, the third block (first half of letter B) is written to Disk 1 and the fourth block (second half of letter B) is written to Disk 3. Disk 2 is parity for Block 1. Finally, the fifth block (first half of letter C) is written to Disk 2 and the sixth block (second half of letter C) is written to Disk 3. Disk 1 is parity for Block 2. Notice how the parity is on a different disk for every block. The order of the parity is called the parity order, parity map, or parity rotation. In this example, the parity order is backwards (Disk 3, Disk 2, Disk 1).

   Disk 1 Disk 2 Disk 3
Block 0 0
1
0
0
0
0
0
1
0
1
0
1
Block 1 0
1
0
0
0
1
1
0
0
0
1
0
Block 2 0
1
1
1
0
1
0
0
0
0
1
1

*Pink data represents the parity calculation for the block

Now consider what happens when Disk 3 fails and all we have left is Disk 1 and Disk 2. Continue reading about RAID Arrays at one of our informational pages listed below.

DISK 1 0
1
0
0
D
0
1
0
0
0
1
1
1
q
DISK 2 0
0
0
1
0
1
1
0
d
0
1
0
0

As you can see, the raw data from Disk 1 and Disk 2 represents the string "Dqd" which is complete garbage. Our data should be the string "ABC". To recover the data from the two remaining disks, we must properly reassemble the stripes and use the XOR operator to recalculate the lost data from Disk 3. The following chart illustrates how to properly reassemble the RAID 5 array:

Disk 1 Block 0 0
1
0
0
A
Disk 2 Block 0 0
0
0
1
Disk 1 Block 1 0
1
0
0
B
(Disk 1 Block 1) xor (Disk 2 Block 1) 0
0
1
0
Disk 2 Block 2 0
1
0
0
C
(Disk 1 Block 2) xor (Disk 2 Block 2) 0
0
1
1

As you can see, the RAID 5 reconstruction process is quite complex. The reconstruction must be done exactly right or the resulting data will be garbage.

Gillware looks forward to helping you with your multi-level RAID 5 reconstruction needs. To place an order please call our 800 number.

RAID Setup and Data Recovery Tips from Gillware's CEO, Brian Gill

To assist in setting up your RAID-5 correctly and to help when you need RAID data recovery, Brian has written a couple of great guides.

RAID-5 General Setup Tips from a Data Recovery Expert (pdf)

RAID-5 Failure Common Sense Tips (pdf)

Want to know more? Visit Brian's blog or connect with him on LinkedIn

Home    Service Form     Engineering     RAID Data Recovery     FAQ     Testimonials     Privacy     About Gillware

Copyright © 2004-2014 Gillware Incorporated. All rights reserved. 877.624.7206