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