Mounting sshfs on unreliable connection

fuse, sshfs

Solution

Use `-o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3`

These `ServerAlive` options cause the I/O errors to pop out after one minute of network outage. Without these options, processes which experience I/O hang seem to sleep indefinitely, even after the sshfs gets `reconnect`'ed.

Problem

I mount remote filesystem with sshfs. If the ssh connection times out it can cause other applications to hang (e.g. vim session with only local file open). It takes ~10 minutes for the system to recover. This happens even if I mount the remote filesystem read-only. Why? Is there a way to do sshfs mount so that it will not cause other applications to hang when using unreliable connection (e.g., wifi)? I don't need something robust, I just need to be able to view files on remote computer, can be read-only. I use lubuntu 12.10. ``` $sshfs -V SSHFS version 2.4 FUSE library version: 2.9.0 fusermount version: 2.9.0 using FUSE kernel interface version 7.18 ```

Original source