Question about autofs and the mount point directory
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
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.
Question about autofs and the mount point directory
I just installed autofs on a debian box. It's working well, but I did make some mistakes in setting it up before it started working correctly.
Specifically I was using an indirect map. I created the a directory for the top level mount point "/mount-nfs" and I also created a directory inside that top level for the device specific mount "storage".
Here's the thing, during the process of testing, I would temporarily turn off autofs and when I did that these directories disappeared. It's as if autofs, in the process of shutting down did an rm -fr /mount-nfs. Several times during my testing I re-created these folders only to see this process repeat itself.
What I'd like to know is if indeed this is what autofs did. I'm a little afraid that autofs did something more brutal and that, while the directories disappeared, the inodes are still there but unreachable.
Does anyone know for sure? (I don't really care at this point as what's a few missing inodes, but I'd certainly like to know before I do any more experimentation.
(BTW, on regular mounts I usually do a "touch NOTHING_MOUNTED" so users can report back something more useful than "all the files disappeared". Initially I did the same here and these "NOTHING_MOUNTED" files disappeared too.)
autofs creates the directories for the share mount points you define in auto.master and its offspring and it removes them when the share is not mounted. When you access a share mount point, autofs sees the request, logs into the share, and mounts it as per is configuration files. Besides 'mount on demand', autofs also provides for the automatic dismounting of unused shares after a set timeout if you want. Those features can be useful at times.
Thanks for the answer. I quite familiar with how autofs works at a high level. This setup is in an office LAN and I'm not comfortable putting the mount in fstab as the NFS server may be powered down. So autofs seems the way to go. It won't hold up the boot process and the mount point will re-appear when needed when the NFS server is back online and accessed.
re: "I quite familiar with how autofs works at a high level." - it gets difficult to answer a question when there is dissonance in the premise. rm -rf is a different thing than rmdir of a mount point. turning off a service does mean that the service is not available. These are 'high level' concepts that did not seem clear in the question. So, perhaps, I misunderstood the question.
I use autofs for access to smb shares on a NAS in an Ubuntu environment. Recently, permissions of the share mount point have made things difficult (read only except for owner). I have considered NFS but that means coordinating user and group numbers across then network and that'd be a pain, too. There always seems to be something.
Thanks for being patient with me. Recall that, not knowing any better, I initially did mkdirs for both the "top level" mount point and the lower level one for my autofs mounts. I also created a couple of files via touch in both the top level mount point and the lower level one.
After starting and then stopping autofs these directories and their files were gone.
So the main question I have is, were the files and directories I created completely deleted from the filesystem as if an rm -fr were done or did autofs delete the mount points in such a way that other aspects (inodes?) of the files and directories I created still "in use" by the filesystem?
rmdir won't work if there are still files in the directory, but I'm not sure if autofs has access to other deletion techniques. (It's been a while since I've done C programming in Unix.)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.