Skip to main content
RunBook Academy

CephCV · Backup StrategyBackup Strategy

File-level and object-level backup paths

Intermediate⏱ ~18 minrsyncrcloneceph

What you'll learn

  • Compare backup at the file, object, and block layers
  • Back up CephFS and RGW contents
  • Recognise where file-level backup is the correct choice
  • Handle the scale problems it creates

Prerequisites

None — start here.

Verified against Ceph Tentacle 20.2.x · Ceph Squid 19.2.x (supported previous) · cephadm matches the verified Ceph release · podman 4.x · csi-rbd and csi-cephfs current · RBD / CephFS / RGW current (matches Ceph release) · Linux kernel 5.15+ (5.10 minimum) · Ubuntu 24.04 LTS (Ceph host baseline) · Debian 12 (Bookworm) (Ceph host baseline) · Rocky Linux / RHEL / AlmaLinux 9.x (Ceph host baseline) · Proxmox VE 9.x (cross-course integration) · Kubernetes 1.31+ (cross-course integration) · 2026-08-18

Not yet marked complete on this device.

Why this matters in production

Backing up at the file layer produces a copy anything can read, which is often worth more than efficiency.

The three layers

LayerProducesRestores
Block (rbd export)an image filethe whole image
File (rsync from a mount)a file treeany subset, anywhere
Object (rclone, s3 sync)objects in a bucketany subset
The file and object layers give granular restore and portability. The
block layer gives efficiency and crash consistency.
# file layer, from a CephFS mount
rsync -aHAX --numeric-ids --delete \
  /mnt/cephfs/tenants/acme/ backup-host:/backups/acme/
# object layer, RGW to an external target
rclone sync ceph-rgw:acme-bucket external-s3:acme-backup \
  --transfers 16 --checksum

Where file-level is the correct choice

SituationWhy
Restores are usually of single filesgranular restore is the point
The backup target is not Cephportability matters
The data is already a file treeno translation needed
Long retention with deduplicationfile-level tools handle it
Restore must be possible without Cephthe copy is readable anywhere
The last is the one that decides it for many organisations: an image
file from rbd export needs Ceph or a compatible tool to open. A file
tree needs nothing.

The scale problems

File-level backup walks the tree. On a filesystem with tens of millions
of files, the walk itself becomes the bottleneck.
ceph fs status
ceph tell mds.0 perf dump 2>/dev/null | python3 -c '
import sys,json
d = json.load(sys.stdin).get("mds", {})
print("inodes:", d.get("inodes"), " caps:", d.get("caps"))'
ProblemMitigation
Metadata walk dominatesuse snapshots and diff, not full walks
MDS load from the walkrun backups against a snapshot mount
Backup window exceededparallelise by subtree
Changed-file detection is expensiveuse rsync with a file list from a snapshot diff
# back up from a snapshot rather than the live tree
# The subvolume's UUID directory, from
# `ceph fs subvolume getpath cephfs acme --group_name tenants`:
SUBVOL_UUID=4d2b8c1e-9f0a-4c7d-b2e1-8a3f5c6d7e90

ceph fs subvolume snapshot create cephfs acme snap-nightly --group_name tenants
# the snapshot is visible under the subvolume's .snap directory
rsync -aHAX "/mnt/cephfs/volumes/tenants/acme/$SUBVOL_UUID/.snap/snap-nightly/" \
  backup-host:/backups/acme/
Backing up from a snapshot gives a consistent view and removes the race
between the walk and ongoing writes.

Verifying

# counts and sizes should agree
find /mnt/cephfs/tenants/acme -type f | wc -l
ssh backup-host 'find /backups/acme -type f | wc -l'
rclone check ceph-rgw:acme-bucket external-s3:acme-backup --one-way

Quiz

Knowledge check · 4 questions

  1. Q1. Why back up CephFS from a snapshot rather than the live tree?

  2. Q2. Block-level backup is always preferable to file-level backup because it is more efficient.

  3. Q3. Choose a backup layer.

    A CephFS filesystem holds a departmental file share. Restores are almost always of a single accidentally-deleted file, and the backup target is a generic NAS.

  4. Q4. What becomes the bottleneck in file-level backup at scale?

Passing score: 75%. Answers are checked in this browser.

Production discipline

Create a snapshot and read from .snap rather than walking the live tree — a live walk races ongoing writes and produces a copy that reflects no single point in time. Choose file-level backup where restores are granular or the target is not Ceph.

Cross-course references

  • Kubernetes: volume snapshots before backup exist for the same consistency reason
  • Linux: a filesystem walk during writes captures no coherent moment