Hi,
I'm trying to implement the automatic creation of a mount point defined by the volume name of an usb drive when inserted and also the removing of it once unplugged.
Autmounting works as expected. However, unmounting doesn't.
It looks like the lines linked to action:=remove aren't executed at all.
Any idea to help me ?
# uname -a
Linux server 2.6.26-2-amd64 #1 SMP Mon Jun 13 16:29:33 UTC 2011 x86_64 GNU/Linux
Thanks
Here is the contents of my file 76-local.rules
Code:
# /etc/udev/rules.d/local.rules
# /etc/udev/rules.d/76-local.rules
# ADD rule: if we have a valid ID_FS_LABEL_ENC, and it's USB, mkdir and mount
ENV{ID_FS_LABEL_ENC}=="?*", ACTION=="add", SUBSYSTEMS=="usb", \
RUN+="/usr/local/sbin/udev-automounter.sh %k"
# REMOVE rule
ENV{ID_FS_LABEL_ENC}=="?*", ACTION=="remove", SUBSYSTEMS=="usb", \
RUN+="/usr/local/sbin/udev-auto-umounter.sh $env{ID_FS_LABEL_ENC} %k"
# Other way tried, without calling external script. Doesn't work either :
#ACTION=="add", ENV{ID_FS_LABEL_ENC}=="?*", SUBSYSTEMS=="usb", RUN+="/bin/mkdir -p /Volumes/$env{ID_FS_LABEL_ENC}"
#ACTION=="add", ENV{ID_FS_LABEL_ENC}=="?*", SUBSYSTEMS=="usb", RUN+="/bin/mount /dev/$kernel /Volumes/$env{ID_FS_LABEL_ENC}"
#ACTION=="remove", ENV{ID_FS_LABEL_ENC}=="?*", SUBSYSTEMS=="usb", RUN+="/bin/umount /dev/$kernel"
#ACTION=="remove", ENV{ID_FS_LABEL_ENC}=="?*", SUBSYSTEMS=="usb", RUN+="/bin/rmdir /Volumes/$env{ID_FS_LABEL_ENC}"