How to clear hung nfs mounts in linux

Whenever there are network changes or hiccups on systems with NFS mounts the NFS mounts itself will get hung so when you are doing df it will never complete and your session will get hung also.

A easy solution to resolve the hung mounts is to look at /etc/mtab and look for nfs entries and identify which ones are having the problem and remove those entries from /etc/mtab.  Take note of the ones thats removed and do a umount -l <mountpoint> and after you got all of the hung nfs mounts you should be able to do df again.

We will need to troubleshoot a bit before remounting the nfs share.  run rpcinfo -p <remotehost> and look up all of the ports thats required for NFS to work.  You will need portmapper/nlockmgr/nfs/mountd make sure that you are able to reach each of these ports on the remote host before attempting to remount the nfs share.

After the ports have been verified you can safely remount your share and it should mount without problems unless you have a problem on the NFS server side with permissions or access list.


One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.