From: NeilBrown Date: Wed, 11 Dec 2013 01:29:22 +0000 (+1100) Subject: udev rules: try "mdadm -I" on "change" events. X-Git-Tag: mdadm-3.3.1~85 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=25392f5fc59f96fb766ecb5617d5276f8c87d489;p=thirdparty%2Fmdadm.git udev rules: try "mdadm -I" on "change" events. We need to attempt "mdadm -I" on "change" events as well as "add" events, as the "change" make make a device ready to be part of an array. This is particularly important for stacked md devices. When the member devices are "add"ed they don't have any content visible yet. That doesn't happen until a "change". Idea taken from Fedora udev file. Signed-off-by: NeilBrown --- diff --git a/udev-md-raid-assembly.rules b/udev-md-raid-assembly.rules index 22adc1db..824e7a9b 100644 --- a/udev-md-raid-assembly.rules +++ b/udev-md-raid-assembly.rules @@ -27,8 +27,8 @@ LABEL="md_inc" # remember you can limit what gets auto/incrementally assembled by # mdadm.conf(5)'s 'AUTO' and selectively whitelist using 'ARRAY' -ACTION=="add", IMPORT{program}="/sbin/mdadm --incremental --export $devnode --offroot ${DEVLINKS}" -ACTION=="add", ENV{MD_STARTED}=="*unsafe*", ENV{MD_FOREIGN}=="no", ENV{SYSTEMD_WANTS}+="mdadm-last-resort@$env{MD_DEVICE}.timer" +ACTION=="add|change", IMPORT{program}="/sbin/mdadm --incremental --export $devnode --offroot ${DEVLINKS}" +ACTION=="add|change", ENV{MD_STARTED}=="*unsafe*", ENV{MD_FOREIGN}=="no", ENV{SYSTEMD_WANTS}+="mdadm-last-resort@$env{MD_DEVICE}.timer" ACTION=="remove", ENV{ID_PATH}=="?*", RUN+="/sbin/mdadm -If $name --path $env{ID_PATH}" ACTION=="remove", ENV{ID_PATH}!="?*", RUN+="/sbin/mdadm -If $name"