Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
umount crashed NFS-mount
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
simvin76
Tux's lil' helper
Tux's lil' helper


Joined: 05 Oct 2005
Posts: 96

PostPosted: Wed Dec 26, 2007 11:41 pm    Post subject: umount crashed NFS-mount Reply with quote

Hello

I have mounted an NFS-share, but the NFS-server has crashed. The server will not be coming online any time soon.
How do I umount the NFS share?


Best regards
Simon
Back to top
View user's profile Send private message
blu3bird
Retired Dev
Retired Dev


Joined: 04 Oct 2003
Posts: 614
Location: Munich, Germany

PostPosted: Wed Dec 26, 2007 11:45 pm    Post subject: Reply with quote

man 8 unmount wrote:
-f Force unmount (in case of an unreachable NFS system). (Requires
kernel 2.1.116 or later.)

_________________
Black Holes are created when God divides by zero!
Back to top
View user's profile Send private message
simvin76
Tux's lil' helper
Tux's lil' helper


Joined: 05 Oct 2005
Posts: 96

PostPosted: Thu Dec 27, 2007 1:13 am    Post subject: Reply with quote

Sorry, should have read the man-page better.

It didn't solve my problem:
Code:
sargon vinde # umount -f -t nfs babylon.article19.biz:/pub
Cannot MOUNTPROG RPC: RPC: Port mapper failure - RPC: Unable to receive
umount2: Device or resource busy
umount: /pub: device is busy
Cannot MOUNTPROG RPC: RPC: Port mapper failure - RPC: Unable to receive
umount2: Device or resource busy
umount: /pub: device is busy
Back to top
View user's profile Send private message
bunder
Bodhisattva
Bodhisattva


Joined: 10 Apr 2004
Posts: 5947

PostPosted: Thu Dec 27, 2007 1:16 am    Post subject: Reply with quote

rebooting should fix it... i know that doesn't sound like a good thing to do, but in some cases, its the only thing you can do. or you can keep mashing umount -f and hoping that it will work over time, because i've seen that happen too.

cheers
_________________
Neddyseagoon wrote:
The problem with leaving is that you can only do it once and it reduces your influence.

banned from #gentoo since sept 2017
Back to top
View user's profile Send private message
simvin76
Tux's lil' helper
Tux's lil' helper


Joined: 05 Oct 2005
Posts: 96

PostPosted: Thu Dec 27, 2007 1:31 am    Post subject: Reply with quote

bunder wrote:
rebooting should fix it... i know that doesn't sound like a good thing to do, but in some cases, its the only thing you can do. or you can keep mashing umount -f and hoping that it will work over time, because i've seen that happen too.

cheers

This has happened before, and rebooting didn't fix it. The opposite in fact. The shutdown script waited for umount to finish, which didn't happen. sshd had already been stopped so I couldn´t log in and do anything. The reboot continued when I finally got the other server online and nfs could umount.

My big problem is that both boxes are 1000 km away so I can't do anything physical to them. The reason I want to umount is just so I can do a reboot in case I would need to do it.


/simon
Back to top
View user's profile Send private message
bunder
Bodhisattva
Bodhisattva


Joined: 10 Apr 2004
Posts: 5947

PostPosted: Thu Dec 27, 2007 2:02 am    Post subject: Reply with quote

you can always try a lazy umount (-f -l -a -t nfs)

that should make the system "think" its unmounted.

cheers
_________________
Neddyseagoon wrote:
The problem with leaving is that you can only do it once and it reduces your influence.

banned from #gentoo since sept 2017
Back to top
View user's profile Send private message
simvin76
Tux's lil' helper
Tux's lil' helper


Joined: 05 Oct 2005
Posts: 96

PostPosted: Sat Dec 29, 2007 9:48 am    Post subject: Reply with quote

bunder wrote:
you can always try a lazy umount (-f -l -a -t nfs)

that should make the system "think" its unmounted.

cheers
umount -f -l -t nfs babylon.article19.biz:/pub worked.

Thank you
/Simon
Back to top
View user's profile Send private message
Malvineous
Apprentice
Apprentice


Joined: 20 Oct 2006
Posts: 281
Location: Brisbane, Australia

PostPosted: Sun Dec 30, 2007 6:01 am    Post subject: Reply with quote

simvin76 wrote:

It didn't solve my problem:
Code:
sargon vinde # umount -f -t nfs babylon.article19.biz:/pub
Cannot MOUNTPROG RPC: RPC: Port mapper failure - RPC: Unable to receive
umount2: Device or resource busy
umount: /pub: device is busy
Cannot MOUNTPROG RPC: RPC: Port mapper failure - RPC: Unable to receive
umount2: Device or resource busy
umount: /pub: device is busy

The "device is busy" error means you've got programs/shells with their current working directories inside the mountpoint. You can't "cd /mnt/cdrom ; umount /mnt/cdrom" for the same reason, so you need to close any program that's using the directory.

Once you've done that umount -f usually works, sometimes you have to do it a few times.

IMHO a better long-term solution for this type of problem is to mount all NFS mounts with the "soft" option, and use the "timeo" option to set a sane timeout. This will allow things to continue after a while if the server ever goes away. The default is "hard", which will wait forever for the server to come back online as you've discovered.
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23082

PostPosted: Sun Dec 30, 2007 4:59 pm    Post subject: Reply with quote

Another option is to use hard,intr. According to the documentation, this will make programs wait forever, but they will be interruptible, so you can kill them or cause them to awaken with an EINTR. This might be useful if you usually want to wait, but still need to avoid the problem seen here when the NFS server will be down for days or weeks.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum