Mount a NAS share#
This how-to is intended to explain how a non-privileged user can mount a NAS share on our front-ends using the SMB / CIFS protocols.
Choose the right username
In the following examples, <username> means your
EPFL Gaspar username.
Access to the cluster's front-end#
Preparing the environment#
The tools used require a running dbus session, the recommended method is to start a shell with a dedicated session:
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:
- From your screen session, start the dbus session as above:
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:
without the backslash before the semicolon " ; "
To mount your NAS share:
For example:
Or with the variable:
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:
For example:
Basic gio commands#
Get a list of files#
List files in a tree mode#
Copy files#
From the share#
For example
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#
Unmount your share#
Or, if you are using screen, simply quit the session:
Direct access to your share#
The gio mount command actually mounts your share to
/run/user/<userid>/gvfs/<mount_data_dir>.
For example:
Part of this path can be found thanks to the $XDG_RUNTIME_DIR variable:
But the preferred method is to use gio sub-commands instead.