Re: mdadm and automatic re-add / incremental mode with usb-disk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Montag 01 Dezember 2008 schrieb NeilBrown:
> On Sun, November 30, 2008 10:31 pm, Wilhelm Meier wrote:
> > Hi,
> >
> > I'm using debian etch with mdadm 2.5.6-9.
> >
> > I have a md-device /dev/md1000 with two usb-disks as raid1. The
> > array is assembled well if the system boots, if I unplug one of
> > the disks, the array goes to degraded. Thats all ok.
> >
> > If I re-plug the usb-disk, udev discovers the device fine, but
> > mdadm doesn't start the re-add to the md-array. I have to do this
> > but hand.
> >
> > Is there something missing to make this work automatically?
>
> You would need to put some magic in udev.
> Something in /etc/udev/rules.d would need to do something like
>  RUN+="/sbin/mdadm -I ..the..device.name"

Yes, I tried that and it works half-the-way: as I wrote in another 
posting, mdadm -I does not allow the -c configfile option. Because I 
use a different config for a special set of devices, mdadm -I does 
not know the uuid's of the arrays of this special config file and 
therefore creates a new array with a different naming scheme (and 
different major/minor dev-numbers) (see below).

>
> if the detected device was one that you want to be added to an
> array. I have tried this yet so I don't know the details of how to
> make it work.
>
> > I tried the mdm-2.6.2 from etch-backports too. Same effect.
> >
> > Here, if I try to use the --incremental mode, it constructs a new
> > (!) array /dev/md/d_1000  instead of adding it to /dev/md1000.
> > Thats strange to me.
>
> --incremental only works properly if the array was created by
> --incremental.  

Thats a point I don't understand. 
Should I use --increment instead of normal creation and 
later --assemble? 
Why is this different?
Can this work together, I mean: can I --assemble arrays (as most 
distros do that on boot) and later --incremental create/reconstruct 
other arrays?

> You might be able to make it work better by 
> running
>    mdadm -Ir
>
> first.  This recreates /var/run/mdadm/map.

-- 
Wilhelm
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux