how to setup linux software RAID 10

Gavin McCullagh gmccullagh at gmail.com
Fri Oct 26 11:08:02 BST 2007


Hi,

On Fri, 26 Oct 2007, Krsnendu dasa wrote:

> Does anyone know any of any disadvantages with raid 10?

Everything has _some_ disadvantage I guess, with Raid 10 it might be cost,
compared with RAID5.  However, it brings greater security.  This is worth
reading:

	http://www.miracleas.com/BAARF/RAID5_versus_RAID10.txt

> I am not convinced though. It seems like a waste to have 2 extra
> drives and not use them to boost performance.

It very much depends on the critical importance and quantity of your data
and uptime.  You may have disk failures so you have to assume that you
will.  The question is, how likely will you lose data and uptime and how
much are you willing to spend to avoid those risks.  RAID1 leaves all your
data on two disks in a really simple recoverable way.

> We have 4 identical SATA 320 GB Hard disks and we were thinking of
> using Linux software RAID 10. We actually did it on a trial system and
> it seemed to work fine.

Whether to use software or hardware RAID is a different question.  My own
opinion on this is constantly in flux and I know I have on occasion
preferred software raid.  What follows is my understanding of the
situation:

----------------------------------------------------------------------
There are various circumstances (usually centering around an unclean
shutdown) where a software RAID array may get corrupted but a hardware RAID
array wouldn't.  

With software RAID, when you write a file, the program hands it to the
filesystem which writes it to the disk device.  With software RAID that'll
be an MD disk device (a "virtual disk) which will then write the changes to
several disks (how many depends on the setup, but at least 2).  Consider
what happens with RAID1 when a power cut happens after only one disk has
written.  The two disks are now different and there's no easy way for MD to
know which is the correct one -- you'll probably get a random choice back.
With RAID5, this can be even more severe (if MD finds an inconsistency in
RAID5 it just updates the parity).

With cheap hardware raid the situation seems to be similar actually, but
most more expensive hardware raid cards you will have some amount of RAM on
the RAID card and a battery.  When the filesystem writes, it hands the
changes to the RAID card which puts them in RAM and then proceeds to write
them to the disks.  Should it get interrupted by power failure, the battery
will allow the data to be stored in RAM.  When the system powers back up
again, those changes will be written.  In this way, a (decent) hardware
raid array's consistency is protected to a greater degree.  The filesystem
consistency is a separate issue of course :-)

It's conceivable that software raid could have a similar "journaling"
system (writing data to an intermediate location, then to disks) but I
don't think they actually do.

The downside of hardware raid in my experience is that it adds extra layers
of complexity compared to MD.  For a start the vendor support is very
mixed.  You want to have software to monitor and manage your RAID array
from within linux (eg. so you get a report when a disk dies) and very often
that reporting software is flakey or non-existent on linux.  I've also come
across issues with incompatibility between hardware raid firmware versions
and linux kernel drivers which have caused horribly complex issues.

	http://mail.linux.ie/pipermail/ilug/2006-May/thread.html#87907
	http://jeremy.zawodny.com/blog/archives/008696.html

----------------------------------------------------------------------

Gavin




More information about the edubuntu-users mailing list