View previous topic :: View next topic |
Author |
Message |
simvin76 Tux's lil' helper
Joined: 05 Oct 2005 Posts: 96
|
Posted: Wed Dec 26, 2007 11:41 pm Post subject: umount crashed NFS-mount |
|
|
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 |
|
|
blu3bird Retired Dev
Joined: 04 Oct 2003 Posts: 614 Location: Munich, Germany
|
Posted: Wed Dec 26, 2007 11:45 pm Post subject: |
|
|
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 |
|
|
simvin76 Tux's lil' helper
Joined: 05 Oct 2005 Posts: 96
|
Posted: Thu Dec 27, 2007 1:13 am Post subject: |
|
|
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 |
|
|
bunder Bodhisattva
Joined: 10 Apr 2004 Posts: 5947
|
Posted: Thu Dec 27, 2007 1:16 am Post subject: |
|
|
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 |
|
|
simvin76 Tux's lil' helper
Joined: 05 Oct 2005 Posts: 96
|
Posted: Thu Dec 27, 2007 1:31 am Post subject: |
|
|
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 |
|
|
bunder Bodhisattva
Joined: 10 Apr 2004 Posts: 5947
|
Posted: Thu Dec 27, 2007 2:02 am Post subject: |
|
|
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 |
|
|
simvin76 Tux's lil' helper
Joined: 05 Oct 2005 Posts: 96
|
Posted: Sat Dec 29, 2007 9:48 am Post subject: |
|
|
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 |
|
|
Malvineous Apprentice
Joined: 20 Oct 2006 Posts: 281 Location: Brisbane, Australia
|
Posted: Sun Dec 30, 2007 6:01 am Post subject: |
|
|
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 |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 23082
|
Posted: Sun Dec 30, 2007 4:59 pm Post subject: |
|
|
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 |
|
|
|