For additional information regarding sshfs, please check out:
https://www.digitalocean.com/community/tutorials/how-to-use-sshfs-to-mount-remote-file-systems-over-ssh
This is useful because it allows you to run your local computer programs (i.e. VMD, text editors etc.) to use files which are on the HPC without tranfering the data back. In addition, it helps you manage your files because you will not need to keep two seperate directories, one on the HPC and one on your local device.
using a Secure Shell File System (sshfs) you can mount your HPC directory to your computer. This will act as if you have another hard drive on your computer, connected through the internet.
Linux has the necessary packages pre-installed with most versions. The necessary packages can be checked using
man sshfs
and installed using :
sudo apt-get install sshfs
[I believe you might also need fuse on Linux, except it is sometimes installed by default
sudo apt-get install fuse.]
You will need to install FUSE and SSHFS from the osxfuse website : https://osxfuse.github.io
Making a Mount Directory
Now that we have the necessary dependencies we need to create a directory to mount into. mkdir /mnt/
mkdir /mnt/razorHome/
mkdir /mnt/razorStorage/
mkdir /mnt/razorScratch/
mkdir /mnt/trestlesHome/
mkdir /mnt/trestlesStorage/
mkdir /mnt/trestlesScratch/
ls -lh /mnt
total 0
drwxr-xr-x 2 ultra admin 68B Oct 4 09:25 razorhome
drwxr-xr-x 2 ultra admin 68B Oct 4 09:24 razorscratch
drwxr-xr-x 2 ultra admin 68B Oct 4 09:24 razorstorage
From this you will need to ensure that you have the correct group, using chgrp
, and owner, using chown
.touch
and rm
files in these directories.Use the command:
sudo sshfs -o allow_other,uid='501' USERNAME@hpceq.uark.edu:/home/USERNAME/ /mnt/razorHome/
Dissecting this command is the key for application to your other directories.
first, a sudo, because this must be run as the superuser.
[curtis, I think sshfs can be run as regular user. By default only root can sepcify allow_other.
There is a policy you can set when you configure ssh on your computer. You can tell sshd to allow regular user to specify allow_other.]
second the -o flag, which from man sshfs is the options flag
third "allow_other" which allows any user on your computer to have acces to the drive you mount
fourth "uid=501" logs you into the HPC as your username. This number may, in some instances need to be altered to match the id
command on your LOCAL computer.
[I think you need this uid only because you are running this as root and you do not want default uid of zero for the mount]
fifth, this is the login to the HPC. It is preferred that you use hpceq.uark.edu in order to not overload the razor/trestles connections.
sixth, ":/home/USERNAME/" is the path to the directory on the HPC you want to mount.
seventh, "/mnt/razorHome/", the path to your Local directory.
*NOTE* SSHFS will throw an error, "not a directory", if you do not have tailing backslashes.
1) Do not use SSHFS for copying files. It downloads the file and then reuploads the file. This take a lot longer than using cp
on the HCP.