I have a notebook running Ubuntu 18.04 and a raspberry pi(4B with 4GB ram, which is a fantastic version of raspberry pi), both are on 7x24. Because capacity of the harddisk in the notebook is not large(only 64GB), I use sshfs to mount one hard disk(1TB) attached to the raspberry pi.
The sshfs command:
sshfs -o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3,allow_other rasp:/root/files /root/rasp_files/ >/var/log/sshfs.log 2>&1 &
But sshfs seems not very reliable, it crashes every several weeks, I do not know why and I do not want to know why. I just want it to recover. But every time it crashes, trying to relaunch sshfs gives error message:
fuse: bad mount point 'my mount point here': Transport endpoint is not connected
Trying to umount the directory with command fusermount -u "mount point here" directly gives following error:
fusermount: failed to unmount /root/rasp_files: Device or resource busy
Trying to umount using umount gives following error:
umount: /root/rasp_files: target is busy.
If you are like me and do not want to know why, this is the solution:
umount -l "mount point here"
sshfs -o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3,allow_other rasp:/root/files /root/rasp_files/ >/var/log/sshfs.log 2>&1 &
If you are curious, read man page of umount and research about linux file system, I am not very familiar with that topic.