You are not logged in.
Hi all,
I would like to automatically mount a USB pendrive of any vendor, type and file-system to a specific directory and automatically umount when pendrive is removed. Now I am using systemd and fstab, in this case:
/dev/sdd1 /data/Music/USB auto nofail, x-systemd.automount, x-systemd.device-timeout=1 (and some other options) 0 0
This makes files on the USB pendrive accessible in the /data/Music/USB directory when an USB drive is inserted. However, when the USB drive is removed, the mount directory becomes empty but some apps (in my case mpd) believes these files are still around. I really need to umount this directory on USB removal.
Any suggestions?
Thanks!
Offline
Try a udev rule which runs “systemctl stop data-Music-USB.mount” on a remove action.
It may not solve your problem 100% — e.g. a program may have cached the filenames.
Offline