You are not logged in.
I had a udev rule to automatically create a symlink for my iPod when I plug it in:
SUBSYSTEMS=="scsi", KERNEL=="sd?2", ATTRS{vendor}=="Apple*", ATTRS{model}=="iPod*", SYMLINK+="ipod", GROUP="plugdev"It has recently stopped working.
If I change KERNEL to sdb or "sd?", it will trigger, but the symlink will be to the wrong device (I want the second partition, not the entire disk)
I've tested this with a simpler rule:
KERNEL=="sdb", RUN+="/test.sh"where test.sh echoes 1 to a file. This works, while
KERNEL=="sdb2", RUN+="/test.sh"doesn't
How can I diagnose this?
Last edited by florosus (2026-04-28 18:15:04)
Offline
Should™ be block and you also probably want to filter for "add"?
ACTION=="add", SUBSYSTEM=="block", …?
How can I diagnose this?
https://bbs.archlinux.org/viewtopic.php … 1#p2295641
udevadm monitorOnline
sdb2 does come online in monitor, just doesn't trigger the rule. The simple KERNEL=sdb vs sdb2 test demonstrates that I think.
Offline
You can enable the udev debug setting, prints to the system journal.
The wrong or simple rule might get skipped by a more specific match.
Online
I had a udev rule to automatically create a symlink for my iPod when I plug it in
Isn't it more suitable to hook to SUBSYSTEM=="block" and ATTR{partition}=="2" with other required attribute checks in addition?
How can I diagnose this?
Increace udev verbosity and watch journal during plug in:
# udevadm control --log-level=debug
# journalctl -f -b -u systemd-udevdAlso "udevadm monitor" often can help.
Offline