AutoFS: any way to show the mount dir *before* it is mounted?
Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
AutoFS: any way to show the mount dir *before* it is mounted?
AutoFS is great for automatically mounting and unmounting media, but doesn't work very well with graphical file managers - the directory where a drive will be mounted doesn't show up when the drive is plugged in, so you have to enter it into the file manager's location bar every time. There is the "--ghost" option, but that only makes the directory stay present after the drive has been unmounted - it doesn't make it show up beforehand.
Is there any way to make the directory appear as soon as the relevant device is plugged in, so that file managers can easily be used to access it?
NB: I know one possible solution is to use a direct mapping. But that's useless to me, because it can handle only one drive at a time; an indirect mapping can handle as many as I want.
set a bookmark for the share in your file manager and then use that to access the share via autofs.
but there is also some confusion here as a directory is a file and a file's contents can't be shown without mounting the file system where the directory resides.
Also, 'plugging in' a drive is handled by udev and the drive should show up in /media when plugged in if there are recognizable file systems on the drive. The name of the mount point in /media is usually the label for the partition.
autofs works well for remote file systems that you want to access transparently but not have tied to your machine all the time like for NAS using SMB or NFS shares. It mounts them when you use them and then dismounts them after a time out of non use that you can specify.
You can use a file browser's capability to browse the network to see what servers are on your LAN and what they have for share - with nautilus, that mounts them via gvfs. Those can also be bookmarked and the credentials for access saved.
Thanks. That's not quite what I was looking for though... Better would be a way to let the file manager easily access *any* AutoFS mountable medium that is currently plugged in. Is that possible?
(udev/udisks is nice in theory, but often broken in practice, particularly if you don't use a login manager.)
Set the main autofs directory up at a separate location, like /mnt/automount. Then create a second directory containing symlinks to the actual mount directories. Accessing a symlink should act the same as accessing the mount directory itself.
udev works quite well for handling plug-in stuff from anything I can see
discovery of attached storage via plugged in or via LAN attachment is a part of most popular file browsers
using the right tool for the job to be done is important in any effort
customizing the system to avoid login managers is way way out there and doing that really restricts your access to the outside world
computers don't employ ESP so they don't know what you don't tell them
Thanks.
I wouldn't call avoiding login managers "way out there" though. KDM, GDM, and LightDM are all rather heavy for older computers, Slim and WDM don't work with Consolekit, XDM does not work reliably with ConsoleKit, and LXDM is quite buggy in my experience.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.