Sometimes it’s more convenient to work with your data using tools installed on your own machine rather than on the cluster. For example, viewing and debugging point clouds with rerun is easier to use locally, but the data you want to look at lives on the storage at HPC2N. Instead of copying files back and forth every time you want to inspect something, you can mount the storage directly as a folder on your own machine using sshfs.

Installing sshfs

sshfs lets you mount a remote folder, reachable over SSH, as if it were a local directory. It’s available in most Linux package managers, e.g. on Ubuntu/Debian

sudo apt install sshfs

On macOS you’ll need macFUSE together with sshfs, both of which can be installed via Homebrew

brew install macfuse
brew install gromgit/fuse/sshfs-mac

Windows doesn’t have sshfs built in either, but WinFsp and SSHFS-Win together provide the same functionality. Install both, e.g. via winget

winget install WinFsp.WinFsp
winget install WinFsp.SSHFS-Win

Mounting the storage

First create a local folder to mount the storage into

mkdir ~/cfl-storage

Then mount your project’s storage path into it

sshfs <hpc2n-username>@kebnekaise.hpc2n.umu.se:/proj/CFL_nobackup/<proj-id>/ ~/cfl-storage

replacing <hpc2n-username> and <proj-id> with your own values, and entering your password when prompted. The folder ~/cfl-storage now behaves like any other folder on your machine. Browse it in a file manager, open files directly in your editor, or point a tool like rerun straight at it, without downloading anything first.

Windows

On Windows, mount the storage as a network drive from File Explorer instead: right-click This PC and choose Map network drive, then use the folder path

\\sshfs\<hpc2n-username>@kebnekaise.hpc2n.umu.se\proj\CFL_nobackup\<proj-id>

again replacing <hpc2n-username> and <proj-id> with your own values. You’ll be prompted for your password, and the drive then shows up as any other drive letter, e.g. in Explorer or a tool like rerun. The same thing can be done from the command line with

net use X: \\sshfs\<hpc2n-username>@kebnekaise.hpc2n.umu.se\proj\CFL_nobackup\<proj-id>

Unmounting

Once you’re done, unmount the folder again with

fusermount -u ~/cfl-storage

On macOS, use umount ~/cfl-storage instead. On Windows, right-click the drive in Explorer and choose Disconnect, or run net use X: /delete.

A note on performance

Every file access over sshfs goes over the network, so it’s best suited for browsing and opening individual files rather than running compute-heavy jobs directly against the mounted folder. For that, submit a job on the cluster instead. Reading many small files over sshfs can also be noticeably slower than reading them locally, for much the same reason small files are slow on the cluster’s own filesystem.

Updated: