Re: [Patch mdadm] Add hot-unplug support to mdadm

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

 



On 04/06/2010 10:02 PM, Doug Ledford wrote:
> On 04/06/2010 09:30 PM, Neil Brown wrote:
>> On Mon, 05 Apr 2010 12:40:41 -0400
>> Doug Ledford <dledford@xxxxxxxxxx> wrote:
>>   would it help do you think to support e.g.
>>
>>     mdadm -If --devnum $major:$minor $name
> 
> As I recall, on a remove event the major minor is already gone too (but
> I could be wrong, the machine has since been blown away and reinstalled
> and the file I had the whole env during a remove event stored off in is
> gone with it).
> 
> And I would be careful about using $env{DEVNAME}, in fact I'm removing
> usage of it in my local rules files right now because I've found it is
> inconsistent (part of the time it includes /dev/ and part of the time it
> doesn't, where as $tempnode is consistent).

OK, so to expand on this a bit further.  $env{DEVNAME} sometimes refers
to devices via a full path (aka, /dev/sda1), and sometimes by just the
last part of the path (aka, md0).  I found this when creating a rule to
do incremental assembly on containers during late udev startup (I need
this because the initramfs created by dracut *only* starts necessary
arrays, and if you have a additional arrays in a container, then the
change event generated during udev startup can be used to trigger
incremental assembly of those additional arrays, but $env{DEVNAME} will
just be md0 or whatever, not a full path name).  So, I switched
everything to $tempnode as it always points to a device special file.
Except when doing removal events, in which case $tempnode doesn't exist
because there is no node to point to.  So, long story short, you're best
off to use $tempnode on any device add|change events, and $env{DEVNAME}
on remove events.


-- 
Doug Ledford <dledford@xxxxxxxxxx>
              GPG KeyID: CFBFF194
	      http://people.redhat.com/dledford

Infiniband specific RPMs available at
	      http://people.redhat.com/dledford/Infiniband

Attachment: signature.asc
Description: OpenPGP digital signature


[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