automount nfs: autofs timeout settings for unreliable servers - how to avoid hangup?

Mount the NFS-share on the clients using the mount-options "bg,intr,hard".

Most important in your case is "bg" for background - which tells the system not to block when the server is not available.

"intr" for interrruptable - so you can kill hanging mounts on the client with the kill command.

"hard" is the opposite of "soft". The difference is that "hard" will keep trying endlessly while "soft" will exponentially back off its retries when the server is not available.


I played around some more with some of the options from the man page. All of bg,hard, bg,soft, fg,hard and fg,soft give me return times of over two minuets.

Setting retrans=1,retry=0 (combined with any of the above) though, gives me times around three seconds. Pretty decent. Although I'm not quiet sure what each combination means. Will dig around further.

Also I came across the autofs options MOUNT_WAIT and UMOUNT_WAIT. I haven't been able to get some differnt results with them but I will keep trying. Seems lika a good way to use "more secure" (aka more retries, etc.) NFS option but quick return times for autofs, or not?


Using any mount system, you want to avoid situations where Nautilus lists the directory containing a mount that may or not be mounted. So, with autofs, don't create mounts in, for instance, /nfs. If you do, when you use Nautilus to list the 'File System' it will try to create whatever mounts should exist in /nfs, and if those mount attempts fail it takes minutes to give up.

So what I did was change auto.master to create the mounts in /nfs/mnt.

This fixed the problem for me. I only get a long delay if I try to list the contents of /nfs/mnt, which I can easily avoid.