60-persistent-storage-dm.rules 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # Copyright (C) 2009 Red Hat, Inc. All rights reserved.
  2. #
  3. # This file is part of LVM2.
  4. # Udev rules for device-mapper devices.
  5. #
  6. # These rules create symlinks in /dev/disk directory.
  7. # Symlinks that depend on probing filesystem type,
  8. # label and uuid are created only if the device is not
  9. # suspended.
  10. # "add" event is processed on coldplug only!
  11. ACTION!="add|change", GOTO="dm_end"
  12. ENV{DM_UDEV_RULES_VSN}!="?*", GOTO="dm_end"
  13. ENV{DM_UDEV_DISABLE_DISK_RULES_FLAG}=="1", GOTO="dm_end"
  14. SYMLINK+="disk/by-id/dm-name-$env{DM_NAME}"
  15. ENV{DM_UUID}=="?*", SYMLINK+="disk/by-id/dm-uuid-$env{DM_UUID}"
  16. ENV{DM_SUSPENDED}=="1", GOTO="dm_end"
  17. ENV{DM_NOSCAN}=="1", GOTO="dm_watch"
  18. IMPORT{builtin}="blkid"
  19. ENV{DM_UDEV_LOW_PRIORITY_FLAG}=="1", OPTIONS="link_priority=-100"
  20. ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}"
  21. ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}"
  22. ENV{ID_PART_ENTRY_UUID}=="?*", SYMLINK+="disk/by-partuuid/$env{ID_PART_ENTRY_UUID}"
  23. ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_ENTRY_NAME}=="?*", SYMLINK+="disk/by-partlabel/$env{ID_PART_ENTRY_NAME}"
  24. ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_GPT_AUTO_ROOT}=="1", SYMLINK+="gpt-auto-root"
  25. # Add inotify watch to track changes on this device.
  26. # Using the watch rule is not optimal - it generates a lot of spurious
  27. # and useless events whenever the device opened for read-write is closed.
  28. # The best would be to generete the event directly in the tool changing
  29. # relevant information so only relevant events will be processed
  30. # (like creating a filesystem, changing filesystem label etc.).
  31. #
  32. # But let's use this until we have something better...
  33. LABEL="dm_watch"
  34. OPTIONS+="watch"
  35. LABEL="dm_end"