When setting up a network or SSHFS mountpoint in your fstab for normal user use, you may have come across an issue where issuing a
umount command (after mounting the share, of course) produces an error:
mount disagrees with the fstab. Well, I have a solution below that helps to resolve this.
If you’re not 100% sure of what I’m talking about, let me provide you with an example. Here was my fstab entry, whilst I was receiving the error (the Ubuntu community help pages provided me with the fstab entry):
sshfs#geoff@hostname:/path/to/mount /media/hostname fuse defaults,noauto,uid=1000,gid=1000,user 0 0
Many of the blog posts I found simply suggested adding a forward slash to the end of the remote mount point (i.e:
sshfs#geoff@hostname:/path/to/mount/). However, this had absolutely no impact for me. All along, mounting the drive was fine. It was only when I attempted to unmount it, that I encountered issues.
sudo umount‘ing it worked just fine – but this wasn’t good enough for me.
However, issuing a
mount -l command whilst I had the remote share mounted provided me with the following line for this mount:
geoff@hostname:/path/to/mount/ on /media/hostname type fuse.sshfs (rw,noexec,nosuid,nodev,max_read=65536,user=geoff)
So, in my understanding (and I’ll be honest – it’s not an extensive understanding), I was telling fstab to mount using fuse, whilst it was being translated to fuse.sshfs. Now, fstab should be intelligent enough to make this conversion whilst unmounting. I’m pretty sure it is – but I reckon there was something preventing it from doing so. So, I saved fstab the hassle of doing the conversion, and simply provided it “pre-converted”. I modified my fstab entry to reflect the line below, and everything works!
geoff@hostname:/path/to/mount/ /media/hostname fuse.sshfs defaults,noauto,uid=1000,gid=1000,user 0 0
Hope this helps some other Ubuntu users :)