NFS umount fails to find directory in /proc/mounts

mountnfs

When mounting an NFS share manually using mount and a path of the form <domain/ip>:<path>/<path> or <domain/ip>:/<path>/<path>, umount fails to find the path in /proc/mounts, despite the fact that the path is in fact listed in /proc/mounts.

This is the same problem as in this question: How to solve this NFS unmunt problem?

Steps to reproduce:

# mount --version
mount from util-linux 2.24.1 (libmount 2.24.0: debug, assert)
# mkdir mountpath
# mount 192.168.2.101:/devices mountpath
# umount mountpath
/home/.../mountpath was not found in /proc/mounts
# grep mountpath /proc/mounts
192.168.2.101://devices /home/.../mountpath nfs4 rw,[snip],addr=192.168.2.101 0 0

How can I unmount this mount?

Best Answer

This problem arises because mount adds the mount to /etc/mtab with the path you specify on the command line, but in /proc/mounts it always appears with an additional slash.

To solve the problem, edit /etc/mtab to match the syntax in /proc/mounts.

To avoid the problem in the future, always mount SMB shares with the same syntax as /proc/mounts/: 192.168.2.101://devices.

Compare also this bug report: https://bugs.launchpad.net/ubuntu/+source/nfs-utils/+bug/974374

Related Question