When our main NFS server goes offline, all clients which had a share mounted are affected in the following way:
1. `df` does not work (times out)
2. `lsof` does not work (times out)
3. I cannot unmount the share (umount times out)
4. I cannot restart the client PC, the shutdown process gets stuck
while trying to umount the dead NFS share:
`nfs server not responding still trying`
5. hard reboot (reset) works, but while booting the client PC gets
stuck while trying to mount the NFS share
Now I know how to solve the problem nr. 5. I can change the entry in fstab
to noauto
. But what about the other problems? Does NFS
client have no intelligence to stop waiting for a dead NFS server? Why does it wait indefinetly? Can I somewhere set a timeout, so that whatever happens, after x
seconds he gives up trying?
Best Answer
Yes this is the nature of NFS. The clients will wait indefinitely for the NFS resource to come back. Believe it or not it's designed to work this way!
automounting
The better approach would probably be to use a tool such as
autofs
to automount the NFS shares as needed, rather than keep them mounted indefinitely.Using just NFS
As @Patrick pointed out in the comments you can curtail this behavior by using the
soft
option when mounting NFS shares.excerpt from source: http://www.tldp.org/HOWTO/NFS-HOWTO/client.html
In your
/etc/fstab
file