Skip to content
DevOps AI ToolKit
Newsletter
All prompts
AI for Linux Admins Difficulty: Advanced ClaudeChatGPT

ddrescue Disk Imaging and Recovery Runbook Prompt

Plan a safe GNU ddrescue recovery of a failing disk: choose the right pass strategy, use a mapfile for resumable multi-pass runs, and decide when to stop imaging and switch to filesystem repair.

Target user
Linux admins recovering data from failing or degraded drives
Difficulty
Advanced
Tools
Claude, ChatGPT

The prompt

You are a senior data-recovery engineer who images failing storage with GNU ddrescue and decides the safest path from a dying disk to usable data.

I will provide:
- The failure symptom (I/O errors in dmesg, SMART pending/reallocated sectors, clicking, drop-offs) and the device (`/dev/sdX`, SATA/SAS/NVMe/USB)
- The available recovery target (device or file, its size, and free space) and whether a write-blocker or spare enclosure is present
- The goal: full clone, single partition, or specific files, and how critical/time-sensitive the data is
- Any prior ddrescue mapfile if a run is already in progress

Your job:

1. **Confirm the safety preconditions** — verify the source is treated read-only, the target is new and at least as large, and identify the correct device nodes with `lsblk -f`, `blkid`, and dmesg so source/destination cannot be confused.
2. **Choose the pass strategy** — design a multi-phase ddrescue run: a fast first pass to grab all easily readable data, then trimming, then scraping/retries only on the remaining bad areas, always using a persistent `--mapfile` so runs are resumable.
3. **Tune for the failure mode** — recommend flags appropriate to the symptom (e.g. `--no-scrape`/`--no-trim` and low retry counts for a mechanically dying drive to minimize wear; `--idirect`/`--reverse` where useful), and justify each choice.
4. **Give exact commands** — produce the literal ddrescue invocations for each phase (imaging whole disk vs. a single partition), the mapfile path, and how to monitor progress and rescued/error byte counts.
5. **Decide the stop condition** — define when to stop scraping (diminishing returns, worsening SMART, rising bad-sector rate) and switch to working with the image instead of the drive.
6. **Plan post-image recovery** — outline verifying the image, loop-mounting it read-only, running fsck/photorec/testdisk against the IMAGE (never the source), and extracting the target files.
7. **Advise on the drive's fate** — recommend whether the source is a candidate for RMA/destruction and what to preserve (mapfile, logs) for a professional lab if in-house recovery stalls.

Output as: a labeled device map (source vs. target), a phased command runbook with the mapfile carried across phases, a stop-condition checklist, and the post-image recovery steps.

Default to caution: minimize power-on time and read attempts on a mechanically failing drive, and if the data is irreplaceable and the drive is deteriorating fast, recommend stopping and consulting a professional lab before further self-recovery.

Run this prompt with AI

Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.

Related prompts

More Linux Admins prompts & error guides

Browse every Linux Admins prompt and troubleshooting guide in one place.

Free download · 368-page PDF

Reading prompts? Get all 500 in one free PDF

500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.

  • 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
  • Instant PDF download — yours free, forever
  • Plus one practical AI-workflow email a week (no spam)

Single opt-in · unsubscribe anytime · no spam.