Skip to contentSkip to conversation

Trailing '/' on path names in /etc/fstab confused mount.

DISCUSSION NeilBrown 1 participant 1 message Oct 7, 2011

Subsystems (2)
lore
Share & tools
lore

NeilBrown

author
#0 lore raw

If I have:

host:/path /mountpoint nfs defaults 0 0

in /etc/fstab, mount then "mount /mountpoint" the entry that appears in /proc/mounts is

host:/path/ /mountpoint nfs .....

Note the extra '/'.

This confused mount. If I run

mount -a -t nfs,nfs4 -f -v -n -i

(as I might in a script to check if all NFS mountpoints are actually mounted), it thinks that /mountpoint is not correctly mounted. If I edit /etc/fstab to put the '/' in, 'mount' is not confused any more and reports correctly.

So:
Why do we get the trailing '/'? Is it really needed or is it a bug?

If it is really needed I suspect we need to teach 'mount' to ignore such things.... but is it guaranteed that requesting "/path/" from the server is exactly the same as requesting "/path" ??? It certainly is for NFSv4 and any v3 server that handled the two differently could certainly be considered to be odd, but is it definitely wrong?

Thought?

Thanks,
NeilBrown