Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed mount leaves corrupt mountpoint directory #122

Closed
gareththered opened this issue Apr 3, 2018 · 1 comment
Closed

Failed mount leaves corrupt mountpoint directory #122

gareththered opened this issue Apr 3, 2018 · 1 comment

Comments

@gareththered
Copy link

If I attempt to mount a remote server via SSHFS and it fails (in my case, it was a typo in the username, so I pressed Ctl-C to cancel), the mountpoint directory is left in an unusable state. I'm using the command without any option - simply sshfs user@server:dir/to/share /mount/point. The mount command shows the mount listed, but a ls shows:

root@web1:/srv# ls -l
ls: cannot access 'encrypted': Transport endpoint is not connected
total 4
drwxr-xr-x 2 www-data www-data 4096 Apr  3 16:03 docs
d????????? ? ?        ?           ?            ? encrypted
root@web1:/srv#

I can fix it with umount /srv/encrypted and the original directory returns.

This is on Debian 9 with sshfs version 2.8-1 and openssh version 7.4p1-10+deb9u3

@Nikratio
Copy link
Contributor

Thanks for the report! I think this is not a bug but a feature (at least sort of). Imagine that you have a directory sshfs mounted and periodically sync it to a local directory (e.g. using rsync -a --delete). If sshfs terminates due to some bug, you wouldn't want to see an empty mountpoint, because that would mean that the sync process also deletes all files in the mirror.

I agree that in your case this behavior is annoying, but it is difficult to distinguish this programmatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants