I have a rather simple set of custom rules:
ACTION=="add", SUBSYSTEM=="usb", ENV{ID_MODEL_ID}=="0748", ENV{ID_VENDOR_ID}=="05e3", TAG+="my-card-reader"
TAGS=="my-card-reader", ENV{DEVTYPE}=="disk", ENV{ID_INSTANCE}=="0:1", SYMLINK+="sdcard"
TAGS=="my-card-reader", ENV{ID_INSTANCE}=="0:1", ENV{DEVTYPE}=="partition", SYMLINK+="sdcard%n"
I'm trying to identify my USB card reader and then give the microSD card well-known names in /dev. This set of rules used to work in 16.04, in 18.04 it doesn't.
When checking udevadm monitor -p
, I can see that the USB reader is recognized:
UDEV [1832291.742219] add /devices/pci0000:00/0000:00:14.0/usb4/4-2 (usb)
ACTION=add
[…]
SUBSYSTEM=usb
TAGS=:my-card-reader:
[…]
But when I check the sysfs path later with udevadm info /sys/devices/pci0000:00/0000:00:14.0/usb4/4-2
, my TAG isn't shown anymore—in fact, there is no E: TAGS
entry available at all.
For other devices, for example a partition on my microSD card, Ubuntu's default systemd
TAG remains available:
P: /devices/pci0000:00/0000:00:14.0/usb4/4-2/4-2:1.0/host3/target3:0:0/3:0:0:2/block/sdf
N: sdf
[…]
E: SUBSYSTEM=block
E: TAGS=:systemd:
[…]
Update 1
I've been running with udev_log="debug"
while unplugging and replugging the reader and the SD card, suddenly and until now only once, my rules were applied. However, looking at the journalctl debug logs from udev and comparing, I cannot see a difference other than the race between kernel log, udev daemon log, and forked udev worker as well as the seq numbers.
Update 2
I have pretty much reduced the problem. The tag is available when the USB card reader is attached during boot. When I (re-)attach it later, the tag is missing.
What am I missing?