68-del-part-nodes.rules 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. # These rules can delete partitions devnodes for slave devices
  2. # for certain aggregate devices such as multipath.
  3. # This is desirable to avoid confusion and keep the number
  4. # of device nodes and symlinks within limits.
  5. #
  6. # This is done only once on the first "add" or "change" event for
  7. # any given device.
  8. #
  9. # To suppress this, use the kernel parameter "dont_del_part_nodes",
  10. # or create an udev rule file that sets ENV{DONT_DEL_PART_NODES}="1".
  11. SUBSYSTEM!="block", GOTO="end_del_part_nodes"
  12. KERNEL!="sd*|dasd*", GOTO="end_del_part_nodes"
  13. ACTION!="add|change", GOTO="end_del_part_nodes"
  14. ENV{DEVTYPE}=="partition", GOTO="end_del_part_nodes"
  15. IMPORT{cmdline}="dont_del_part_nodes"
  16. ENV{dont_del_part_nodes}=="1", GOTO="end_del_part_nodes"
  17. ENV{DONT_DEL_PART_NODES}=="1", GOTO="end_del_part_nodes"
  18. # dm-multipath
  19. ENV{DM_MULTIPATH_DEVICE_PATH}=="1", GOTO="del_part_nodes"
  20. # Other aggregate device types can be added here.
  21. GOTO="end_del_part_nodes"
  22. LABEL="del_part_nodes"
  23. IMPORT{db}="DM_DEL_PART_NODES"
  24. ENV{DM_DEL_PART_NODES}!="1", ENV{DM_DEL_PART_NODES}="1", \
  25. RUN+="/usr/sbin/partx -d --nr 1-1024 $env{DEVNAME}"
  26. LABEL="end_del_part_nodes"