So I have the UDEV rule:
ACTION=="add", SUBSYSTEMS=="block", KERNEL=="sd[a-z]1", RUN+="/usr/local/bin/script.sh"
This is saved in
I want it to trigger the script when any USB key is attached.
I am testing with 3 different USB sticks.
Without the UDEV rule in place (well a blank
10-usb.rules file), the USB auto mounts fine.
With the UDEV rule in place (I use
udevadm control --reload then
udevadm trigger at each change), the script triggers (in the script I have some files being copied first on the Pi, before over to the USB) but the USB doesn't mount properly, hence messing up the file transfer.
tail -f /var/log/messages I can see the USB being attached, but it stays greyed out in the top right corner of the Pi (eject devices).
Any ideas as to why the mounting issue comes into play when the UDEV rule is in place?