Re: RAID superblock confusion

From: Neil Brown (neilb@cse.unsw.edu.au)
Date: Wed Apr 10 2002 - 20:38:19 EST


On Wednesday April 10, rgooch@ras.ucalgary.ca wrote:
>
> The device is set up (i.e. SCSI host driver is loaded) long before I
> do raidstart /dev/md/0

raidstart simply does not and cannot work reliably when your device
numbers change around. It takes the first device listed in
/etc/raidtab and gives it to the kernel.
The kernel reads the superblock, finds some device numbers and tries
to attach those devices. If device number have changed, you loose.

autodetect is the other alternative. However, as has been mentioned,
it does not and cannot work with md as a module. This is because
devices can only be register for autodetection after md.o is loaded,
and autodetection is done at the time that md is loaded. So
autodetection can only work if the device driver and md are loaded at
simultaneously. i.e. they are compiled into the kernel.

I use and recommend mdadm.
  http://www.cse.unsw.edu.au/~neilb/source/mdadm/
(I hope to release a 1.0 in the next week or so).

With mdadm you can assemble devices whenever you like based on uuid in
the superblock.

Assuming you use devfs :-)
Create /etc/mdadm.conf containing:

  DEVICE /dev/scsi/*/*/*/*/part*

[[ you should be able to say

   DEVICE /dev/discs/*/part*

  but glob(3) gets confused by that :-(
]]

and run

   mdadm -Es >> /etc/mdadm.conf

Then edit /etc/mdadm.conf removing bits that are wrong, and changing
bits that need changing. The mdadm.conf.5 to understand what should
be there.

You will need to:
   get rid of the "devices=" parts
   Make sure no extra arrays were found.

Once you have done this, then

  mdadm -As

in your startup scripts will assemble your arrays.

Make sure you use mdadm-0.8.2. I found a little bug in 0.8.1 as I was
testing this example.

NeilBrown
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Apr 15 2002 - 22:00:17 EST