However, the mount command will accept the volume spec without the leading slash and mount it:
me@client:/$ sudo mount -t nfs bighost:remotevol /mnt/target
me@client:/$ sudo umount /mnt/target
/mnt/target was not found in /proc/mounts
/mnt/target was not found in /proc/mounts
me@client:/$
And the the remotevol is not unmounted.
umount fails to identify the mounted volume in /proc/mounts because, when mounted without the leading slash, it is denoted differently between /proc/mounts and the entry in /etc/mtab
To fix at time of the error, edit mtab for the un-umountable volume and add a leading slash to the volume path specifier... then unmount and it will work.
To prevent the error occurring, always specify volume paths with a leading slash on the command line or in fstab...
Real fix... I guess mount should require a leading slash on the volume name, and it's a bug that it doesn't?
This problem is not limited to stale mounts.
It's an error in the interaction between mount, umount and mount details in /proc/mounts vs /etc/mtab
In /etc/mtab, nfs4 mounts seem to have a problem with leading slashes.
For example, on my 12.04 client machine, mounting a zfs volume on a 12.04 host, the following works fine:
me@client:/$ sudo mount -t nfs bighost:/remotevol /mnt/target
me@client:/$ sudo umount /mnt/target
me@client:/$
No issues.
However, the mount command will accept the volume spec without the leading slash and mount it:
me@client:/$ sudo mount -t nfs bighost:remotevol /mnt/target
me@client:/$ sudo umount /mnt/target
/mnt/target was not found in /proc/mounts
/mnt/target was not found in /proc/mounts
me@client:/$
And the the remotevol is not unmounted.
umount fails to identify the mounted volume in /proc/mounts because, when mounted without the leading slash, it is denoted differently between /proc/mounts and the entry in /etc/mtab
me@client:/$ grep /mnt/target /etc/mtab 4,addr= 192.168. 1.19,clientaddr =192.168. 1.128 0 0 vers=4, rsize=262144, wsize=262144, namlen= 255,hard, proto=tcp, port=0, timeo=600, retrans= 2,sec=sys, clientaddr= 192.168. 1.128,minorvers ion=0,local_ lock=none, addr=192. 168.1.19 0 0
bighost:remotevol /mnt/target nfs rw,vers=
me@client:/$ grep /mnt/target /proc/mounts
bighost:/remotevol/ /mnt/target nfs4 rw,relatime,
To fix at time of the error, edit mtab for the un-umountable volume and add a leading slash to the volume path specifier... then unmount and it will work.
To prevent the error occurring, always specify volume paths with a leading slash on the command line or in fstab...
Real fix... I guess mount should require a leading slash on the volume name, and it's a bug that it doesn't?