69-md-clustered-confirm-device.rules 846 B

123456789101112131415161718192021
  1. # do not edit this file, it will be overwritten on update
  2. SUBSYSTEM!="block", GOTO="clustermd_end"
  3. # handle md arrays
  4. KERNEL!="md*", GOTO="clustermd_end"
  5. ENV{DEVTYPE}!="disk", GOTO="clustermd_end"
  6. ACTION!="change", GOTO="clustermd_end"
  7. ENV{EVENT}!="ADD_DEVICE", GOTO="clustermd_end"
  8. ENV{DEVICE_UUID}!="?*", GOTO="clustermd_end"
  9. ENV{RAID_DISK}!="?*", GOTO="clustermd_end"
  10. # Based on the received UUID, node confirms the device if
  11. # it is found by blkid, otherwise the node reports it is
  12. # missing.
  13. PROGRAM="/sbin/blkid -o device -t UUID_SUB=$env{DEVICE_UUID}", ENV{.md.newdevice} = "$result"
  14. ENV{.md.newdevice}!="", RUN+="/sbin/mdadm --manage $env{DEVNAME} --cluster-confirm $env{RAID_DISK}:$env{.md.newdevice}"
  15. ENV{.md.newdevice}=="", RUN+="/sbin/mdadm --manage $env{DEVNAME} --cluster-confirm $env{RAID_DISK}:missing"
  16. LABEL="clustermd_end"