[dm-devel] RAID5 support ?

Neil Brown neilb at suse.de
Thu Nov 3 10:07:52 UTC 2005


On Thursday November 3, alanh at fairlite.demon.co.uk wrote:
> > md doesn't work with partitions.  It works with devices which may be
> > partitions or may be the whole device.
> > I often make raid5 arrays out of a set of devices, none of them
> > partitioned. 
> 
> O.k. Can you explain to me how to do that and still boot from the md
> device ?

It depends on exactly what you mean by 'still boot from'...

If you mean, "Have to root filesystem on an md device", there are two
ways. 

1/ use a kernel parameter like:
     md=d0,/dev/hda,/dev/hdc root=/dev/md_d0p1

 This tells the kernel to assemble an md array from /dev/hda and
 /dev/hdc.  It will be /dev/md/d0 which is a partitionable array,
 so you can have normal partitioning. /dev/md/d0p1 /dev/md0/d0p2.
 Most of my servers I configure like this, with a raid1 pair on sda
 and sdb, partitioned into root, swap, and the rest.

 This works quite well for ide drives as the device names are stable.
 It is not so good for SCSI as device names can change if you pull a
 device out.  However using sda and sdb for the root device works ok.

2/ use an initrd or initfs image which contains code to find and
  assemble md/raid arrays. mdadm comes with a striped down
  'mdassemble' which does just this.
  It currently needs a config file in the initfs, but I'm working
  towards being able to have the important configuration information
  reliably in the raid superblock.


If you mean "Load the kernel image from an md device" (which is what
"boot from" really means to me), then it depends on your boot loader.
I have lilo configured to boot from a mirrored pair as above.  Booting
from a raid5 almost certainly requires bios support, but once the
kernel and initfs are loaded, md can take it from there (once it can
understand the metadata format).

Hope that helps,

NeilBrown





More information about the dm-devel mailing list