CephLXI · ScrubbingScrubbing
When a scrub finds a problem
What you'll learn
- Interpret the scrub-related health checks
- Distinguish the failure types
- Locate the affected objects
- Decide the immediate response
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
Why this matters in production
A scrub failure means the cluster has found data it cannot vouch for. Reading the report correctly determines whether this is a routine device failure or a genuine data integrity event.
The health checks
ceph health detail
| Check | Meaning |
|---|---|
PG_DAMAGED | a scrub found inconsistencies in one or more PGs |
OSD_SCRUB_ERRORS | a count of scrub errors across the cluster |
PG_NOT_SCRUBBED | PGs overdue for a shallow scrub |
PG_NOT_DEEP_SCRUBBED | PGs overdue for a deep scrub |
The first two indicate found problems; the last two indicate the checking itself is not happening.
HEALTH_ERR 1 scrub errors; Possible data damage: 1 pg inconsistent
[ERR] OSD_SCRUB_ERRORS: 1 scrub errors
[ERR] PG_DAMAGED: Possible data damage: 1 pg inconsistent
pg 3.1f is active+clean+inconsistent, acting [12,4,19]
The failure types
rados list-inconsistent-obj 3.1f --format=json-pretty
| Error | Meaning |
|---|---|
read_error | the OSD could not read the object — a device problem |
data_digest_mismatch | the data’s checksum differs from the recorded one |
omap_digest_mismatch | the object’s key-value data differs |
size_mismatch | the replicas disagree on size |
attr_name_mismatch | an extended attribute differs |
missing | a replica does not have the object |
read_error is the most common and the least alarming: the device
reported a failure, the OSD knows which copy is bad, and repair is
unambiguous.
A digest mismatch without a read error is more serious — the device returned data successfully and the data was wrong, which is silent corruption.
Locating the affected objects
rados list-inconsistent-obj 3.1f --format=json-pretty | \
python3 -c 'import sys,json; d=json.load(sys.stdin)
for i in d["inconsistents"]:
print(i["object"]["name"], i["errors"], [s["osd"] for s in i["shards"]])'
Mapping the object back to what it holds tells you what is at risk:
# for an RBD image
rbd info rbd-vms/vm-disk-1 | grep block_name_prefix
# match the prefix against the object name
The immediate response
# 1. identify the device
ceph pg 3.1f query | grep -A3 'acting'
ceph osd find 12
# 2. check the device's health
ceph device ls | grep osd.12
smartctl -a /dev/sdX | grep -iE 'reallocated|pending|error'
# 3. check the kernel log on that host
dmesg -T | grep -iE 'sd[a-z]|nvme|I/O error' | tail -20
A read_error almost always corresponds to a device with reallocated or
pending sectors, and finding that confirms the diagnosis before any repair
is attempted.
Quiz
Knowledge check · 4 questions
Q1. Which scrub error indicates silent corruption rather than a device admitting failure?
Q2. Ceph repairs scrub inconsistencies automatically by default.
Q3. Respond to a scrub error.
HEALTH_ERR reports one scrub error and one inconsistent PG. `rados list-inconsistent-obj` shows a data_digest_mismatch on one object, with all three shards having read successfully.
Q4. Why is `read_error` the least alarming of the scrub error types?
Passing score: 75%. Answers are checked in this browser.
Production discipline
Read rados list-inconsistent-obj before repairing — a
read_error and a data_digest_mismatch with clean reads call for
different responses. Check the host’s memory and HBA before repairing a
digest mismatch, since a repair sourced from a faulty host propagates the
corruption.
Cross-course references
- Kubernetes: distinguishing node failure from node misbehaviour changes the remediation the same way
- Linux: a SCSI medium error and silent data corruption warrant different investigations