]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Update udev rules for hotplug support.
authorNeilBrown <neilb@suse.de>
Wed, 30 Jun 2010 06:55:17 +0000 (16:55 +1000)
committerNeilBrown <neilb@suse.de>
Wed, 30 Jun 2010 06:55:17 +0000 (16:55 +1000)
- split the rules for handling components of array to be clearly
  separate from rules for handling the arrays themselves.
- add call to "-If" when removing a device
- uncomment the --incremental call when adding a device.

Signed-off-by: NeilBrown <neilb@suse.de>
udev-md-raid.rules

index c9a4f0ed171445b4844ab932263bc2c4f002e43e..da52058faff86a0192834fff7b514ff24032721c 100644 (file)
@@ -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