Monday, July 15, 2013

Fwd: un mount umount the unavailable nfs share



Post Outage steps performed by Nirav on HOSTWIS01
==================================
[root@BUTWIS01 cronscripts]#  ifconfig eth0:bufile03 10.9.11.65 netmask 255.255.0.0
[root@BUTWIS01 cronscripts]# lsof |grep /u2/share
lsof: WARNING: can't stat() nfs file system /u2/share
      Output information may be incomplete.
unibasic  11089       lab   17u  unknown               8,33      /u2/share/mobilex/in/MBXLABADT100412230810.hl7
[root@BUTWIS01 cronscripts]# kill -9 11089
[root@BUTWIS01 cronscripts]# umount -f bufile03:/share
[root@BUTWIS01 cronscripts]#  ifconfig eth0:bufile03 down
[root@BUTWIS01 cronscripts]# mount /u2/share
-======xxxxx End



A. Use ifconfig command. It is used to remove virtual interfaces or network aliases.
Ifconfig is used to configure the kernel-resident network interfaces. It is used at boot time to set up interfaces as necessary. After that, it is usually only needed when debugging or when system tuning is needed.
Type the command to remove eth0:1:
# ifconfig eth0:1 down

http://stackoverflow.com/questions/40317/force-unmount-of-nfs-mounted-directory

If the NFS server disappeared and you can't get it back online, one trick that I use is to add an alias to the interface with the IP of the NFS server (in this example, 192.0.2.55). In Linux the command for that is something roughly like:
ifconfig eth0:fakenfs 192.0.2.55 netmask 255.255.255.255  
Where 192.0.2.55 is the IP of the NFS server that went away. You should then be able to ping the address, and you should also be able to unmount the filesystem (use unmount -f). You should then destroy the aliased interface so you no longer route traffic to the old NFS server to yourself.
On FreeBSD and similar operating systems, the command would be something like:
ifconfig em0 alias 192.0.2.55 netmask 255.255.255.255  
And then to remove it:
ifconfig em0 delete 192.0.2.55  
man ifconfig(8) for more!





1  
A combination of ifconfig eth0:fakenfs ...' and umount -f -l /my/mount/dir' solved the problem for me. – pts Jan 16 '10 at 15:41