33.5. Using and Maintaining Ceph Storage
Ceph exposes three client interfaces over the same RADOS object store. RBD presents a block device built from objects, CephFS presents a POSIX filesystem whose metadata is managed by metadata servers, and the RADOS Gateway presents an S3-compatible object API. They share pools, OSDs, CRUSH placement, and the cephx authentication database, but they have different client tools and different failure semantics.
33.5.1. RBD Block Devices and Client Authentication
RBD is the simplest Ceph interface to understand: an image is a named object
set in a pool, and rbd map connects it to the kernel's block layer through
librbd. The client still needs a filesystem, a database, or another
block-device consumer on top; RBD does not provide files.
Ceph clients authenticate with cephx. On storage1, as root, create a client
identity with only the capabilities it needs:
# ceph auth get-or-create client.handbook \
mon 'allow r' \
osd 'allow class-read object_prefix rbd_children, allow rwx pool=rbdpool' \
mds 'allow rw' \
-o /etc/ceph/ceph.client.handbook.keyring
The command writes the keyring to the named file; without -o, the same
command prints the entity and capabilities. The key itself must be protected
like a password; do not paste it into tickets or shell history. Copy the keyring and /etc/ceph/ceph.conf to
the client through your normal authenticated file transfer and set the file
mode to 0600.
On client1, as john, verify that the identity works:
$ sudo ceph -s --id handbook
cluster:
id: a2fd83c0-85a8-4b10-8b2d-6cf6a067ef46
health: HEALTH_WARN
13 mgr modules have failed dependencies
3 monitors have not enabled msgr2
5 pool(s) do not have an application enabled
services:
mon: 3 daemons, quorum storage1,storage2,storage3 (age 6m)
mgr: storage1(active, since 4h)
mds: 1/1 daemons up
osd: 3 osds: 3 up (since 24m), 3 in (since 78m)
rgw: 1 daemon active (1 hosts, 1 zones)
data:
volumes: 1/1 healthy
pools: 12 pools, 248 pgs
objects: 266 objects, 62 KiB
usage: 353 MiB used, 5.6 GiB / 6.0 GiB avail
pgs: 248 active+clean
Selected output; the I/O counters are omitted. The identity can read the
cluster map and the rbdpool, which is enough for the block exercises. It
cannot administer monitors or write to unrelated pools. Granting
client.admin to an application client is a common and unnecessary mistake.
On storage1, as root, create an image:
# rbd create --size 256M rbdpool/handbook-volume
The RBD subcommands used in this section are:
| Subcommand | Purpose |
|---|---|
create --size |
create an image of the given size in a pool |
info |
report size, object order, features, and timestamps |
ls |
list the images in a pool |
map --id |
attach the image to the local kernel as /dev/rbdN |
device list |
show current mappings and their device names |
snap create, snap ls, snap rollback |
create, list, and restore a point-in-time view |
export, import |
write or read a standalone image file for an independent backup |
The command normally prints nothing on success. On storage1, as root,
inspect the image to confirm its size, object order, and features:
# rbd info rbdpool/handbook-volume
rbd image 'handbook-volume':
size 256 MiB in 64 objects
order 22 (4 MiB objects)
snapshot_count: 0
id: 6a52b7a208a8f
block_name_prefix: rbd_data.6a52b7a208a8f
format: 2
features: layering, exclusive-lock, object-map, fast-diff, deep-flatten
op_features:
flags:
create_timestamp: Thu Nov 26 02:54:24 2026
access_timestamp: Thu Nov 26 02:54:24 2026
modify_timestamp: Thu Nov 26 02:54:24 2026
The exclusive-lock feature is what lets Ceph enforce a single writer for
filesystems that require it. It does not turn RBD into a cluster filesystem;
mapping the same image on two hosts still requires the same single-writer
discipline as a local disk. The image is divided into 4 MiB objects, which are
placed by CRUSH across the pool's PGs.
On client1, map the image with the restricted identity:
$ sudo rbd map rbdpool/handbook-volume --id handbook
/dev/rbd0
The device name is assigned by the kernel and can differ if other RBD images
are already mapped. On client1, as john, rbd device list shows the
mapping:
$ sudo rbd device list
id pool namespace image snap device
0 rbdpool handbook-volume - /dev/rbd0
On client1, as john, create a filesystem on the block device:
$ sudo mkfs.ext4 -F -L ceph-rbd /dev/rbd0
Discarding device blocks: 0/262144 done
Creating filesystem with 262144 1k blocks and 65536 inodes
Filesystem UUID: 23756fcd-cccd-4067-8bae-bbaa3ca7bc39
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729, 204801, 221185
Allocating group tables: 0/32 done
Writing inode tables: 0/32 done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: 0/32 done
On client1, as john, mount it and write a file:
$ sudo mkdir -p /mnt/rbd
The command normally prints nothing. Mount the image:
$ sudo mount /dev/rbd0 /mnt/rbd
The mount normally prints nothing. Write a file:
$ sudo sh -c 'echo rbd-client-data > /mnt/rbd/rbd-file.txt'
The sh -c wrapper is part of the command, not scaffolding: sudo elevates
only the program it runs, while the > redirection is performed by john's
own shell before sudo starts. Wrapping the redirection in a root shell makes
the write land as root inside the mounted filesystem. Read it back:
$ cat /mnt/rbd/rbd-file.txt
rbd-client-data
The write goes through the client's page cache, through librbd, to the
primary OSD for each object, and then to the replicas. The client does not
know which OSDs hold the objects; the OSD map and CRUSH do that. Before
unmounting, run sync or unmount normally so the filesystem flushes its dirty
pages.
33.5.2. CephFS, Metadata Servers, and Client Mounts
CephFS adds a filesystem layer on top of RADOS. Metadata servers (ceph-mds)
manage the directory tree, inodes, and distributed metadata locks; data objects
live in the data pool. A CephFS mount needs a metadata server, an active
monitor quorum, and a client identity with both MDS and OSD capabilities.
On storage1, as root, the filesystem and its pools are separate from the block pool:
# ceph fs ls
name: cephfs, metadata pool: cephfs_metadata, data pools: [cephfs_data ]
# ceph mds stat
cephfs:1 {0=storage1=up:active}
ceph fs ls shows the filesystem name and its pools. ceph mds stat shows one
active metadata server on storage1; the {0=...} field is the MDS rank and
state. The filesystem was created during deployment with
ceph fs new cephfs cephfs_metadata cephfs_data after the two pools existed,
and the metadata server runs as the ceph-mds@storage1 unit. A production
CephFS should have a standby MDS so a metadata server failure does not
interrupt the namespace.
On client1, as john, mount the filesystem with ceph-fuse using the
client.handbook keyring:
$ sudo mkdir -p /mnt/cephfs
The command normally prints nothing. Start the userspace client:
$ sudo ceph-fuse -n client.handbook /mnt/cephfs
ceph-fuse starts a userspace client and normally prints initialization lines
before returning to the shell. On client1, confirm the mount and write a
file:
$ findmnt /mnt/cephfs
TARGET SOURCE FSTYPE OPTIONS
/mnt/cephfs ceph-fuse fuse.ceph-fuse rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other
$ sudo sh -c 'echo cephfs-client-data > /mnt/cephfs/cephfs-file.txt'
The write normally prints nothing. Read it back:
$ cat /mnt/cephfs/cephfs-file.txt
cephfs-client-data
The kernel client is an alternative when the host has the ceph module and a
keyring. The steps below are the documented alternative path; the walkthrough
above used ceph-fuse. On storage1, as root, extract the client's secret
into a file that contains only the key:
# ceph auth get-key client.handbook > /etc/ceph/handbook.secret
The redirection writes the key to the file; the command normally prints nothing. Protect it:
# chmod 600 /etc/ceph/handbook.secret
Copy /etc/ceph/handbook.secret to client1 through the authenticated file
transfer, protect it there, and on client1, as john, mount with:
$ sudo mount -t ceph :/ /mnt/cephfs -o name=handbook,secretfile=/etc/ceph/handbook.secret
The :/ denotes the CephFS root; name selects the cephx entity and
secretfile points to the file containing the secret. The kernel client
avoids the FUSE process and usually has lower overhead, but the userspace
client is easier to run on a host whose kernel modules do not match the
cluster. Unmount either with
umount /mnt/cephfs; stop a foreground ceph-fuse with Ctrl-C if it was
started with -f.
33.5.3. Object Storage with RADOS Gateway and Its Access Model
The RADOS Gateway (radosgw) exposes RADOS through S3 and Swift APIs. It is a
stateless HTTP front end: clients authenticate with S3 access and secret keys,
create buckets, and put objects. The gateway maps buckets and objects into
RADOS pools named default.rgw.* (or a custom zone), so the same replication
and CRUSH rules apply.
Deployment is mostly pool preparation. The gateway's default.rgw.* pools
and the .rgw.root pool must exist before its first start; with the packaged
18.2.7 the automatic pool-creation path does not set the placement-group
counts and fails, so the pools are created explicitly with
ceph osd pool create. The [client.rgw.storage1] section in
/etc/ceph/ceph.conf selects the beast frontend on port 7480, and the
daemon runs as ceph-radosgw@rgw.storage1.
On storage1, as root, confirm the daemon is running:
# systemctl is-active ceph-radosgw@rgw.storage1
active
On storage1, as root, create an object user:
# radosgw-admin user create --uid=handbook --display-name="Handbook User"
The command prints the user record, including an access key and a secret key.
Treat the secret like a password; it is shown only when generated or when you
explicitly request it. The s3cmd client reads credentials from ~/.s3cfg.
On client1, as john, create ~/.s3cfg with the practice gateway's
values:
[default]
access_key = HANDBOOKACCESS
secret_key = HANDBOOKSECRET
host_base = 192.168.234.11:7480
host_bucket = 192.168.234.11:7480
use_https = False
The values are disposable example credentials, not a recommendation to put
secrets in a world-readable file. Set chmod 600 ~/.s3cfg. For a real gateway, use
TLS (use_https = True, port 443), a certificate the clients trust, and keys
issued to a named application rather than a shared human account.
On client1, as john, create a bucket, upload a file, and list the bucket:
$ cd ~/debian-handbook/shared-storage
The command normally prints nothing. Create the object file:
$ echo object-data > s3-object.txt
Create the bucket:
$ s3cmd mb s3://handbook-bucket
Bucket 's3://handbook-bucket/' created
Upload the object:
$ s3cmd put s3-object.txt s3://handbook-bucket/object.txt
upload: 's3-object.txt' -> 's3://handbook-bucket/object.txt' (12 bytes in 0.6 seconds, 19.92 B/s) [1 of 1]
List the bucket:
$ s3cmd ls s3://handbook-bucket/
2026-11-26 02:56 12 s3://handbook-bucket/object.txt
The bucket is a namespace, not a directory on a mounted filesystem. There is no
mount step and no POSIX lock; clients use HTTP and the S3 access model. The
gateway is the only component that talks to RADOS for these requests, so its
availability matters to object clients even though the OSDs hold the data. Run
more than one gateway behind a load balancer for production object service.
The gateway's access model has three layers: the cephx identity used by the
gateway daemon, the S3 user and key pair used by the client, and the bucket
policy that controls which S3 users may read or write which prefixes. The
radosgw-admin command manages users, buckets, quotas, and policies; s3cmd
or an application SDK manages objects. Do not confuse the S3 secret key with
the cephx key: they authenticate different hops.
33.5.4. Inspecting Health, Capacity, Recovery, and Scrubbing
ceph -s is the first command to run on any Ceph problem. On storage1, as
root, it summarizes the monitor quorum, manager, OSD up/in counts, metadata
servers, gateways, pool and object counts, capacity, and PG states:
# ceph -s
cluster:
id: a2fd83c0-85a8-4b10-8b2d-6cf6a067ef46
health: HEALTH_WARN
13 mgr modules have failed dependencies
3 monitors have not enabled msgr2
5 pool(s) do not have an application enabled
services:
mon: 3 daemons, quorum storage1,storage2,storage3 (age 8m)
mgr: storage1(active, since 4h)
mds: 1/1 daemons up
osd: 3 osds: 3 up (since 26m), 3 in (since 80m)
rgw: 1 daemon active (1 hosts, 1 zones)
data:
volumes: 1/1 healthy
pools: 12 pools, 248 pgs
objects: 317 objects, 10 MiB
usage: 368 MiB used, 5.6 GiB / 6.0 GiB avail
pgs: 248 active+clean
Selected output; the I/O counters are omitted. HEALTH_WARN is not the same as an outage. This cluster is serving data with
all PGs active+clean, but it reports three real configuration warnings. On
storage1, as root, read the detail before deciding whether to act:
# ceph health detail
HEALTH_WARN 13 mgr modules have failed dependencies; 3 monitors have not enabled msgr2; 5 pool(s) do not have an application enabled
[WRN] MGR_MODULE_DEPENDENCY: 13 mgr modules have failed dependencies
Module 'balancer' has failed dependency: PyO3 modules do not yet support subinterpreters, see https://github.com/PyO3/pyo3/issues/576
...
[WRN] MON_MSGR2_NOT_ENABLED: 3 monitors have not enabled msgr2
mon.storage1 is not bound to a msgr2 port, only v1:192.168.234.11:6789/0
...
[WRN] POOL_APP_NOT_ENABLED: 5 pool(s) do not have an application enabled
application not enabled on pool 'default.rgw.control'
...
use 'ceph osd pool application enable <pool-name> <app-name>', where <app-name> is 'cephfs', 'rbd', 'rgw', or freeform for custom applications.
Selected output; the repeated module and pool lines are omitted. The manager warning comes from Python modules that cannot run in the packaged manager's subinterpreter environment; the core mon/osd/mds/rgw services still work. The monitor warning is cleared by enabling msgr2. The pool warning is cleared by setting an application on each pool that is actually in use. Fixing warnings is better than silencing them; a health check that always warns is a health check nobody reads.
Capacity has two views. ceph df reports raw device capacity and per-pool
logical usage; ceph osd df reports per-OSD utilization and variance:
# ceph df
--- RAW STORAGE ---
CLASS SIZE AVAIL USED RAW USED %RAW USED
hdd 6.0 GiB 5.6 GiB 353 MiB 353 MiB 5.75
TOTAL 6.0 GiB 5.6 GiB 353 MiB 353 MiB 5.75
--- POOLS ---
POOL ID PGS STORED OBJECTS USED %USED MAX AVAIL
rbdpool 1 32 19 B 3 12 KiB 0 1.7 GiB
cephfs_data 2 32 19 B 1 12 KiB 0 1.7 GiB
cephfs_metadata 3 16 55 KiB 22 254 KiB 0 1.7 GiB
default.rgw.meta 4 16 676 B 3 25 KiB 0 1.7 GiB
...
Selected output; the remaining gateway and test pools are omitted. The
MAX AVAIL column is the usable capacity a new object can consume given the
pool's replication and the current CRUSH weights; it is smaller than the raw
capacity. On storage1, as root, ceph osd df reports per-OSD utilization and
variance:
# ceph osd df
ID CLASS WEIGHT REWEIGHT SIZE RAW USE DATA OMAP META AVAIL %USE VAR PGS STATUS
0 hdd 0.00189 1.00000 2.0 GiB 154 MiB 4.3 MiB 1 KiB 150 MiB 1.8 GiB 7.53 1.31 248 up
1 hdd 0.00189 1.00000 2.0 GiB 154 MiB 4.3 MiB 1 KiB 150 MiB 1.8 GiB 7.53 1.31 248 up
2 hdd 0.00189 1.00000 2.0 GiB 45 MiB 4.3 MiB 15 KiB 40 MiB 2.0 GiB 2.19 0.38 248 up
TOTAL 6.0 GiB 353 MiB 13 MiB 19 KiB 340 MiB 5.6 GiB 5.75
MIN/MAX VAR: 0.38/1.31 STDDEV: 2.52
VAR compares each OSD's utilization with the cluster average; a value far
from 1 means the CRUSH weights or the PG distribution are uneven. Here the
spread reflects the small device size and uneven object distribution; the
newest OSD carries less data. On a production cluster, large VAR values after
a rebalance or OSD replacement are worth investigating.
Scrubbing verifies object checksums and replicas. A normal scrub is scheduled
automatically; on storage1, as root, an explicit scrub is useful after a
repair or before a backup:
# ceph pg scrub 1.0
instructing pg 1.0 on osd.1 to scrub
The command returns immediately; the scrub runs in the background. A light
scrub compares object size and metadata across the replicas; a deep scrub also
reads the data and verifies it with checksums. ceph -s shows the PG states;
ceph pg dump_stuck lists PGs that are not progressing. Scrubbing consumes
I/O and can affect latency, so schedule deep scrubs outside peak hours on a
busy cluster.
33.5.5. Replacing an OSD and Testing a Node Failure
An OSD replacement is a controlled removal and re-creation of one daemon's
storage. The cluster keeps serving from the other replicas, but capacity and
redundancy are reduced until the new OSD is back in and backfill completes.
The order matters: mark the OSD out so CRUSH stops placing new data on it,
stop the daemon, purge its identity, wipe the disposable device, and let
ceph-volume create a new OSD. Do not purge an OSD that still holds the only
copy of any PG; check ceph -s and the PG states first.
On storage1, identify the OSD on storage3:
# ceph osd tree
ID CLASS WEIGHT TYPE NAME STATUS REWEIGHT PRI-AFF
-1 0.00568 root default
-3 0.00189 host storage1
0 hdd 0.00189 osd.0 up 1.00000 1.00000
-5 0.00189 host storage2
1 hdd 0.00189 osd.1 up 1.00000 1.00000
-7 0.00189 host storage3
2 hdd 0.00189 osd.2 up 1.00000 1.00000
On storage1, as root, mark it out:
# ceph osd out 2
marked out osd.2.
The command prints one line. On storage3, stop the unit:
# systemctl stop ceph-osd@2
The stop normally prints nothing. On storage1, as root, purge the OSD's
authentication and CRUSH entries:
# ceph osd purge 2 --yes-i-really-mean-it
purged osd.2
The --yes-i-really-mean-it flag is required because purge removes the OSD's
identity and cannot be undone. The data on the device is now unreferenced; the
replicas on the other hosts still serve clients, but the pool is degraded.
On storage3, as root, wipe the disposable device and create a new OSD on it:
# ceph-volume lvm zap /dev/vdc --destroy
--> Zapping: /dev/vdc
--> Unmounting /var/lib/ceph/osd/ceph-2
...
--> Zapping successful for: <Raw Device: /dev/vdc>
Selected output; the LVM removal details are omitted. The --destroy flag
removes the volume group and any leftover signatures. This is destructive:
run it only on the device that was just purged, never on a device that belongs
to a mounted filesystem or another OSD.
# ceph-volume lvm create --data /dev/vdc
Running command: /usr/bin/ceph-osd --cluster ceph --osd-objectstore bluestore --mkfs -i 2 ...
--> ceph-volume lvm prepare successful for: /dev/vdc
...
--> ceph-volume lvm activate successful for osd ID: 2
--> ceph-volume lvm create successful for: /dev/vdc
Selected output; the repeated BlueStore label messages and the long command
lines are omitted. The new OSD receives the lowest free ID; here the purged
ID 2 was free again, so the replacement is osd.2. ceph-volume enables a
ceph-volume@lvm-2-... unit that activates the OSD at boot and starts
ceph-osd@2 immediately. The OSD joins the CRUSH map; backfill begins as the
cluster restores three replicas on three hosts.
On storage1, as root, watch the recovery and confirm that all OSDs are up:
# ceph -s
cluster:
id: a2fd83c0-85a8-4b10-8b2d-6cf6a067ef46
health: HEALTH_WARN
...
services:
mon: 3 daemons, quorum storage1,storage2,storage3 (age 10m)
mgr: storage1(active, since 4h)
mds: 1/1 daemons up
osd: 3 osds: 3 up (since 19s), 3 in (since 60s); 38 remapped pgs
rgw: 1 daemon active (1 hosts, 1 zones)
data:
...
pgs: 13.306% pgs unknown
28.226% pgs not active
219/753 objects degraded (29.084%)
97 active+clean
65 peering
47 active+recovery_wait+degraded
33 unknown
5 remapped+peering
1 active+recovering+degraded
Selected output; the warning summary, capacity, and I/O lines are omitted. The exact
recovery percentages and times depend on the data size and the
network. Wait for active+clean before declaring the replacement finished.
Do not run a second replacement, a scrub, or a large client write while
backfill is saturating the cluster. The node-failure exercise below reboots
storage3 while this backfill is still running; that is a deliberately harder
case. In a production change window, wait for active+clean before introducing
a second failure.
A node failure is a different test: the whole host, including its monitor,
manager, and network, disappears at once. On storage3, reboot the host:
# systemctl reboot
The SSH connection closes and the command does not return normally. Wait for
the host to boot. On storage1, as root, check that the monitor quorum has all
three members again and that its OSD is up:
# ceph -s
cluster:
id: a2fd83c0-85a8-4b10-8b2d-6cf6a067ef46
health: HEALTH_WARN
...
services:
mon: 3 daemons, quorum storage1,storage2,storage3 (age 35s)
mgr: storage1(active, since 4h)
mds: 1/1 daemons up
osd: 3 osds: 3 up (since 23s), 3 in (since 2m)
rgw: 1 daemon active (1 hosts, 1 zones)
data:
...
pgs: 639/951 objects degraded (67.192%)
161 active+clean
78 active+recovery_wait+degraded
8 active+recovery_wait
1 active+recovering+degraded
Selected output; the warning summary, capacity, and I/O lines are omitted. After a
reboot during backfill, the cluster can serve data with quorum while it is not
yet fully redundant. Wait for active+clean before the next disruptive action.
A clean reboot is the easy case: the daemons stop in order, the monitor rejoins,
and the OSD catches up from its journal and peers. A power loss or a
kernel panic is harder, because the OSD may have unreferenced writes and the
monitor may have to recover its session state. The same commands apply, but
allow more time and inspect ceph health detail for OSD_DOWN,
MON_DOWN, or PG_DEGRADED before intervening.
33.5.6. Snapshots, Independent Backups, and Restoring Client Data
An RBD snapshot is a point-in-time view of an image. It is copy-on-write
inside the same pool, so it costs little until the image changes. It is not an
independent backup: a snapshot shares the pool's failure domains, and a
mistaken rbd rm or a pool loss can remove both the image and its snapshots.
On client1, as john, create a snapshot after flushing the client's writes:
$ sudo sync
The command normally prints nothing. Create the snapshot:
$ sudo rbd snap create rbdpool/handbook-volume@before-change --id handbook
Creating snap: 10% complete...
Creating snap: 100% complete...done.
The snapshot is created inside the pool and shares its failure domains. On
client1, as john, list the snapshots:
$ sudo rbd snap ls rbdpool/handbook-volume --id handbook
SNAPID NAME SIZE PROTECTED TIMESTAMP
20 before-change 256 MiB Thu Nov 26 02:55:08 2026
Rolling back replaces the image's current contents with the snapshot. It is
destructive to changes made after the snapshot, and the image must not be
mapped or mounted. On client1, as john, unmount and unmap it before
rolling back:
$ sudo umount /mnt/rbd
The command normally prints nothing. Unmap the image:
$ sudo rbd unmap /dev/rbd0
The command normally prints nothing. Roll back:
$ sudo rbd snap rollback rbdpool/handbook-volume@before-change --id handbook
Rolling back to snapshot: 1% complete...
...
Rolling back to snapshot: 100% complete...done.
Selected output; the intermediate percentages are omitted. On client1, as
john, map and mount again to verify the restored content:
$ sudo rbd map rbdpool/handbook-volume --id handbook
/dev/rbd0
$ sudo mount /dev/rbd0 /mnt/rbd
The mount normally prints nothing. Read the file:
$ cat /mnt/rbd/rbd-file.txt
rbd-client-data
A snapshot rollback is useful for a bad application upgrade or an accidental
file deletion, but it is not a disaster-recovery plan. On client1, as
john, export the image to a different host and a different storage system
for that:
$ sudo umount /mnt/rbd
The command normally prints nothing. Unmap the image:
$ sudo rbd unmap /dev/rbd0
The command normally prints nothing. Export it:
$ sudo rbd export --id handbook rbdpool/handbook-volume \
/home/john/debian-handbook/shared-storage/rbd-backup.img
Exporting image: 1% complete...
...
Exporting image: 100% complete...done.
Selected output; the intermediate percentages are omitted. Compute the checksum on the client:
$ sha256sum /home/john/debian-handbook/shared-storage/rbd-backup.img
cf415aa15972c4ac83b85e7d7f43bd12b4f1f105d0b31f7d4ee54f19e82ef781 /home/john/debian-handbook/shared-storage/rbd-backup.img
The checksum belongs to this 256 MiB practice image, not to an installer or a distribution image. Store the export on storage that is independent of the Ceph cluster, verify the checksum there, and keep the snapshot list and the export checksum together so a restore can be verified.
On client1, as john, import the file as a new image rather than
overwriting the original:
$ sudo rbd import --id handbook \
/home/john/debian-handbook/shared-storage/rbd-backup.img \
rbdpool/restored-volume
Importing image: 1% complete...
...
Importing image: 100% complete...done.
Selected output; the intermediate percentages are omitted.
$ sudo rbd info rbdpool/restored-volume --id handbook
rbd image 'restored-volume':
size 256 MiB in 64 objects
order 22 (4 MiB objects)
snapshot_count: 0
id: 6a4ea9408577c
...
Selected output. Importing under a new name preserves the original image and lets you compare the restored data before switching clients. Mount the restored image, run the application's consistency check, and only then replace the production image or its clients.
For CephFS, snapshots are a filesystem feature rather than an RBD feature, and the recovery unit is the directory or file. The same principle applies: a snapshot in the same cluster is convenient but not independent; a backup must leave the cluster. For object storage, bucket versioning and lifecycle rules protect against overwrites, but a copy in another cluster or an object store is still required for site loss.