Ceph PG_NOT_DEEP_SCRUBBED: scrub verification debt and undetected bit rot
PG_NOT_DEEP_SCRUBBED means Ceph’s proactive integrity check is falling behind. Deep scrub is the only mechanism that reads every byte of every object on every replica and verifies byte-for-byte consistency. When PGs miss their deep-scrub window repeatedly, silent corruption from bit rot, DRAM errors, firmware bugs, and incomplete writes after power loss accumulates without any signal.
The companion check PG_NOT_SCRUBBED covers the lighter daily scrub, which compares object metadata across replicas. Both checks surface through ceph health detail and the ceph_health_detail Prometheus metric exposed by the MGR module. There is no per-PG “overdue” gauge in the standard metrics pipeline, which is why scrub debt often goes unmonitored until someone runs ceph -s and sees a HEALTH_WARN they do not recognize.
Treat any sustained PG_NOT_DEEP_SCRUBBED as a real integrity risk. PGs that go weeks past their window are effectively unmonitored for corruption. If a corrupt replica’s OSD fails before the next deep scrub runs, recovery can rebuild from the corrupt copy and propagate the damage.
What this means
Ceph schedules two classes of scrub per PG:
- Light scrub (
osd_scrub_min_interval, default 86400 seconds = 1 day) compares object metadata across replicas. Cheap and fast. - Deep scrub (
osd_deep_scrub_interval, default 604800 seconds = 7 days) reads every object on every replica and verifies byte-for-byte checksums. I/O-intensive; competes directly with client traffic and recovery.
When a PG has not been deep-scrubbed within its configured window, the PG_NOT_DEEP_SCRUBBED health check fires. The check is computed from the PGMap independently of the OSDs that actually run the scrub.
flowchart TD
A[Deep scrub window expires] --> B{Scrub scheduled?}
B -- No: noscrub / nodeep-scrub --> C[Flags block all scrubs]
B -- No: PG not clean --> D[Peering / degraded / recovery]
B -- No: OSD load too high --> E[Scrub deferred by scheduler]
B -- Yes but never completes --> F[Reservation or chunk stall]
C --> G[PG_NOT_DEEP_SCRUBBED]
D --> G
E --> G
F --> G
G --> H[Verification debt accumulates]
H --> I[Corruption undetected]Common causes
| Cause | What it looks like | First thing to check |
|---|---|---|
noscrub or nodeep-scrub flag set | All PGs overdue simultaneously; no scrubbing PGs in ceph pg dump | ceph osd dump | grep flags |
| Heavy recovery or backfill active | PG_NOT_DEEP_SCRUBBED appears during rebalancing; clears when recovery finishes | ceph pg stat and recovery rate |
osd_scrub_during_recovery is false | Deep scrubs queue but never start while any recovery is in progress | recovery activity vs scrub activity |
| OSD I/O saturation | Deep scrubs scheduled but slow; load threshold suppresses light scrubs | OSD apply/commit latency and disk %util |
| Cluster grew beyond scrub throughput | Many large PGs; steady state never catches up | count of overdue PGs vs scrub rate |
| Scrub scheduling stall | PGs stuck in scrubbing+deep with zero progress for days | OSD logs and Ceph version |
| Config mismatch after interval change | You extended osd_deep_scrub_interval but the warning persists | which daemon computes the health check |
Quick checks
Run these before changing anything. All are read-only.
# Confirm the health check and see which PGs are overdue
ceph health detail | grep -A 20 'PG_NOT_DEEP_SCRUBBED\|PG_NOT_SCRUBBED'
# Check for flags that intentionally suppress scrubbing
ceph osd dump | grep flags
# Expect: no flags, or only noout during maintenance
# Find the oldest un-deep-scrubbed PGs (sorted by last deep scrub timestamp)
# Note: ceph pg dump can be slow on large clusters
ceph pg dump -f json 2>/dev/null | jq -r '.pg_stats[] | "\(.last_deep_scrub_stamp) \(.pgid)"' | sort | head -30
# See what is scrubbing right now
ceph pg dump | grep -E 'scrubbing|deep'
# Check recovery and backfill activity that competes with scrub
ceph pg stat
# OSD latency to see if scrub is being throttled by load
ceph osd perf
# Confirm configured intervals
ceph config dump | grep -E 'osd_scrub|osd_deep_scrub|osd_max_scrubs'
# Check whether the cluster is in active recovery
ceph -s
How to diagnose it
Confirm the flags are clear.
ceph osd dump | grep flagsis the fastest check. Ifnoscrubornodeep-scrubappears, scrubs are intentionally blocked. These flags are commonly set during peak hours or maintenance and then forgotten. Clear withceph osd unset noscrubandceph osd unset nodeep-scrub.Quantify the debt. Sort PGs by
last_deep_scrub_stampand look at the tail. If the oldest PG is a few days past the interval, the cluster is mildly behind. If the oldest is weeks past, the integrity exposure is real. Prioritize catching up over client performance concerns.Correlate with recovery. With
osd_scrub_during_recoveryat its default of false, any active recovery or backfill blocks new scrub scheduling. Checkceph pg statforrecoveringorbackfillingPGs. If recovery is the cause, the debt resolves when recovery completes, but verify recovery is actually making progress rather than stalled.Check OSD load. Light scrubs respect
osd_scrub_load_threshold(default 0.5 normalized load). On busy clusters, light scrubs may be deferred indefinitely during business hours. Deep scrubs that are overdue are scheduled regardless, but they still compete with client I/O on the same disks. Useceph osd perfto find OSDs whose apply or commit latency is elevated.Look for stuck scrubs. If PGs appear in
scrubbing+deepstate inceph pg dumpbut the deep-scrub timestamps never advance, the scrub is hung. This is a different failure mode from “scrub never scheduled” and requires OSD-level investigation.Verify the config actually applied. If you extended
osd_deep_scrub_intervalto accommodate a slower cluster, confirm the daemon computing the health check sees the new value. Setting the interval only under[osd]may leave the checker using the default, producing a persistent false warning. Set under[global]or explicitly for both[osd]and[mgr].
Metrics and signals to monitor
| Signal | Why it matters | Warning sign |
|---|---|---|
ceph_health_detail{name="PG_NOT_DEEP_SCRUBBED"} | The only direct signal that scrub debt exists | Active for more than 24 hours |
ceph_health_detail{name="PG_NOT_SCRUBBED"} | Light scrub debt usually precedes deep scrub debt | Active for more than a few hours |
ceph_osd_flag_noscrub, ceph_osd_flag_nodeep-scrub | Intentional suppression; correlate before alerting | Set for more than 24 hours without a maintenance ticket |
ceph_pool_recovering_bytes_per_sec | Recovery blocks scrub scheduling by default | Non-zero recovery while scrub debt is growing |
ceph_osd_apply_latency_ms, ceph_osd_commit_latency_ms | Scrub competes with client I/O on the same disks | Latency elevated during scrub windows |
ceph_healthcheck_slow_ops | Scrub-induced load can produce slow ops | Slow ops correlated with scrub activity |
ceph_pg_inconsistent | The downstream consequence of missed corruption | Any non-zero value is urgent |
ceph_pg_failed_repair | Ceph tried to repair and could not | Any non-zero value requires manual intervention |
Fixes
Forgotten noscrub or nodeep-scrub flag
The single most common cause. Clear the flags and let the scheduler resume.
ceph osd unset noscrub
ceph osd unset nodeep-scrub
Watch ceph pg dump | grep -E 'scrubbing|deep' to confirm scrubs are scheduling. Track the count of overdue PGs over the next several hours. If you routinely suppress scrubs during peak hours, automate the set/unset so the flag does not get forgotten.
Recovery or backfill is starving scrub
With osd_scrub_during_recovery at its default of false, this is expected behavior during rebalancing. Do not enable scrub-during-recovery blindly on a busy cluster; it adds I/O contention to an already loaded system.
Options, in order of preference:
- Let recovery finish. Verify it is making progress with
ceph_pool_recovering_bytes_per_sec. If recovery is stalled, fix that first (see Ceph backfill_toofull: recovery blocked because target OSDs are full and Ceph degraded objects: reduced redundancy and the race against a second failure). - If recovery will run for days and you cannot tolerate the scrub debt, temporarily widen the scrub window under
[global]so the health check stops warning, then restore the original value when recovery completes:ceph config set global osd_deep_scrub_interval <seconds> - As a last resort on a cluster with spare IOPS, enable scrubs during recovery. This increases client-visible latency; watch it closely:
ceph config set osd osd_scrub_during_recovery true
OSD load is deferring scrubs
Deep scrubs that are overdue bypass osd_scrub_load_threshold, but they still yield to client I/O and can be slow enough that throughput cannot keep up. If the cluster has grown beyond what the scrub scheduler can clear in a week:
- Widen the deep-scrub interval under
[global]to a value the cluster can sustain. A verified-but-monthly deep scrub is better than a weekly target that is never met. - Schedule scrubs into a low-traffic window with
osd_scrub_begin_hourandosd_scrub_end_hour. - For pools with different integrity requirements, consider per-pool intervals.
Scrub is stuck and never completes
PGs showing scrubbing+deep with no progress for hours or days indicate a reservation or scheduling problem, not a throughput problem.
- Identify the stuck PGs:
ceph pg dump | grep 'scrubbing.*deep'and compare timestamps across samples. - Query the PG:
ceph pg <pgid> queryto see where in the scrub state machine it is parked. - Check the OSD logs on the primary for scrub reservation messages.
If a scrub is genuinely hung, restarting the primary OSD or repeering the PG can unblock it. This is disruptive: it causes client I/O to stall on that PG and may trigger recovery. Snapshot the OSD logs first and prefer a maintenance window.
Config mismatch after interval change
If you extended osd_deep_scrub_interval and the warning will not clear, the daemon computing the health check is likely still using the old default. Set the value globally so all components see the same value:
ceph config set global osd_deep_scrub_interval <seconds>
Confirm with ceph config dump. Most config changes are picked up dynamically; if the warning does not clear on the next health evaluation, restart the active MGR (this triggers an MGR failover to standby).
Prevention
- Alert on the health check directly. Page or ticket when
ceph_health_detail{name="PG_NOT_DEEP_SCRUBBED"}is active for more than 24 hours. Shorter windows fire during normal recovery. - Alert on suppression flags.
ceph_osd_flag_noscruborceph_osd_flag_nodeep-scrubset for more than 24 hours without a maintenance ticket is a structural risk. - Track the oldest un-deep-scrubbed PG. Scrape
ceph pg dumpperiodically and record the maximum age. Trending upward week over week means the cluster is losing the race. - Automate flag set/unset. If you suppress scrubs during peak hours, drive it from a scheduler that always unsets, never relies on a human remembering.
- Size the scrub window to reality. A weekly target that is never met is worse than a monthly target that is always met. Measure actual scrub throughput and set the interval accordingly.
- Correlate scrub debt with recovery. Recovery is the most common legitimate cause of transient scrub debt. Make sure alerting distinguishes “debt during active recovery” from “debt with no recovery in progress”.
Monitoring with Netdata
- The
ceph_health_detailmetric with thenamelabel exposesPG_NOT_DEEP_SCRUBBEDandPG_NOT_SCRUBBEDdirectly. Alert when the value is 1 for more than 24 hours. ceph_osd_flag_noscrubandceph_osd_flag_nodeep-scrublet you gate the scrub-debt alert. If a flag is set during maintenance, the debt alert is expected.- Per-second OSD latency (
ceph_osd_apply_latency_ms,ceph_osd_commit_latency_ms) shows whether scrubs are running and how much client impact they cause. Correlate latency spikes with scrub windows. - Recovery rate (
ceph_pool_recovering_bytes_per_sec) distinguishes “scrub debt because recovery is running” from “scrub debt with no recovery in progress”. The two cases have different fixes. ceph_pg_inconsistentandceph_pg_failed_repairare the downstream signals when scrub debt has already produced undetected corruption. Correlate with scrub history to determine whether the integrity window has been breached.
Related guides
- Ceph backfill_toofull: recovery blocked because target OSDs are full
- Ceph blocked ops: client I/O stuck behind a single slow OSD
- Ceph BlueStore RocksDB compaction stalls: periodic latency spikes
- Ceph BLUEFS_SPILLOVER: RocksDB metadata spilling onto the slow device
- Ceph BlueStore allocator fragmentation: rising latency at moderate fullness
- Ceph capacity death spiral: an OSD fails and recovery has nowhere to go
- Ceph client latency vs OSD latency: fast disks, slow clients
- Ceph degraded objects: reduced redundancy and the race against a second failure
- Ceph health detail: mapping ceph_health_detail checks to a cause
- Ceph HEALTH_ERR: reading the umbrella status and finding the real fault
- Ceph HEALTH_WARN: which warnings are noise and which are structural
- How Ceph actually works in production: a mental model for operators






