Skip to content

Mount a NAS share#

This how-to is intended to explain how a non-privileged user can mount a NAS share on our Jed or Helvetios front-end using the SMB / CIFS protocols.

Availability

The explanation are given for the Jed and Helvetios clusters, as this is, at the moment, the only clusters where the necessary software is installed. Please contact us if you would need to use it in the other clusters.

In the following examples, <username> means your EPFL Gaspar username.



Access to the cluster's front-end#

ssh <username>@jed.epfl.ch


Preparing the environment#

The tools used require a running dbus session, the recommended method is to start a shell with a dedicated session:

dbus-run-session -- bash

The session above needs to be running for the whole duration of any file transfers. For file operations lasting for longer times you can start the above inside a screen session. It allows you to quit your session without killing the mount.

  • Open a screen session:
    screen -R <any_name>
    
  • From your screen session, start the dbus session as above:
    dbus-run-session -- bash
    


Mounting your share#

Variable instead of a long command

Instead of typing the long command, such as smb://intranet\;<username>@<nas_server>/<share_name>, you can use a variable:

MYSHARE="smb://intranet;<username>@<nas_server>/<share_name>"
:warning: Without the backslash before the semicolon " ; "


To mount your NAS share:

gio mount smb://intranet\;<username>@<nas_server>/<share_name>
For example:
gio mount smb://intranet\;john@vpsi1files.epfl.ch/scitas-ge

Or with the variable:

gio mount $MYSHARE


Warning

If the following error appears:
gio: smb://INTRANET;[USERNAME]@[SHARE]: volume doesn’t implement mount
You may
- have forgotten to prepare your environment
- be using Conda. Just deactivate it (conda deactivate)


Available Shares

To find the available shares in the NAS Server:

smbclient -W INTRANET -U <username> -L <nas_server>
For example:
smbclient -W INTRANET -U john -L vpsi1files.epfl.ch



Basic gio commands#

Get a list of files#

gio list smb://intranet\;<username>@<nas_server>/<share_name>

List files in a tree mode#

gio tree smb://intranet\;<username>@<nas_server>/<share_name>

Copy files#

  • From the share:
    gio copy smb://intranet\;<username>@<nas_server>/<share_name> <destination_path>
    
    For example
    gio copy smb://intranet\;john@vpsi1files.epfl.ch/scitas-ge/Doc/my\ doc.txt /scratch/john/
    

Escaping the whitespace character

In this last example, the file to copy has a space in its name. That's why the
space has to be backslashed (my\ doc.txt).
  • To the share:
    gio copy [YOUR_FILE] smb://intranet\;<username>@<nas_server>/<share_name>/
    

Unmount your share#

gio mount -u smb://intranet\;<username>@<nas_server>/<share_name>

Or, if you are using screen, simply quit the session:

exit # twice



Direct access to your share#

The gio mount command actually mounts your share to /run/user/<userid>/gvfs/<mount_data_dir>.

For example:

/run/user/123456/gvfs/smb-share:domain=intranet,server=files7.epfl.ch,share=data,user=john

Part of this path can be found thanks to the $XDG_RUNTIME_DIR variable:

echo $XDG_RUNTIME_DIR

/run/user/[YOUR_USERID]
But the preferred method is to use gio sub-commands instead.


Last update: July 4, 2023