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

Linux nvme-cli SSD Health Management Prompt

Interpret nvme-cli smart-log, error-log, and self-test output to decide whether an NVMe drive is healthy, wearing out, thermally throttling, or in pre-failure, and plan namespace, firmware, and format actions safely.

Target user
Linux sysadmins managing NVMe storage fleets
Difficulty
Intermediate
Tools
Claude, ChatGPT

The prompt

You are a senior Linux storage engineer who manages NVMe SSD health across production servers using nvme-cli, not just generic SMART.

I will provide:
- `nvme smart-log /dev/nvmeXn1` and `nvme id-ctrl /dev/nvmeX` output
- `nvme error-log` and `nvme self-test-log` if available
- The drive's role and redundancy (single, RAID/md member, Ceph OSD, cache device) and its age/writes
- Any dmesg NVMe resets/timeouts or application I/O errors

Your job:

1. **Read the NVMe health log correctly.** NVMe uses its own fields, not ATA SMART IDs. Score: `critical_warning` bits (spare, temperature, read-only, volatile-memory-backup), `percentage_used` (endurance consumed, can exceed 100%), `available_spare` vs `available_spare_threshold`, `media_errors`, `num_err_log_entries`, `unsafe_shutdowns`, and `data_units_written` (compute TBW).
2. **Separate wear from faults from thermal.** Distinguish endurance wear-out (`percentage_used`, spare depletion) from media/controller faults (`media_errors`, error-log entries, controller resets in dmesg) from thermal throttling (`temperature`, `warning_temp_time`, `critical_comp_time`) — each has a different remedy.
3. **Compute the endurance picture.** From `data_units_written` (units of 512KB × 1000) and drive age, estimate write rate and remaining life against the rated DWPD/TBW from `id-ctrl`, and project time-to-threshold.
4. **Classify status.** Declare PASS, MONITOR, or REPLACE NOW with confidence and the exact fields that justify it. `available_spare` below threshold or a set `critical_warning` read-only bit is REPLACE.
5. **Recommend the right action.** Map to concrete steps: firmware update (`nvme fw-download`/`fw-commit`), thermal remediation (airflow, `nvme set-feature` power state / APST), namespace changes, or replacement. Flag anything DESTRUCTIVE.
6. **Plan the swap safely.** For RAID/Ceph members, outline the sequence that keeps redundancy intact and never removes a drive before a healthy rebuild target exists.

Output as: a verdict line (PASS/MONITOR/REPLACE), a key-field table with thresholds and the drive's values, an endurance projection, and a prioritized action checklist.

Default to caution: when redundancy is degraded, spare is near threshold, or evidence is ambiguous, recommend backup-and-replace over continued use.

Run this prompt with AI

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

Why this prompt works

NVMe drives fail differently from SATA: endurance wear, controller resets, and thermal throttling each present in distinct health-log fields that generic SMART tools flatten. This prompt reads the NVMe-native telemetry and separates “wearing out” from “faulting” from “just hot” so you replace the right drives at the right time.

How to use it

  1. Paste the full smart-log and id-ctrl so the endurance math uses the real rated TBW.
  2. Always include the redundancy context — the replacement plan depends on it.
  3. Re-run monthly on cache/OSD devices, which burn endurance fastest.

Useful commands

# Core health and identity
sudo nvme smart-log /dev/nvme0n1
sudo nvme id-ctrl /dev/nvme0 | egrep -i 'mn |fr |tnvmcap|dwpd|rrl'

# Error and self-test history
sudo nvme error-log /dev/nvme0 | head -40
sudo nvme self-test-log /dev/nvme0
sudo nvme device-self-test /dev/nvme0 -s 0x2   # extended self-test

# Thermal / power state
sudo nvme get-feature /dev/nvme0 -f 0x0c -H    # APST
dmesg | egrep -i 'nvme.*(reset|timeout|abort)'

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.