Request Help

Request Help

We would love to hear from you! Please fill out this form or call us
Call: 866-438-6932

SNAP RAID Recovery Part II Drive Set Definition

One of the many attributes of a RAID 5 that make it popular is that if a drive goes down in the array the RAID will remain functional.  In such a case the following events should occur.  An alarm should sound.  An alarm that would wake the dead.  An alarm that would make raking your fingernails across a chalkboard sound pleasurable by comparison. An alarm that by all known standards would be considered inhumane in most modern cultures.  This alarm will sound incessantly, unwavering in its pursuit to be heard until the technician hits it with a keyboard, kicks the server plug out, or kills a chicken and offers a sacrifice to the alarm gods.  In other words, you can’t miss this alarm, and if you do, see the reference to ‘wake the dead’.  

Secondly, an email will be sent, advising you that the four years worth of data that you thought was being backed up, but you discovered two days ago wasn’t,  is now in peril of being lost into the never never land of lost bits and socks that inexplicably disappear from the dryer.  Yes, your job, your home, your marriage, all will be lost unless you heed the email warning and immediately shut down the server, to the chagrin of 427 end users who are reading about American Idol. HAH! Welcome to the party pal! (Quote circa 1976:  Bruce Willis: Die Hard)

Keep in mind that although there are many RAID cards, as well as on-board RAID interfaces that perform these functions, your particular RAID firmware, as well as its current configuration may not.

The reason that a RAID 5 can have a drive go down and still run is the mathematics of XORing (eXclusive ORing) the data.  This method for keeping the data relatively safe in a RAID 5 is called parity. It is a manipulation of bits in each byte of data.  For the unwashed a byte is eight bits. 
       
In order to under stand XORing it is imperative that you understand the XOR truth table.  Figure 1 is the truth table for eXclusive ORing.

                                                                                                                                                                                 
                                                                                     figure-1.jpg

                                                                                           Figure 1
        Figure 2 is an example of XORing and how it relates to a four drive RAID 5 and the parity.
       

figure-2.jpg

                                                                                           Figure 2

The data is arranged thusly:
‘R’ is the ASCII letter
52h is the ASCII hexadecimal value of ‘R’
0101 0010 is the ASCII binary representation of the letter.
As you can see each letter has is set up the same way.

For illustration purposes the following can be assumed.  Each line is considered a single byte of a stripe as conveyed by Figure 3.  If we take the ‘R’, and the ‘F’, and the ‘T’, and XOR them together, we get the value in D4, where each bit, of each byte is individually XORed across the stripe. 

 figure-3.jpg

                                                                                         Figure 3

Using Figure 4 as a base, and the truth tables we can see the following:

 

  1   2       3   4

L1:

0

XOR

0 = 0

XOR

0 = 0

L2:

1

XOR

1 = 0

XOR

1 = 1

L3:

0

XOR

0 = 0

XOR

0 = 0

L4:

1

XOR

0 = 1

XOR

1 = 0

L5:

0

XOR

0 = 0

XOR

0 = 0

L6:

0

XOR

1 = 1

XOR

1 = 0

L7:

1

XOR

1 = 0

XOR

0 = 0

L8:

0

XOR

0 = 0

XOR

0 = 0

Figure 4

 Now, lets say we lose D2 (drive two) in the array.  The following is how the RAID card firmware handles it.

  1   3       4   2

L1:

0

XOR

0 = 0

XOR

0 = 0

L2:

1

XOR

1 = 0

XOR

1 = 1

L3:

0

XOR

0 = 0

XOR

0 = 0

L4:

1

XOR

1 = 0

XOR

0 = 0

L5:

0

XOR

0 = 0

XOR

0 = 0

L6:

0

XOR

1 = 1

XOR

0 = 1

L7:

1

XOR

0 = 1

XOR

0 = 1

L8:

0

XOR

0 = 0

XOR

0 = 1

Figure 5

We have built drive 2 on the fly.  We do not need to know the data since we can use the XOR truth table and the remaining three drives data to calculate the value of drive two. In the above example the process was illustrated for one byte across one stripe on a four drive array.  All of these calculations are done in an instant on a stripe by stripe basis.  The full stripe is recalculated for every write, and if a drive is out of the array for every read of the down drive.  With all these calculations you would think it would slow down the processing. To a degree, it does, however, bus I/O is infinitely slower than any XOR math a CPU may have to perform.  A way to emphasize this point is imagine you are standing on a bridge.  Below you is a river.  Each byte of data is a boat that passes under the bridge.  The boat travels from the hard drive, down the river, to memory, and to the CPU.  As one boat passes, you wait for the next boat.  The next boat will not pass for one hundred years.  The CPU is in a perpetual wait state.  It is always waiting for data to process.  So, if you want to speed up your PC, by high speed I/O smart boards that can RAID, on a high speed bus. 

To be continued…

Learn more about RAID Data Recovery

5 Responses to “SNAP RAID Recovery Part II Drive Set Definition”

  1. Davedata99 February 19, 2008 5:33 pm #

    Great peice covering RAID 5 on disk structures.

  2. ctandf.net April 26, 2013 8:07 am #

    Do you mind if I quote a few of your articles as long
    as I provide credit and sources back to your weblog? My blog
    is in the exact same area of interest as yours and my users would truly
    benefit from some of the information you provide here. Please let me know if this alright with you.

    Thank you!

Trackbacks/Pingbacks

  1. RAID Configuration and Parity Check | Hard Drive Recovery Resources From DTI Data Recovery - May 8, 2008

    […] Next, in order to start the parity test click on the menu item “Diagnostics”. Doing so will reveal the menu item “Raid Five Parity Check”. Click on that menu item and the diagnostic will begin. This function will check the RAID five on a stripe by stripe basis and validate the parity using XOR mathematics. […]

  2. RAID Configuration and Parity Check | Raid Data Recovery - July 2, 2010

    […] Next, in order to start the parity test click on the menu item “Diagnostics”. Doing so will reveal the menu item “Raid Five Parity Check”. Click on that menu item and the diagnostic will start. This function will check the RAID five on a stripe by stripe basis and validate the parity using XOR mathematics. […]

Leave a Reply