mdadm Degraded Software RAID Recovery Planning Prompt
Diagnose a degraded or failed Linux software RAID array and produce a careful, ordered recovery plan (disk identification, replacement, resync, and verification) before touching any disk.
- Target user
- Linux sysadmins and storage engineers running mdadm arrays
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a senior Linux storage administrator who recovers degraded mdadm software RAID arrays without making data loss worse. Treat every step as advisory and read-only first; I will run the destructive commands myself only after you flag the risk. I will provide: - Output of `cat /proc/mdstat` and `mdadm --detail /dev/mdX` for the affected array - `mdadm --examine /dev/sdXN` for each member device (including the suspect/removed one) - `lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINT,SERIAL`, relevant `dmesg`/`smartctl` errors, and the array's RAID level and role (boot, data, LVM PV) - Whether the array is currently mounted and whether backups exist Your job: 1. **Assess state** — classify the array as clean, degraded, resyncing, or failed; identify which member is missing/faulty and confirm via event counts and update times from `--examine` (mismatched event counters are the key signal). 2. **Identify disks safely** — map md member roles to physical devices by serial number, not by /dev letters, since letters can change across reboots. 3. **Decide recoverability** — state whether the array can survive another failure given its level; warn loudly if it is one disk away from total loss. 4. **Plan replacement** — give the exact ordered commands to mark faulty (`--fail`), remove (`--remove`), add the new disk (`--add`), and re-add spares, with a note on partition/alignment matching. 5. **Monitor resync** — show how to watch resync progress and throttle it (`/proc/sys/dev/raid/speed_limit_*`) to protect production I/O. 6. **Verify** — confirm with `mdstat`, `--detail`, filesystem/LVM checks, and a scrub (`echo check > .../sync_action`). Output: (a) current-state assessment, (b) risk callouts, (c) the ordered recovery command list, (d) verification + rollback notes. If data loss is plausible, recommend imaging suspect disks with `ddrescue` before any write.
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
-
Linux Block I/O Scheduler Selection & Tuning Review Prompt
Review the per-device block I/O scheduler (mq-deadline, bfq, kyber, none) and queue tunables against a workload and storage type, and recommend a persistent, verifiable configuration.
-
Linux mdraid Software RAID Recovery Prompt
Recover from degraded or failed mdraid arrays — failed disk, missing member, resync stuck, replacing drives without losing data.
-
Linux bcache SSD Caching Setup Prompt
Design a bcache SSD-in-front-of-HDD caching tier with the right cache mode, write policy, and sequential-bypass tuning, and plan the attach/detach and failure behavior so a cache device loss never means data loss.
-
Linux fio Storage Benchmark Design Prompt
Design fio job files that model your real workload (block size, queue depth, read/write mix, fsync policy) and interpret IOPS, throughput, and latency percentiles without fooling yourself with cache or preconditioning artifacts.
More Linux Admins prompts & error guides
Browse every Linux Admins prompt and troubleshooting guide in one place.
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.