A NFS mount is hanging and it can not be umount even using -f option
- Try to use umount -f and fuser, it does not work
it does not work then,
This does not work then use the third party application "lsof"
Kill the nfs pid
If this does not work either then you have a stale mount and will need
- IP alias trick
On the nfs client:
In this example:
The nfs server ip address is 126.96.36.199
The nfs client ip address is 188.8.131.52
# mount | grep nfs
The nfs export is mounted over mount point /mnt.
184.108.40.206 cdrom /mnt nfs3
# ping 220.127.116.11
Ping hangs...the nfs server is no longer available.
# ps -ef
If possible kill any processes that maybe accessing the mount point.
Such as df,find or a mksysb process.
Alias the nfs server back to the loopback interface (lo0) on the nfs client.
# ifconfig lo0 alias 18.104.22.168 netmask 255.255.255.255 up
# netstat -in
Should have an additional lo0 listed with a 22.214.171.124 ip address.
# netstat -rn
126.96.36.199 188.8.131.52 UH lo0
Need to remove the route that was added by the ifconfig command from the
# route delete -host 184.108.40.206 220.127.116.11
# showmount -e 18.104.22.168
hangs...should be able to show the export list of the nfs client if
there's one available.
The showmount command should hang. Need to add a route using the nfs
server ip and point it back to the lo0.
# route add -host 22.214.171.124 127.0.0.1
# showmount -e
Returns the export list of the client, if the client is exporting
anything, in this case it was also an nfs server so it had an export
# umount /mnt
Successful...able to unmount the hung mount.
# df -k
No longer hangs...
No nfs mount listed.
# route delete -host 126.96.36.199 127.0.0.1
# ifconfig lo0 -alias 188.8.131.52 netmask 255.255.255.255