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 22.214.171.124
The nfs client ip address is 126.96.36.199
# mount | grep nfs
The nfs export is mounted over mount point /mnt.
188.8.131.52 cdrom /mnt nfs3
# ping 184.108.40.206
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 220.127.116.11 netmask 255.255.255.255 up
# netstat -in
Should have an additional lo0 listed with a 18.104.22.168 ip address.
# netstat -rn
22.214.171.124 126.96.36.199 UH lo0
Need to remove the route that was added by the ifconfig command from the
# route delete -host 188.8.131.52 184.108.40.206
# showmount -e 220.127.116.11
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 18.104.22.168 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 22.214.171.124 127.0.0.1
# ifconfig lo0 -alias 126.96.36.199 netmask 255.255.255.255