Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

autofs timeout while accessing to remote NFS mount

Following Apple recommendations, I switched to "Directory Utility" to configure NFS mounts. As far as I understand, if you do so, the mounts are handled by automount which is itself called by autofs. The good thing of this is that autofs is unmounting unused mounts (after a timeout of 3600 seconds as defined in /etc/autofs.conf). Any time you need the remote drive (Finder call, ls in Terminal..., opening file), autofs is remounting ressource. This is a nice behaviour... in theory.

I'm using some codes (written in IDL) that are reading and writing on that remote NFS server once every 5 minutes. Theoretically, autofs should be detecting these accesses and should keep the drive mounted. This is unfortunately not the case. The drive is unmounted 3600 seconds after I last accessed the mount through the Finder or with any other Application.

There is apparently no way to remove this "automated unmounting" feature. I tried to set the timeout delay to a very large number (1 day) but it still disconnects me after this delay, if I don't do anything else than running my IDL code. If I mount the NFS share with the "mount_nfs" command, it works perfectly, as it is not handled by autofs.

I wonder then if there is any recommandation on Apple's side in such a case, other than going back to traditional mount_nfs.

Xserve Xeon 5500, Mac OS X (10.5.7)

Posted on Jun 22, 2009 8:21 AM

Reply
1 reply

Jul 13, 2009 12:31 AM in response to Baptiste Cecconi

As you have discovered, automount/autofs is also an "auto-unmounter" and there is no way to remove that feature. Contrary to what one might think, the auto unmounting does NOT happen after a period of "inactivity" of the mount. This is because autofs has no way of knowing when an automounted file system was last accessed. So, instead it periodically attempts to unmount it - if it is busy it won't get unmounted - if it isn't busy it will get unmounted.

You can't disable this - but you can make the periodic unmounting so infrequent as to effectively disable the feature. Try setting the AUTOMOUNT_TIMEOUT interval to something really large - like 315360000 (which would be 10 years).

However, in theory, this auto-unmounting should not be a problem because if it does get unmounted then the next access to that file system should cause it to get mounted again. And all this should happen without the code that is accessing the automount knowing that it isn't always mounted. It should always be there when it is accessed. So, the usual response to someone asking how to disable the auto-unmounting is to ask why they think it is a problem. 🙂

(Oh, and you don't have to use "mount_nfs" - just "mount" should work to manually mount an NFS file system (that saves a little typing).)

HTH
--macko

autofs timeout while accessing to remote NFS mount

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.