Can't access folders mounted by sshfs after sleep (or when connection lost)

Solution 1:

I suffer the same problem in Ubuntu Linux. What I do after resume:

$ killall -9 sshfs

Then, umount

$ fusermount -u ~/far_projects

and mount again the remote filesystem.

$ sshfs -o idmap=user youruser@server:/projects ~/far_projects

Solution 2:

As noted here, this is your solution:

 -o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3

As an example usage: https://github.com/aktos-io/dcs-tools, take a look at make mount-root target.

Solution 3:

I've had the same issue on my laptop.

All you need is to include the lazy unmount option (z) in your unmount command:

$ fusermount -uz ~/Mounts/Remote

Then just remount the same way you normally would.

Also, it's worth noting that I use the reconnect option (-o reconnect) which will maintain the connection through any hiccups (like closing your lid and coming back a few minutes later).

You can also look into a solution like afuse which is an auto-mounter for fuse filesystems (sshfs included) to save you the hassle of unmounting/remounting every time.

One final auto-mount option is using autofs with sshfs.