I'm setting up udev
to handle my external USB hard drive when it gets plugged in and removed (no mounting yet). So far, I've made two new rules in /etc/udev/rules.d/10-local.rules
to log adding/removing the disk to a file:
SUBSYSTEM=="block", ATTRS{model}=="2AS", ACTION=="add", RUN+="/bin/echo 'inserted lacie' >> /home/herman/udev_file"
SUBSYSTEM=="block", ATTRS{model}=="2AS", ACTION=="remove", RUN+="/bin/echo 'removed lacie' >> /home/herman/udev_file"
I have started the udevd
daemon and re-plugged the hard drive several times, but /home/herman/udev_file
is never created . In the rules I've used keys from the command udevadm info -a -n /dev/sdb
which is the hard drive in question. What am I doing wrong here? The disk is being detected and I'm able to mount
it just fine. Any help appreciated.