8. Mounting HPC Storage - TGAC/knowledge_base GitHub Wiki

Usually we will want to use the cluster to process large data sets, and therefore we need some way to get data on and off the cluster storage. Locally (on site) this requires accessing the primary storage system as a network mount.

An important note first:

SCP - SCP IS NOT SUPPORTED IN THE EI CLUSTER.

Shared storage

The cluster data storage mounts are available to mount from your local machine. Please follow the instructions to mount your home directory and project areas; each operating system requires a different process.

Mounting HPC storage - Windows

Access via a Windows desktop is very straightforward - open up File Explorer, and type any of these paths into the address bar:

To access your personal home directory

    \\ei-hpc-data\hpc-home

To access the data areas of all projects which you have permission to

    \\ei-hpc-data\Projects

For simplicity, scratch areas on the HPC are accessible through a link in each respective project area. Unfortunately those links will not be recognised when mounting a project area locally; instead you will need to mount the scratch areas directly:

To access the scratch areas of all projects which you have permission to

    \\ei-hpc-data\Projects-Scratch

Mounting network storage to a path

By default, Windows mounts/maps a network drive as a new drive (eg. Z:) which is sufficient for most uses of storage. However some applications require a drive be mapped to a specific location; for instance, Globus (EI's preferred large transfer application) is unable to access areas outside of your c:\Users\_**<username>**_ directory, so would not be able to access storage mounted on a different drive.

To mount a network drive as a folder rather than a drive letter you will need to have local administrator rights. First, create the directories that you would like to act as mount points for he network storage (in this example, I have created a Projects and Projects-Scratch directories in my Documents directory). Then, open command prompt as administrator (right click command prompt icon and select run as admin from the drop down menu).

Now copy and paste the following commands onto the command line, replacing _**<username>**_ with your NBI username; these should be the absolute paths of the directories that we just created.

    mklink /D c:\Users\_**<username>**_\Documents\Projects \\ei-hpc-data\Projects
    mklink /D c:\Users\_**<username>**_\Documents\Projects-Scratch \\ei-hpc-data\Projects-Scratch

(NOTE 'RUN' IS NOT SUFFICIENT FOR THIS COMMAND)

The project areas should now be accessible.


Mounting HPC storage - Linux

For Ubuntu, use your package manager to install this:

    sudo apt-get install cifs-utils

Make sure your /etc/resolv.conf file looks like this:

    vi /etc/resolv.conf
 
        nameserver 127.0.0.53
        options edns0 trust-ad
        search .

Create the following directories in your /mnt directory:

    sudo mkdir /mnt/hpc_home /mnt/hpc_projects /mnt/hpc_scratch

Edit your /etc/fstab file and add the following lines, replacing _**<username>**_ with your NBI username (without @nbi.ac.uk):

    sudo vi /etc/fstab
        ...
        //ei-hpc-data.nbi.ac.uk/projects/ /mnt/hpc_projects cifs iocharset=utf8,uid=_**<username>**_>,gid=users,credentials=/root/.cifscredentials,file_mode=0775,dir_mode=0775 0 0
        //ei-hpc-data.nbi.ac.uk/hpc-home/ /mnt/hpc_home cifs iocharset=utf8,uid=_**<username>**_>,gid=users,credentials=/root/.cifscredentials,file_mode=0775,dir_mode=0775 0 0 
        //ei-hpc-data.nbi.ac.uk/projects-scratch/ /mnt/hpc_scratch cifs iocharset=utf8,uid=_**<username>**_>,gid=users,credentials=/root/.cifscredentials,file_mode=0775,dir_mode=0775 0 0
        ... 

Finally, create a /root/.cifscredentials file (note the '.' file prefix!) and add the following two lines replacing **_<password>_** with your current NBI password:

    sudo vi /root/.cifscredentials


        username=**_<username>_**@nbi.ac.uk
        password=**_<password>_**

Then mount these new directories by using:

    sudo mount –a

Copying data to and from your local machine to the cluster is now trivial:

    cp /mnt/hpc-home/path/to/your/files /your/user/home

Mounting HPC Storage – Mac

The steps below allow Mac users to mount HPC storage locations to their Mac. This will enable users to browse mounted drives as you would normally browse a folder. It will work when you are in the office or when working from home (via VPN).

The steps below will mount your /hpc-home/, /ei/projects/ and /ei/.project-scratch/ locations to your local Mac.

At first, from your Mac home:

Create a directory for mounting drives

cd /Users/$(whoami)
mkdir mount_drives && cd mount_drives

Create mount_drives.sh bash script to mount the drives.

cat > mount_drives.sh 
#!/bin/bash 
**First unmount before mounting **
sh /Users/$(whoami)/mount_drives/unmount_drives.sh 

**Script to mount drives **
mkdir -p /Users/$(whoami)/mount_drives/HPC_Home 
mount_smbfs //tgac-hpc-data.nbi.ac.uk/hpc-home /Users/$(whoami)/mount_drives/HPC_Home 
echo "Mounted HPC_Home with exitCode of $?" 

mkdir -p /Users/$(whoami)/mount_drives/HPC_Projects 
mount_smbfs //tgac-group-data.nbi.ac.uk/Projects /Users/$(whoami)/mount_drives/HPC_Projects 
echo "Mounted HPC_Projects with exitCode of $?" 

mkdir -p /Users/$(whoami)/mount_drives/HPC_Projects_Scratch 
mount_smbfs //tgac-group-data.nbi.ac.uk/Projects-Scratch /Users/$(whoami)/mount_drives/HPC_Projects_Scratch 
echo "Mounted HPC_Projects_Scratch with exitCode of $?" 

Create unmount_drives.sh bash script to unmount the drives.

cd /Users/$(whoami)/mount_drives 
cat > unmount_drives.sh 
#!/bin/bash 
echo
date
echo
for i in HPC_Home HPC_Projects HPC_Projects_Scratch 
    do 
        umount /Users/$(whoami)/mount_drives/${i} 
        echo "Unmounted ${i} with exitCode of $?" 
    done 

Make both bash scripts executable

cd /Users/$(whoami)/mount_drives 
chmod 755 mount_drives.sh 
chmod 755 unmount_drives.sh 

Symbolic link the scripts to your home folder for execution later

cd /Users/$(whoami) 
ln -s mount_drives/mount_drives.sh mount_drives.sh 
ln -s mount_drives/unmount_drives.sh unmount_drives.sh 

Execute the mount_drives.sh script to mount the drives

cd /Users/$(whoami) 
./mount_drives.sh 

... 
Mounted HPC_Home with exitCode of 0 
Mounted HPC_Projects with exitCode of 0 
Mounted HPC_Projects_Scratch with exitCode of 0 

Now if you go to your Mac Finder, you should be able to see the mounted drives under /Users/$(whoami)/mount_drives folder, which you can browse as you normally browse a folder.

Execute the unmount_drives.sh script to unmount the drives

cd /Users/$(whoami) 
./unmount_drives.sh 

...
Unmounted HPC_Home with exitCode of 0 
Unmounted HPC_Projects with exitCode of 0 
Unmounted HPC_Projects_Scratch with exitCode of 0 

You do not need to unmount the drives all the time before you leave work, it will be unmounted whenever you are not on the NBI network.

⚠️ **GitHub.com Fallback** ⚠️