CephXCIV · Hardware ReplacementHardware Replacement
Replacing a failing disk before it fails
What you'll learn
- Recognise a device warranting proactive replacement
- Plan the replacement window
- Execute a clean drain and replace
- Compare the cost against reactive replacement
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
The same replacement done proactively costs one planned drain; done reactively it costs an unplanned recovery, a degraded window, and often a scrub inconsistency.
Recognising the device
DEVICE_ID=12
ceph device ls
ceph health detail | grep -i DEVICE_HEALTH
ceph device predict-life-expectancy ${DEVICE_ID}
| Trigger | Urgency |
|---|---|
| Any pending sectors | replace this week |
| Reallocated sectors increasing | replace this week |
| Repeated scrub errors on the same OSD | replace now |
NVMe critical_warning non-zero | replace now |
percentage_used above 90 | plan replacement |
| Latency persistently above class | investigate, then likely replace |
DEVICE_HEALTH prediction | plan replacement |
DEVICE_ID=12
ceph device get-health-metrics ${DEVICE_ID} | python3 -c '
import sys,json; d=json.load(sys.stdin)
for ts in sorted(d)[-3:]:
a = d[ts].get("ata_smart_attributes",{}).get("table",[])
p = {x["id"]: x["raw"]["value"] for x in a if x["id"] in (5,197,198)}
print(ts, p)'
Three samples showing a rising count is the confirmation.
Planning the window
A proactive replacement needs:
the cluster healthy, with no other work in progress
capacity for the drain
a replacement drive on hand
a window when the backfill impact is acceptable
ceph -s
ceph osd df | awk -v o=44 '$1==o {print $7, "used"}'
ceph osd df | sort -k17 -rn | head -3
Unlike a failure, this can wait for the right moment — which is the whole benefit.
Executing
# 1. drain cleanly; the device still reads
ceph orch osd rm 44 --replace
ceph orch osd rm status
# 2. wait for it to complete
watch -n 30 'ceph orch osd rm status; ceph -s | grep -E "misplaced|health"'
# 3. confirm zero PGs and cluster health
ceph pg ls-by-osd 44 2>/dev/null | tail -n +2 | wc -l
ceph -s | grep HEALTH_OK
# 4. replace the drive and let the orchestrator redeploy
ceph orch device ls ceph-03 --refresh
The drain completing before the drive is removed means no PG is ever degraded.
Comparing the costs
| Proactive | Reactive | |
|---|---|---|
| Degraded window | none | hours |
| Data movement | drain + refill | recovery + refill |
| Scrub inconsistencies | none | likely |
| Scheduling | chosen | whenever it fails |
| Client impact | paced | uncontrolled |
| Device cost | identical | identical |
The device cost is the same either way.
Everything else is worse in the reactive case.
Quiz
Knowledge check · 4 questions
Q1. What is the principal difference between a proactive and a reactive disk replacement?
Q2. The scrub inconsistencies that accompany a reactive replacement were produced by the device itself, before anyone acted on it.
Q3. Act on a device health warning.
A device shows 12 pending sectors, up from zero last week. The cluster is healthy and a replacement drive is on hand.
Q4. What does the ability to choose the window buy in a proactive replacement?
Passing score: 75%. Answers are checked in this browser.
Production discipline
Replace on the health trigger rather than on failure — the drive costs the same and the proactive drain means no PG is ever degraded. Confirm the rising trend across several health samples, then choose a window when the backfill impact is acceptable.
Cross-course references
- Kubernetes: draining a node before it fails avoids the disruption of it failing
- Linux: proactive RAID member replacement has the identical cost comparison