With udev / systemd version 241 and similar, as root:
udevadm control --log-priority=debug
journalctl -f
Or to make it permanent, again as root:
vi /etc/udev/udev.conf
# edit the log level as described in "man udev.conf"
systemctl restart systemd-udevd
journalctl -f
PS: the most frequent yet IMHO wrong answer looks like:
udevadm -d test /devices/where/is/my/device |& less
... but this has a number of issues. The main ones:
where/is/my/device
? Tedious, complicated and error-prone.
Comparing old answers to recent udev version 241 output, udevadm test
seems to show less information that it used to.
udevadm -d test
is only a simulation! Every time it warns:
This program is for debugging only, it does not run any program specified by a RUN key. It may show incorrect results, because some values may be different, or not available at a simulation run.
udevadm test
is for developing a new rule, it's not for troubleshooting broken, missing or overridden rules.
SUBSYSTEMS=="usb"
. I.e. double==
which tests for equality rather than single=
which assigns a value to a key.block
subsystem matching eitherENV{ID_FS_UUID}
,ATTRS{serial}
, orATTRS{idVendor}
/ATTRS{idProduct}
... If you really want to backup to any USB block device, matchENV{ID_BUS}=="usb"
. Also keep in mind a rule that is too generic may run multiple times for a single device add, so you may want to match something else likeENV{DEVTYPE}=="partition"
too.