Your Ad Here

IBM AIX/UNIX system storage administration ksh/perl scripting

Friday, March 20, 2009

Use IP alias trick to solve hung NFS mount problem

Problem:
A NFS mount is hanging and it can not be umount even using -f option

Solution:

  • Try to use umount -f and fuser, it does not work
#unmount -f
it does not work then,
#fuser -cuxk
This does not work then use the third party application "lsof"
#lsof -N
Kill the nfs pid

If this does not work either then you have a stale mount and will need
to reboot

  • IP alias trick

On the nfs client:

In this example:
The nfs server ip address is 199.159.207.34
The nfs client ip address is 199.159.247.137

# mount | grep nfs
The nfs export is mounted over mount point /mnt.
199.159.207.34 cdrom /mnt nfs3

# ping 199.159.207.34
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 199.159.207.34 netmask 255.255.255.255 up

# netstat -in
Should have an additional lo0 listed with a 199.159.207.34 ip address.

# netstat -rn
199.159.207.34 199.159.207.34 UH lo0

Need to remove the route that was added by the ifconfig command from the
routing table.

# route delete -host 199.159.207.34 199.159.207.34

# showmount -e 199.159.207.34
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 199.159.207.34 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
list.

# umount /mnt
Successful...able to unmount the hung mount.

# df -k
No longer hangs...

# mount
No nfs mount listed.

Clean up...

# route delete -host 199.159.207.34 127.0.0.1
# ifconfig lo0 -alias 199.159.207.34 netmask 255.255.255.255

No comments:

Labels

Blog Archive

BlogCatalog