[CLUE-Tech] RAID-5

Jim Ockers ockers at ockers.net
Sun Oct 26 12:14:44 MST 2003


Roger,

> How do they do that?  Does something go in /var/log/messages?

With software RAID you can find out by looking at /proc/mdstat .

> > Since you have a
> > RAID-5, each drive contains enough parity information to lose one drive
> > and still 'know' what the data is, using it's brothers - it uses the rest
> > of the data to reconstruct the missing information.  The card will do it
> > on the fly, which is why you'll be operating slower than normal.  
> 
> I'm hung up on the math of this.  I have three 9G drives, one on each
> physical channel.  If they were all data there would be 27G.  `dmesg` shows:

Consider the XOR function.  It is useful for encryption, RAID, etc.

A XOR B = C
A XOR C = B
C XOR B = A

At least I think that's how it works.  In the case of encryption 
and the first example, A is the plaintext, B is the key, and C 
is the ciphertext.  You would transmit the ciphertext to some 
party who has the key, B.  They XOR the ciphertext C with the 
key B and thus recover the plaintext A.

In the case of RAID, I think you can XOR two data segments together 
(A and B) and get a third data segment (C).  You can then recover either 
A or B data by XORing it with C.

If you have a truly random one-time-pad encryption key scheme, and
the keys are known only to sender and receiver, the XOR function
will deliver unbreakable ciphertext.  You should experiment with
XOR and see how it works.  The Windows NT Calculator, in "Scientific"
mode, has an XOR button ("key") that you can use with binary
digits.  I had to personally try it a few times to make sure it
actually worked as advertised.  It's pretty neat.

I'm guessing that for RAID5 they call it parity but what the controller
actually uses for the math is XOR.

A word to the wise.  This is a side note not related to your question:

If you have any Dell systems with aacraid (Adaptec onboard RAID)
controllers YOU SHOULD NOT USE RAID5.  We have 20 or so Dell servers
and have had repeated array failures on almost all of the systems
when used in RAID5 mode.  We have never had any trouble with any 
RAID1 arrays on aacraid controllers.  If you have aacraid RAID5
arrays you should take immediate steps to migrate the array to a
RAID1 configuration, or else at least make frequent backups.

We've also had trouble with the Dell MegaRAID arrays in RAID5 mode,
on several servers.

The Linux kernel software-RAID5 is super.  However no RAID is com-
pletely trouble-free; we had a Linux software RAID1 array halt &
panic the kernel the other day.  We power cycled the box and it
came back up OK and the array started rebuilding.

Hope this helps,
Jim

-- 
Jim Ockers, P.Eng. (ockers at ockers.net)
Contact info: please see http://www.ockers.net/



More information about the clue-tech mailing list