Mount ceph storage on Ubuntu temporarily#

In this example, we will temporarily mount a partition of ceph in an Ubuntu machine. The mounting is temporary because it will only remain until the next reboot. To mount a partition of ceph permanently, see Mount ceph storage on Ubuntu permanently.

Prerequisites#

  • Administrator rights (sudo) on the local Ubuntu machine

  • cifs-utils installed via sudo apt-get install cifs-utils

Steps#

1. Create a mount point#

Create a directory to mount the storage to. Sensible places to do this on Ubuntu would be in /mnt or /media. In the example below, we will use /mnt/ceph-neuroinformatics.

sudo mkdir /mnt/ceph-neuroinformatics

2. Mount the ceph partition#

To mount the desired partition on the directory we just created, run the mount command with the appropriate options. In our example, this would be:

sudo mount -t cifs -o user=<SWC-USERNAME>,domain=AD.SWC.UCL.AC.UK //ceph-gw02.hpc.swc.ucl.ac.uk/neuroinformatics /mnt/ceph-neuroinformatics

Note

You can check the full set of options for the mount command by running mount --help

Make sure to replace the following for your particular case:

  • //ceph-gw02.hpc.swc.ucl.ac.uk/neuroinformatics with the path to your desired partition, e.g. //ceph-gw02.hpc.swc.ucl.ac.uk/<LAB-NAME>

  • /media/ceph-neuroinformatics with the path to the local mount point you created in the previous step.

  • <SWC-USERNAME> with your SWC username

If the command is executed without errors you will be prompted for your SWC password.

3. Check the partition is mounted correctly#

It should show up in the list of mounting points when running df -h

Note

The command df prints out information about the file system

4. To unmount the storage#

Run the following command

sudo umount /mnt/ceph-neuroinformatics

Remember that because the mounting is temporary, the ceph partition will be unmounted upon rebooting our machine.

You can check that the partition is correctly unmounted by running df -h and verifying it does not show in the output.

Warning

Do not use sudo rm -r /media/ceph-neuroinformatics to unmount, even though it looks like a local folder. This will delete files on ceph!

References#