nvme-cli: Managing and Monitoring NVMe Drives
NVMe is not SATA with a faster cable. It is a different protocol with its own command set, its own health reporting, and management operations that have no SATA equivalent. nvme-cli speaks it directly.
sudo apt install nvme-cli # Debian and Ubuntu
sudo dnf install nvme-cli # Fedora
sudo pacman -S nvme-cli # Arch
What you have
sudo nvme list
Node Model Namespace Usage FW Rev
/dev/nvme0n1 Samsung SSD 990 PRO 2TB 1 2.00 TB / 2.00 TB 4B2QJXD7
Note the naming. nvme0 is the controller, nvme0n1 is namespace 1 on it. Namespaces are a controller-level division, conceptually like a partition but implemented in the drive rather than in a partition table.
The health log
The command that matters:
sudo nvme smart-log /dev/nvme0
critical_warning : 0
temperature : 41 C
available_spare : 100%
percentage_used : 3%
data_units_written : 12,483,921
media_errors : 0
num_err_log_entries : 0
percentage_used is the wear estimate. 100 means the rated endurance has been reached. It is a vendor calculation rather than a measurement, and drives frequently continue past 100. Treat it as a replacement planning signal rather than a countdown.
available_spare is the remaining reserve blocks. Dropping below the threshold is a genuine warning sign and one of the better predictors of failure.
media_errors should be zero. Anything else means the drive could not read data correctly.
critical_warning is a bitfield where zero is healthy. Non-zero means the drive is reporting a specific problem such as reserve exhaustion or a read-only transition.
data_units_written is in 512,000-byte units, so multiply by 512000 for bytes. Useful for working out actual write volume against the drive’s rated endurance.
Temperature and throttling
sudo nvme smart-log /dev/nvme0 | grep -i temp
NVMe drives run hot and reduce performance to stay within limits. A drive at 70 degrees under sustained load is throttling, and that is the usual explanation for a fast drive that becomes slow partway through a large transfer.
Run a sustained fio job and watch the temperature to see whether throttling explains a benchmark that starts fast and degrades.
Secure erase
This is genuinely useful and genuinely destructive.
# Cryptographic erase, discards the internal key
sudo nvme format /dev/nvme0n1 --ses=1
# Block erase
sudo nvme format /dev/nvme0n1 --ses=2
Cryptographic erase discards the drive’s internal encryption key, making everything unrecoverable instantly regardless of capacity. It completes in seconds where overwriting a 4TB drive takes hours.
This is what to do before selling or returning a drive. Note that it depends on the drive implementing it honestly, which is the same trust assumption as any hardware feature.
Both options destroy all data with no confirmation prompt worth relying on. Check the device name twice.
Firmware
sudo nvme fw-log /dev/nvme0
sudo nvme id-ctrl /dev/nvme0 | grep -i fr
Update only for a documented reason. NVMe firmware bugs causing data loss do exist and get published, and if your model is affected you should update. Otherwise the risk of the update exceeds the benefit.
Back up first, and never interrupt an update once started.
Alongside smartctl
sudo smartctl -a /dev/nvme0
smartctl reads the NVMe health log and presents it in a familiar format, and it is what you should use for routine monitoring since smartd can alert on it. Our smartctl guide covers that side.
nvme-cli is for the operations smartctl does not cover: namespace management, format and secure erase, firmware, and vendor-specific log pages.
Worth checking periodically
for d in /dev/nvme?; do
echo "== $d"
sudo nvme smart-log "$d" | grep -E 'critical_warning|percentage_used|available_spare|media_errors'
done
Run it from a systemd timer monthly and you will know a drive is wearing out long before it fails.
Frequently Asked Questions
Why can smartctl not tell me everything about an NVMe drive?
It can read the NVMe health log and does so well, and NVMe exposes considerably more through its own admin commands: namespace management, format operations, firmware slots, and vendor log pages. nvme-cli speaks the protocol directly.
What does percentage used mean on an NVMe drive?
An estimate of consumed write endurance, where 100 means the rated lifetime has been reached. It is a vendor estimate rather than a measurement, and drives commonly continue working past 100, though you should have replaced it by then.
Is NVMe secure erase actually secure?
The cryptographic erase option discards the internal encryption key, making all data unrecoverable instantly regardless of drive size. That is stronger and far faster than overwriting, and it depends on the drive implementing it honestly.
Why does my NVMe drive slow down when busy?
Thermal throttling, most likely. NVMe drives run hot under sustained load and reduce performance to stay within limits. Check the composite temperature during a long transfer, and consider a heatsink or better airflow.
What is an NVMe namespace?
A logical division of the drive presented as a separate block device, conceptually similar to a partition but implemented in the controller. Consumer drives usually expose exactly one; enterprise drives support several with independent settings.
Should I update NVMe firmware?
Only for a specific documented reason, such as a known data-loss bug affecting your model. Firmware updates carry real risk, so back up first, and never interrupt one once it has started.