Here is an /etc/fstab
record example of one of the mounts as per x-systemd.automount
and other goodies:
UUID=XXXX-XXXX /media/XXXX-XXXX auto noauto,nofail,nouser,uid=root,gid=users,umask=007,X-mount.mkdir,x-systemd.automount,x-systemd.device-timeout=1,x-systemd.idle-timeout=60 0 2
Currently this external exFAT-formatted drive is physically disconnected from the PC, but I still get the following surprises
$ ls /media
ls: cannot access '/media/XXXX-XXXX': No such device
and
$ findmnt /media/XXXX-XXXX
TARGET SOURCE FSTYPE OPTIONS
/media/XXXX-XXXX systemd-1 autofs rw,relatime,fd=55,pgrp=1,timeout=60,minproto=5,maxproto=5,direct,pipe_ino=24590
This obviously fools other software, which might potentially be using findmnt
to determine whether the mount is up, to believe that the storage drive is actually mounted and to proceed with further actions.
How do I make sure that when the drive is physically disconnected, it is no longer considered by the Linux system?