X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=udev-md-raid.rules;h=f9607f37cd68e370fcd17702993dca8428f348cd;hb=69b2fcc5bb7ee6608790513042110a15d36a21bc;hp=300a754dc934dbbd271fa13736438ef0da26e60a;hpb=8320878543bb5e49b5acb24fa919ff11be485c61;p=thirdparty%2Fmdadm.git diff --git a/udev-md-raid.rules b/udev-md-raid.rules index 300a754d..f9607f37 100644 --- a/udev-md-raid.rules +++ b/udev-md-raid.rules @@ -1,13 +1,13 @@ # do not edit this file, it will be overwritten on update SUBSYSTEM!="block", GOTO="md_end" -ACTION!="add|change", GOTO="md_end" -ACTION=="change", GOTO="md_no_incr" -# import data from a raid member and activate it -#ENV{ID_FS_TYPE}=="linux_raid_member", IMPORT{program}="/sbin/mdadm --examine --export $tempnode", RUN+="/sbin/mdadm --incremental $env{DEVNAME}" -# import data from a raid set -LABEL="md_no_incr" +# handle potential components of arrays +ENV{ID_FS_TYPE}=="linux_raid_member", ACTION=="remove", RUN+="/sbin/mdadm -If $name" +ENV{ID_FS_TYPE}=="linux_raid_member", ACTION=="add", RUN+="/sbin/mdadm --incremental $env{DEVNAME}" + +# handle md arrays +ACTION!="add|change", GOTO="md_end" KERNEL!="md*", GOTO="md_end" # partitions have no md/{array_state,metadata_version}, but should not @@ -30,8 +30,9 @@ ENV{DEVTYPE}=="partition", ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env ENV{DEVTYPE}=="partition", ENV{MD_DEVNAME}=="*[^0-9]", SYMLINK+="md/$env{MD_DEVNAME}%n" ENV{DEVTYPE}=="partition", ENV{MD_DEVNAME}=="*[0-9]", SYMLINK+="md/$env{MD_DEVNAME}p%n" -IMPORT{program}="vol_id --export $tempnode" +IMPORT{program}="/sbin/blkid -o udev -p $tempnode" OPTIONS+="link_priority=100" +OPTIONS+="watch" ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}"