Tux

...making Linux just a little more fun!

how to unmount stale NFS connection

Mulyadi Santosa [mulyadi.santosa at gmail.com]


Mon, 19 Apr 2010 01:05:38 +0700

Hi all

Following my recent question regarding how to close tcp connection, it turns out that in my case, the sockets belong to stale NFS connection. In other words, the client try to maintain a mount toward a server that no longer exist.

So, how to unmount it? If you use the usual umount or umount.nfs, you can't do it and it will yield error messages like below: $ sudo umount.nfs /media/nfs -f -v umount.nfs: Server failed to unmount '192.168.1.2:/opt/data' umount2: Device or resource busy umount.nfs: /media/nfs: device is busy

Thanks to Google, I came to this URL https://www.linuxquestions.org/linux/answ[...]_gone_down_causing_the_applications_thre (hopefully I paste the entire URL correctly).

Essentially, the trick is to "emulate" the dead NFS server. Bring up a virtual interface such as eth0:0 and assign it the IP address of the dead server: # ifconfig eth0:0 192.168.1.2 netmask 255.255.255.0 # ifconfig et0:0 up

Then retry the umount or umount.nfs command. It takes times, but eventually it will succeed. Finally, bring down the virtual interface: # ifconfig eth0:0 down

PS: Big credits to Rahul K. who share this valuable information.

-- 
regards,
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com


Top    Back


Ben Okopnik [ben at linuxgazette.net]


Sun, 18 Apr 2010 14:41:27 -0400

On Mon, Apr 19, 2010 at 01:05:38AM +0700, Mulyadi Santosa wrote:

> 
> Thanks to Google, I came to this URL
> https://www.linuxquestions.org/linux/answ[...]_gone_down_causing_the_applications_thre
> (hopefully I paste the entire URL correctly).

Not exactly relevant to your question, but - I found the Microsoft ad which LQ oh-so-politely jammed into the top right corner of that post quite amusing. Linux questions, Microsoft answers?

-- * Ben Okopnik * Editor-in-Chief, Linux Gazette * https://LinuxGazette.NET *


Top    Back


Mulyadi Santosa [mulyadi.santosa at gmail.com]


Mon, 19 Apr 2010 07:09:47 +0700

On Mon, Apr 19, 2010 at 01:41, Ben Okopnik <ben at linuxgazette.net> wrote:

> Not exactly relevant to your question, but - I found the Microsoft ad
> which LQ oh-so-politely jammed into the top right corner of that post
> quite amusing. Linux questions, Microsoft answers?

And the whole LQ is actually another Microsoft sub company? :D oh well..... Sounds like the old linux.com and ddj.com :D :D

-- 
regards,
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com


Top    Back