[Sussex] Debian and Software RAID and hello

Paul Tansom paul at aptanet.com
Mon Sep 5 22:57:02 UTC 2005


Al Bennett wrote:
> Anyway, I have a project to be keeping me busy with in the next weekish
> (after building a Windows XP box (the money's ok)).  I need to build a
> cheap and Linuxful small business type server.  I've ordered the bits
> (which I'm hoping are all vaguely compatible), and stuff should arrive
> tomorrow (it is Ebuyer though...).  I've ordered two 120Gb SATA disks
> which I'm hoping to make into a RAID mirror.  I thought there might be
> some more useful documentation on Raid available considering it's
> popularity but I can't really get straight answers to anything related
> to it!
> 
> I hoping to stick Sarge on this and have it all just work, but I'm
> pretty sure it's not that simple...

Oh yes it is - well, it can be :) With the old Debian stable there were
two options afaik, either compile a new kernel with RAID support and
juggle the partitions around afterwards, or use an initrd image created
with the necessary modules. Both of these needed an install and then
some playing around (to be honest I only ever did the recompile option
which went straightforwardly enough).

With the new stable it works like a dream - just partition the disks
suitably and create your RAID 1 mirrored drives during the install
that's about it :) You need to make sure that the partitions match on
both drives and that the partition type is "Linux RAID autodetect" (FD),
then create the RAID pairings and set the mount points. Not a huge
amount more than a standard install. (I really must write this up for
the Wiki - erm, thinking HantsLUG here, sorry not visited the SLUG one
to poke around really! Time isn't on my side atm though).

> The mobo is a GA-8IG1000MK with an Intel 82801EB southbridge, which may
> or may not include some form of RAID (I'm a bit baffled), either way I'm
> happy to use software raid on JBOD (I'm picking up the lingo!).

OK, here's the proviso - hardware. I've not actually messed around with
SATA disks under any OS yet. So long as you can get them recognised by
the installer (I've no idea whether the Debian one does or not) it
should be straightforward as detailed above.

> Now, in the reading up I've been doing there seems to be this kernel
> stuff called 'md' and a user space control thing mdadm, however that all
> seems to be a bit old hat.  I read something about it not taking care of
> bad blocks or something.

My first work with RAID I avoided mdadm because it didn't seem as easy
to work with as raidtools (I like a nice config file that I can edit to
configure things!). With the new Debian installer I ended up with mdadm,
and it isn't as bad as it first seemed. I will no doubt get used to it,
and at some point will look to streamline a couple of old systems by
seeing if I can switch from raidtools to mdadm on a live box (tested
off-line first and with backups of course!).

<snip>
> Also, whichever route I go, how do I handle booting from an array, and
> handling a failed disk (for booting)?

Booting is handled by the installer. I've not checked but I'm guessing
that it loads the modules into the initrd so that it can then mount the
root file system from the RAID device (/dev/md0 in my case). All this is
handled by the installer. On the failed disk bit, avoid the JBOD options
(nasty imho) and go for RAID 1 (2 drives acting as a mirrored pair).
This way you can mount the file system on either as a standard ext3 (or
whatever - that's the one I use currently) partition to recover any
data. In practice if a disk fails it is simply a case of powering down,
pulling the failed drive, booting, rebuilding the partition table
(sfdisk is handy for this for identical drives since you can pipe the
partition table from the working one to the new one - carefully!),
reboot (sorry, has to be done) and then doing a hot add of the new
drives partitions into the array and waiting for it to rebuild (takes a
lot longer for the active root partition!).

-- 
Paul Tansom | Aptanet Ltd. | http://www.aptanet.com/




More information about the Sussex mailing list