Re: [Hampshire] Autodetecting software RAID devices

Top Page

Reply to this message
Author: Nick Chalk
Date:  
To: hampshire
Subject: Re: [Hampshire] Autodetecting software RAID devices
Chris Dennis <cgdennis@???> wrote:
> I did something similar recently on a test
> server as part of a learning exercise. Except
> that I can't answer your question about
> partitioned RAID-5 because I created a single
> partition and then used LVM to divvy that up for
> /root, /home, etc.


Yes, that's the way the Debian installer wants to
do it. I want to avoid LVM if I can, as it's
another layer of indirection, and the server I'm
building doesn't have a lot of horsepower.

> (You're right that neither LILO nor Grub can
> handle RAID5


LILO can't handle partitionable RAID-1 either - or
it refuses to, at least.

> the installer didn't tell me that, and I
> struggled for a while to work out why it
> wouldn't boot)


The partition manager section of Debian's
installer needs a little work, I think. It was
actually easier to create the RAID arrays by hand,
using mdadm, than it was to use the installer.


I do have the system booting cleanly now, though.

Firstly, I tried building a kernel with md and
RAID drivers compiled in. I then added "raid=
partitionable" to the kernel command line.

This worked - but didn't do what I wanted. It
seems that the RAID superblock doesn't store info
on whether an array is partitionable or not, so
the kernel autodetect needs to be told how to
treat it. Using that command line option causes the
kernel to assume all arrays are partionable - so,
in my case, I ended up with /dev/md/d0 and
/dev/md/d1, rather than the /dev/md/0 and
/dev/md/d1 I wanted.

Re-reading the md documentation in the kernel
sources, I found that you can explicitly tell the
kernel what to create. You need to disable auto-
detection, then use the "md=" option to describe
the arrays. The solution for me was to add the
following to the kernel command line:

raid=noautodetect
md=0,/dev/sda1,/dev/sdb1,/dev/sdc1,/dev/sdd1
md=d1,/dev/sda2,/dev/sdb2,/dev/sdc2,/dev/sdd2

Each "md=" option describes one array. The first
field is the md device - adding an initial "d"
tells the kernel that it's a partitionable array.
You then just list the devices that make up that
array.

The "noautodetect" is essential, or that runs
first and uses up the array devices before the
manual config is parsed.

Nick.

--
Nick Chalk ................. once a Radio Designer
Confidence is failing to understand the problem.