How to create an image on RBD pool and mount

Firstly create the RBD image by specifying the pool where you’d like to create the image, along with the size of the image:

rbd create your_pool_name/your_image_name --size 20G

Map the created RBD image to a block device:

rbd map your_pool_name/your_image_name

Format the block device with the ext4 filesystem:

mkfs.ext4 /dev/rbd/your_pool_name/your_image_name

Create a directory to mount the block device to:

mkdir /mnt/rbd-mnt

Mount the RBD image to the directory created above:

mount /dev/rbd/your_pool_name/your_image_name /mnt/rbd-mnt/

You can now use the RBD image like any other mounted filesystem.

To unmap the mounted image:

rbd unmap /dev/rbd/your_pool_name/your_image_name