rbd is the Ceph command‑line client for creating, configuring, and operating Ceph Block Devices (RBD images). It lets you treat object storage as block storage that can be attached to VMs, containers, or physical hosts.
1. Prerequisites
ceph health status
Ceph cluster health – ensure the cluster is HEALTH_OK.
Authentication – you need a keyring entry with client capabilities (e.g., client.admin or a dedicated rbd client).
Ceph CLI installed – on the host where you’ll run rbd.
2. Creating an RBD Image
Step
Command
Explanation
2.1
rbd pool list
Show available pools. Choose the pool where the image will reside (e.g., rbd).
2.2
rbd create / --size --image-feature layering
Create a new image. --size is in GiB; --image-feature layering enables thin provisioning and snapshots.
2.3
Verify creation
rbd info /
Example
rbd create images/backup01 --size 50 --image-feature layering
rbd info images/backup01
The command returns a block device path, e.g., /dev/rbd0.
6.2 Format (if needed)
mkfs.ext4 /dev/rbd0
6.3 Mount the Device
mkdir -p /mnt/rbd
mount /dev/rbd0 /mnt/rbd
6.4 Unmap when finished
rbd unmap /dev/rbd0
For production use, consider using ceph-fuse or rbd-nbd for network‑block device access.
7. Common Troubleshooting
Symptom
Check
Fix
rbd: command not found
Ceph CLI installed?
apt-get install ceph (Debian/Ubuntu) or yum install ceph (RHEL).
rbd: cannot open image
Image not exists or not in correct pool
Verify with rbd ls ; create if missing.
resize failed: image is in use
Image has active snapshots or is mapped
Close snapshots (rbd snap ls), unmap (rbd unmap).
Permission denied
Keyring lacks allow r/allow w
Add capabilities: ceph auth get client. and edit keyring or create a new client with proper caps.
8. Quick Reference Cheat Sheet
# List pools
rbd pool list
# Create image (50 GiB, layering enabled)
rbd create images/backup01 --size 50 --image-feature layering
# Show image info
rbd info images/backup01
# Resize to 75 GiB
rbd resize images/backup01 75
# Create snapshot
rbd snap create images/backup01@daily-2024-10-01
# List snapshots
rbd snap ls images/backup01
# Roll back to snapshot
rbd rollback images/backup01@daily-2024-10-01
# Delete snapshot
rbd snap rm images/backup01@daily-2024-10-01
# Clone from snapshot
rbd clone images/backup01@daily-2024-10-01 images/backup01-clone
# Map image (get /dev/rbdX)
rbd map images/backup01
# Unmap image
rbd unmap /dev/rbdX
9. Where to Find More Information
Ceph Documentation –
Man page – man rbd on any Ceph client host.
Remember: Always test resize or snapshot operations on a non‑production image first, and keep regular backups of critical RBD data.
This FAQ was generated and/or edited by GAIN, GENs Artificial Intelligence Network and should not be considered 100% accurate. Always check facts and do your research, things change all the time. If you are unsure about any information provided, please raise a support ticket for clarification.
This website relies on temporary cookies to function, but no personal data is ever stored in the cookies.