56-dm-parts.rules 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # Rules for partitions created by kpartx
  2. KERNEL!="dm-*", GOTO="dm_parts_end"
  3. ACTION!="add|change", GOTO="dm_parts_end"
  4. ENV{DM_UUID}!="part[0-9]*", GOTO="dm_parts_end"
  5. # We must take care that symlinks don't get lost,
  6. # even if blkid fails in 13-dm-disk.rules later.
  7. #
  8. # Fixme: we have currently no way to avoid calling blkid on
  9. # partitions of broken mpath maps such as DM_NOSCAN.
  10. # But when partition devices appear, kpartx has likely read
  11. # the partition table shortly before, so odds are not bad
  12. # that blkid will also succeed.
  13. IMPORT{db}="ID_FS_USAGE"
  14. IMPORT{db}="ID_FS_UUID_ENC"
  15. IMPORT{db}="ID_FS_LABEL_ENC"
  16. IMPORT{db}="ID_PART_ENTRY_NAME"
  17. IMPORT{db}="ID_PART_ENTRY_UUID"
  18. IMPORT{db}="ID_PART_ENTRY_SCHEME"
  19. # Maps should take precedence over their members.
  20. ENV{DM_UDEV_LOW_PRIORITY_FLAG}!="1", OPTIONS+="link_priority=50"
  21. # Set some additional symlinks that typically exist for mpath
  22. # path members, too, and should be overridden.
  23. #
  24. # kpartx_id is very robust, it works for suspended maps and maps
  25. # with 0 dependencies. It sets DM_TYPE, DM_PART, DM_WWN
  26. IMPORT{program}=="kpartx_id %M %m $env{DM_UUID}"
  27. # DM_TYPE only has a reasonable value for partitions on multipath.
  28. ENV{DM_UUID}=="*-mpath-*", ENV{DM_TYPE}=="?*", ENV{DM_SERIAL}=="?*" \
  29. SYMLINK+="disk/by-id/$env{DM_TYPE}-$env{DM_SERIAL}-part$env{DM_PART}"
  30. ENV{DM_WWN}=="?*", ENV{DM_PART}=="?*", \
  31. SYMLINK+="disk/by-id/wwn-$env{DM_WWN}-part$env{DM_PART}"
  32. LABEL="dm_parts_end"