How to Inspect NVMe SSD Health and Details in Ubuntu Using nvme-cli

Non-Volatile Memory Express (NVMe) solid-state drives represent the standard for high-throughput enterprise servers, cloud instances, and desktop workstations in Ubuntu. While standard SATA hard drives communicate through traditional SCSI layers inspected via smartctl or hdparm, NVMe storage operates directly over high-speed PCIe lanes with a specialised command protocol.

To audit SSD wear levels, monitor temperature sensors, evaluate available spare capacity, and diagnose media errors in Ubuntu, system administrators rely on nvme-cli—the official, high-level user-space command-line tool for NVMe storage controllers.

Installing nvme-cli in Ubuntu

The nvme-cli utility is available directly within the official Ubuntu software repositories:

sudo apt update
sudo apt install nvme-cli -y

Discovering All Attached NVMe Controllers and Namespaces

To scan the PCIe bus and print a clean summary table of all connected solid-state drives:

sudo nvme list

The terminal outputs details including Node, Serial Number, Model Name, Namespace, Formatted Block Size, and Capacity:

Node             SN                   Model                                  Namespace Usage                      Format           FW Rev
---------------- -------------------- -------------------------------------- --------- -------------------------- ---------------- --------
/dev/nvme0n1     S64BNX0T123456       Samsung SSD 980 PRO 1TB                1           1.00  TB /   1.00  TB    512   B +  0 B   5B2QGXA7

Reading S.M.A.R.T. Health Telemetry and Endurance Logs

To inspect the real-time operational health, thermal readings, and NAND flash endurance of your drive (replacing /dev/nvme0 with your drive controller):

sudo nvme smart-log /dev/nvme0

Key telemetry indicators to evaluate include:

  • temperature: Current controller temperature in Celsius. Operating above 70°C suggests inadequate heatsink mounting.
  • available_spare: Percentage of remaining reserve flash blocks (normal is 100%). A drop below the threshold triggers drive degradation.
  • percentage_used: Estimated wear of the NAND flash based on manufacturer TBW (Terabytes Written) specifications.
  • data_units_written: Cumulative total volume written to the drive (multiply by 512,000 to convert to bytes).
  • media_errors: Unrecoverable data integrity events. Any number higher than 0 indicates failing flash cells requiring immediate backup.

Checking NVMe Error Logs

If your system experiences filesystem read-only remounts or kernel I/O panics, query the internal hardware error log buffer:

sudo nvme error-log /dev/nvme0

This command dumps exact PCIe status codes and sector locations, providing essential diagnostic evidence when requesting warranty replacements from manufacturers.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.