From ff4dbb772721488c08a263c7a30b4f0c693b53fb Mon Sep 17 00:00:00 2001 From: sfmig <33267254+sfmig@users.noreply.github.com> Date: Wed, 15 Nov 2023 18:48:27 +0100 Subject: [PATCH] add HowTo guide for mounting ceph temporarily --- .../programming/Mount-ceph-ubuntu-temp.md | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 docs/source/programming/Mount-ceph-ubuntu-temp.md diff --git a/docs/source/programming/Mount-ceph-ubuntu-temp.md b/docs/source/programming/Mount-ceph-ubuntu-temp.md new file mode 100644 index 0000000..6d1a1ee --- /dev/null +++ b/docs/source/programming/Mount-ceph-ubuntu-temp.md @@ -0,0 +1,53 @@ +# Mount ceph storage on Ubuntu temporarily +In this example, we will **temporarily** mount a partition of `ceph` in an Ubuntu machine. The mounting is temporarily because it will only remain until the next reboot. To mount a partition of `ceph` permanently, see [Mount ceph storage on Ubuntu](Mount-ceph-ubuntu.md). + + +## 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`. + +```bash +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: +```bash +sudo mount -t cifs -o user=,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/` +- `/media/ceph-neuroinformatics` with the path to the local mount point you created in the previous step. +- `` 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 +```bash +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. + + +### References +- [Mount network drive under Linux temporarily/permanently](https://www.rz.uni-kiel.de/en/hints-howtos/connecting-a-network-share/Linux/through-temporary-permanent-mounting/mount-network-drive-under-linux-temporarily-permanently) +- [How to Mount a SMB Share in Ubuntu](https://support.zadarastorage.com/hc/en-us/articles/213024986-How-to-Mount-a-SMB-Share-in-Ubuntu) \ No newline at end of file