NVMe health checks: establish a baseline before diagnosing faults

NVMe health checks: establish a baseline before diagnosing faults

Database writes are slowing down, the application occasionally reports I/O errors, yet the disks can still be mounted. At this point, the most useful steps are not full-disk stress tests, but verifying device identities, reading health logs, and comparing current counters with a historical baseline. A health check of directly attached NVMe drives should first answer three questions: which drive is affected, which metrics are changing, and whether an independent copy of the business data already exists.

1. Map each drive to its file systems

HubAMD dedicated servers come with two directly attached 1TB NVMe drives and no hardware RAID. The drives do not automatically form a mirror, and each drive’s health must be checked separately. The examples below use Debian 12 and an account with sudo privileges. After payment, retrieve the connection credentials from the console and log in through SSH. If the server has multiple addresses, use the first one.

Install the tools and inspect the devices:

sudo apt-get update
sudo apt-get install nvme-cli smartmontools
sudo nvme list
lsblk -o NAME,TYPE,SIZE,FSTYPE,MOUNTPOINTS,MODEL,SERIAL
findmnt -o TARGET,SOURCE,FSTYPE
ls -l /dev/disk/by-id/

/dev/nvme0 is typically the controller device, while /dev/nvme0n1 is a namespace block device. Device numbering may change with discovery order, so “drive 0” must not be treated as a permanent identifier for a particular application volume. Record the serial number, model, firmware version, and the relationships between partitions, file systems, and mount points.

If an application volume uses LVM or a software array, follow the tree shown by lsblk down to the underlying drives. The serial number identifies the physical device; the mount point identifies the affected workload. Both are essential.

These checks only read device identification information and logs. Do not format or erase drives, update firmware, or run write tests against raw block devices. An existing file system is not a test area.

2. Save a comparable baseline for each drive

Once you have confirmed the actual controller paths, collect the records in the same shell session. The paths below must match the output from the previous step. If the controller names differ, adjust the device list in the loop first.

umask 077
out="$HOME/nvme-check-$(date -u +%Y%m%dT%H%M%SZ)"
mkdir -p "$out"
sudo nvme list -o json > "$out/devices.json"

for dev in /dev/nvme0 /dev/nvme1; do
  name=$(basename "$dev")
  sudo nvme id-ctrl "$dev" -o json > "$out/$name-controller.json"
  sudo nvme smart-log "$dev" -o json > "$out/$name-health.json"
  sudo nvme error-log "$dev" -e 16 -o json > "$out/$name-errors.json"
  sudo smartctl -x "$dev" > "$out/$name-smartctl.txt"
done

sudo journalctl -k -b --no-pager > "$out/kernel-current-boot.txt"

JSON is useful for later field-by-field comparisons, while text output is easier to review manually. When collecting the records, also note the workload and any symptoms, such as a bulk import, backup reads, or a database checkpoint. This avoids directly comparing temperatures recorded under different workloads.

Check the exit status and standard error for every command. An empty file does not mean the drive is healthy, and a tool’s lack of support for a particular log does not mean the drive has failed. smartctl uses a bitmask for its exit status. If it returns a nonzero value, read the specific output rather than interpreting every such result as “device failure.”

Archive baselines by serial number and keep an independent copy. After a controller replacement, firmware change, or tool upgrade, verify the meaning of the fields again. Do not simply merge new records with old ones without checking compatibility.

3. Assess health fields separately from increases in error counts

Endurance estimates are not a countdown to failure

percentage_used is the manufacturer’s estimate of endurance consumed. It does not indicate remaining storage space and cannot be converted into a definite number of days remaining. Reaching or exceeding 100 does not mean the device will immediately stop working. Plan further checks based on its rate of increase, the write workload, and other warnings.

available_spare and available_spare_threshold indicate spare capacity and its threshold. critical_warning is a bitmask, not an ordinary counter. If it is nonzero, identify the warning bits that are set and distinguish between causes such as spare capacity, temperature, reliability, and a read-only state.

New media errors matter more than cumulative log entries

media_errors counts unrecovered data integrity errors. The key question is whether the count has increased since the previous record. By contrast, num_err_log_entries is the cumulative number of error log entries. Unsupported administrative commands can also generate entries, so these two counters are not interchangeable.

Error logs generally retain only a limited number of entries. Reading the most recent entries cannot reconstruct the full history. Check the status codes, the namespaces involved, and kernel errors rather than requesting a drive replacement simply because a counter is nonzero.

Assess temperature against the thresholds and duration reported by the device; do not apply a single failure temperature across different models. An increase in unsafe_shutdowns indicates that an unclean shutdown occurred, but does not by itself prove media damage. Convert write volumes according to the NVMe definition of data units. Raw counts must not be treated directly as bytes.

4. Correlate kernel and application logs

Health logs only provide the device’s perspective. Application timeouts may also involve the file system, driver, connection path, or workload congestion. Check the kernel logs alongside them:

sudo journalctl -k -b --no-pager |
  grep -Ei 'nvme|I/O error|timeout|reset|read-only|ext4|xfs'

Use the filtered output to locate relevant events, but retain the complete logs as well. Logs from the current boot do not include all earlier events. If the server has rebooted, first use journalctl --list-boots to check whether historical logs are available, then read the relevant boot records.

Record when application errors occurred, normalize the time zones, and compare those times with kernel events. If there was only a single latency spike and no new media errors, continue investigating queues and workload. If media errors are increasing and I/O errors are occurring, prioritize protecting the data. Repeated controller timeouts or resets remain a concern even when the health summary appears normal; a normal summary does not rule out a fault.

Do not clear logs before investigating, and do not repeatedly reboot to “check whether it recovers.” A reboot may temporarily change the symptoms while losing the current diagnostic state.

5. Make recoverability the final checkpoint

If errors persist, first pause nonessential high-volume writes, then have the person responsible for the application decide whether to switch to read-only operation or stop the service. Prioritize saving data that can still be read normally to an independent location. If reads continue to fail, do not repeatedly scan the entire drive. Preserve the evidence already collected and coordinate the next steps.

When submitting a support ticket through the console, include the server ID, device serial number, time of the issue, changes in health fields, relevant kernel records, and application symptoms. Do not include login passwords, private keys, or complete business data. HubAMD is responsible for hardware and networking; users are responsible for system configuration and data backups.

A complete health-check process must cover at least four points: each drive’s identity is traceable, health metrics are comparable, anomalies are backed by log evidence, and backups can actually be restored. Copies on two drives in the same server do not protect against server failure or operator mistakes, and health checks are not a substitute for backups. Verify recovery first, then decide whether the device should continue handling production writes.

Frequently asked questions

Does a rising error-log entry count mean an NVMe drive has failed?

Not by itself. Unsupported administrative commands can also create entries. Check status codes, new media errors, kernel I/O errors and application symptoms together.

Can two direct-attached NVMe drives replace an independent backup?

No. Copies on the same machine share host-failure and operator-error risks. Keep an independent copy of important data and test the restore procedure.

HubAMD AMD EPYC 7543P dedicated server

From $448/month

Configure a dedicated server HubAMD 128GB / 256GB pricing
Back to the operations blog