singularity icon indicating copy to clipboard operation
singularity copied to clipboard

Bind to sshfs mount with 'reconnect' flag

Open willw1 opened this issue 3 years ago • 1 comments

Starting a shell with --bind option pointing to an sshfs mounted volume works ok. However, if the sshfs mount gets dropped and restarted automatically (with the sshfs 'reconnect' option) while the shell is running it can no longer see the mounted volume. Is there any way to 'refresh' the binding from within the shell?

willw1 avatar Feb 10 '22 01:02 willw1

There isn't a direct way to do this. The reconnected FUSE mount is a different mount... and can't be passed into the container again in any simple manner. I believe that the way to work around this issue is by mounting a path above the FUSE mount, and ensuring mount options are set so that mounts and changes under that directory (i.e. new FUSE re-connections) propagate.

  1. Don't bind mount the FUSE sshfs directory directly. Mount sshfs inside a directory e.g. /mydir/sshfs and then bind mount /mydir.

  2. Ensure that mount slave is true in singularity.conf.

I would also suggest possibly trying the --fusemount option so that the fuse process runs in the container, rather than binding it in.

https://sylabs.io/guides/3.9/user-guide/bind_paths_and_mounts.html?highlight=fuse#fuse-mounts

I can't say I've tried FUSE mounts which drop out like this, but it's another path to investigate.

dtrudg avatar Feb 10 '22 14:02 dtrudg

Closing as there has been no follow-up regarding the suggested approach. Please feel free to re-open if you have further information r.e. the above.

dtrudg avatar Jun 14 '24 08:06 dtrudg