I took a look at all the rules in /lib/udev/rules.d and noticed that every 'NAME=' assignment is preceeded by a conditional (e.g. KERNEL== or SUBSYSTEM==). Adding a conditional seems to make the rule apply. Here's what I did:
# Make the device take the /dev/mapper name
-OPTIONS+="string_escape=none", NAME="mapper/$env{DM_NAME}"
+#KERNEL=="dm-*", OPTIONS+="string_escape=none", NAME="mapper/$env{DM_NAME}"
+KERNEL=="dm-*", 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}"
The weird thing is that it would not work with OPTIONS+=... even with KERNEL==... I don't understand this at all but udevadm test now applies the NAME rule. Perhaps I should poke around in the udev source
I took a look at all the rules in /lib/udev/rules.d and noticed that every 'NAME=' assignment is preceeded by a conditional (e.g. KERNEL== or SUBSYSTEM==). Adding a conditional seems to make the rule apply. Here's what I did:
--- a/lib/udev/ rules.d/ 65-dmsetup. rules 2009-01-09 06:02:58.000000000 -0800 rules.d/ 65-dmsetup. rules 2009-01-15 10:55:14.000000000 -0800 NAME}== "temporary- cryptsetup- *", OPTIONS= "ignore_ device"
+++ b/lib/udev/
@@ -11,7 +11,8 @@
ENV{DM_
# Make the device take the /dev/mapper name ="string_ escape= none", NAME="mapper/ $env{DM_ NAME}" ="string_ escape= none", NAME="mapper/ $env{DM_ NAME}" $env{DM_ NAME}" ="disk/ by-id/dm- name-$env{ DM_NAME} " UUID}== "?*", SYMLINK+ ="disk/ by-id/dm- uuid-$env{ DM_UUID} "
-OPTIONS+
+#KERNEL=="dm-*", OPTIONS+
+KERNEL=="dm-*", NAME="mapper/
SYMLINK+
ENV{DM_
The weird thing is that it would not work with OPTIONS+=... even with KERNEL==... I don't understand this at all but udevadm test now applies the NAME rule. Perhaps I should poke around in the udev source