Ceph RBD Image Mount
The article will show how to
- Mount a rbd image using the admin client
- Make it persist
The Ceph cluster we are using here is described in Ceph Cluster Deploy article.
First we need to create a pool and an rbd image in the pool.
Summary
The web content provides a detailed guide on how to mount a Ceph RBD (RADOS Block Device) image on a client node, ensuring persistence across reboots.
Abstract
The article outlines a two-part process for mounting a Ceph RBD image using the admin client and ensuring that the mount persists after system restarts. Initially, it instructs on creating a Ceph pool and an RBD image within that pool, specifying the creation of a pool named main-block-devices and an image named foo with a size of 1GB. It then guides through setting up a client node by installing ceph-common, copying the ceph.conf and ceph.client.admin.keyring files from a monitor node to the client node, and executing commands to map and mount the RBD image. The article emphasizes the importance of using the correct device reference for unmounting and provides steps to make the RBD image mount persistent through reboots by configuring the /etc/ceph/rbdmap file and updating /etc/fstab.
Opinions
/dev/main-block-devices/foo) when unmounting to avoid potential confusion or errors.rbdmap.service) and /etc/fstab entries to ensure the RBD image is remapped and mounted automatically after a system reboot.The article will show how to
The Ceph cluster we are using here is described in Ceph Cluster Deploy article.
First we need to create a pool and an rbd image in the pool.
These commands will create a pool named main-block-devices and a rbd image foo in the pool. The size of image will be 1GB.

First, install ceph-common on a ceph-client node.
sudo apt install -y ceph-commonThis will create /etc/ceph directory on the ceph-client node. Then copy /etc/ceph/ceph.conf from the ceph-mon node to /etc/ceph directory on the ceph-client node.
We also need to copy a client keyring file as well. In this example, we will use the admin client. So, copy the below file from the ceph-mon node to the ceph-client node.
/etc/ceph/ceph.client.admin.keyringOnce these two copies are done, we can run the following commands to mount a rbd image.
The last command is to unmount the disk. As you see below, when a rbd image is mapped, it appears in two ways: /dev/rbd0 and /dev/main-block-devices/foo. It is safer to use the later one. This screenshot shows when the block device is not mounted.

These map and mount will disappear once the node reboots.
First we need to add the below line in /etc/ceph/rbdmap.
main-block-devices/foo id=admin,keyring=/etc/ceph/ceph.client.admin.keyringThis rbdmap file is used by rbdmap.service. Then, restart this service.
sudo systemctl restart rbdmap.service
If this service is not enabled, make it enabled.
For mounting the disk, add the following line at /etc/fstab.
/dev/rbd/main-block-devices/foo /mnt/ceph-rbd ext4 defaults 0 0Finally, run the following command.
sudo mount -a
Rene DworschakFor my homelab, I chose a Lenovo ThinkStation P520 equipped with an Intel Xeon W-2135 and 128 GB of RAM. This combination provides an ideal…
ab1sh3kIntegrating and Managing Ceph Block Storage with OpenStack Cinder: Enabling High-Performance, Scalable Storage