# This file causes devicemapper devices to be assigned names by udev # based on the name given to dmsetup. # See udev(8) for syntax. SUBSYSTEM!="block", GOTO="dmsetup_end" KERNEL!="dm-*", GOTO="dmsetup_end" ACTION!="add|change", GOTO="dmsetup_end" # Obtain device status IMPORT{program}="/sbin/dmsetup export -j%M -m%m" ENV{DM_NAME}!="?*", GOTO="dmsetup_end" # Make the device take the /dev/mapper name OPTIONS+="string_escape=none", NAME="mapper/$env{DM_NAME}" SYMLINK+="disk/by-id/dm-name-$env{DM_NAME}" ENV{DM_UUID}=="?*", SYMLINK+="disk/by-id/dm-uuid-$env{DM_UUID}" # Skip vol_id for suspended devices and those with empty or error tables ENV{DM_STATE}=="SUSPENDED", GOTO="dmsetup_end" ENV{DM_TARGET_TYPES}=="|*error*", GOTO="dmsetup_end" # by-uuid and by-label symlinks IMPORT{program}="vol_id --export $tempnode" OPTIONS="link_priority=-100" ENV{DM_TARGET_TYPES}=="*snapshot-origin*", OPTIONS="link_priority=-90" ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", \ SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", \ SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" LABEL="dmsetup_end"