Force unmount NFS partition

2

I need weapons, I have none.

I have a NFS mountpoint in my system which isn't responding to anything. The physical mountpoint doesn't even exist anymore, but the system doesn't know it's not there anymore.

I've tried the typical

umount -l /partition
umount -f /partition
fuser -km /partition

The command just stucks there and does nothing. From time to time I have encountered this kind of behaviour, but usually the mountpoints get sorted by themselves. I'd just like to know the reason behind this and to make sure that I've tried everything.

Currently the behaviour messes up my filesystem since there are several mountpoints mounted under the same subfolder.

jester112358

Posted 2015-09-15T11:18:42.363

Reputation: 131

I think to many reasons that can cause it. Traffic on the remote LAN, remote server jammed, traffic on the backbone between you and the remote server, remote server down, remote server reinstalled, remote server with changed IP... try to ping or traceroute the remote server. – Hastur – 2015-09-15T11:36:07.700

Does it stuck even sudo umount -f -l /partition? (sudo if you are not root, of course). – Hastur – 2015-09-15T15:39:37.213

http://serverfault.com/questions/56588/unmount-a-nfs-mount-where-the-nfs-server-has-disappeared – Ciro Santilli 新疆改造中心法轮功六四事件 – 2017-03-17T17:10:03.853

Answers

1

We have had a similar issue as well. We have a server that has a NFS mount to another server. When the target is rebooted it will cause the client to just hang. umount force and lazy don't work. Our only recourse is to remove/comment the entries in fstab and force a restart on the client making sure the host is up. The NFS won't be mounted when it comes back up.

Unfundednut

Posted 2015-09-15T11:18:42.363

Reputation: 6 650

1

Unfortunately even at this time the Linux implementation of NFS is very bad at handling lost connections to servers. This does not happen in many other UNIX variants, but for some reason seems to be hard to fix in Linux, or nobody seems to bother.

What I usually do to get it sorted is to use also the -r flag, so the mount point is at least put into read only mode. This usually helps to get some of the blocking handles to disappear and finally you can unmount the share.

This might not always work but has helped me numerous times so I haven't had to reboot the client.

You can also remount the same share to the same directory again if the server is responding again. Not the best way to handle it but at least you can get the mount back if you need it.

Sami Kuhmonen

Posted 2015-09-15T11:18:42.363

Reputation: 2 052