Skip to content

How-ToSSD

How to Check NVMe SSD Health on Linux with nvme-cli

Your NVMe SSD keeps its own health, error and self-test logs, and the free nvme-cli tool can read them on any Linux PC. Using the project's man pages, the Arch Wiki and Percona's field guide, we show how to list drives, read the SMART log, check errors, run a self-test, view firmware slots and log results as JSON.

By , Systems & Technical Editor

5 min read

How to Check NVMe SSD Health on Linux with nvme-cli

If your PC boots Linux and has an M.2 NVMe SSD, you don't need a vendor app to find out how healthy the drive is. The drive keeps its own SMART/health log, error log and self-test results, and the free nvme-cli tool can read all of them from a terminal. This guide is based on the nvme-cli project's own README and man pages, the Arch Wiki's NVMe page and Percona's explainer on reading NVMe health data, all checked on 2 December 2026. The output on your drive may show more or fewer fields than the examples described.

What nvme-cli is

The project describes nvme-cli as the command line tool for managing NVMe devices, built on the libnvme library. It also handles networked NVMe-oF storage and has vendor-specific plugins, but for a desktop PC the useful part is reading the logs your SSD already keeps. The newest release on the project's GitHub page is version 3.3, published on 25 November 2026.

It's packaged by most Linux distributions, including Arch, Debian, Fedora, Ubuntu and openSUSE, under the name nvme-cli, so install it with your normal package manager:

sudo apt install nvme-cli      # Ubuntu, Debian, Mint
sudo dnf install nvme-cli      # Fedora
sudo pacman -S nvme-cli        # Arch

The project says man nvme gives the full documentation and nvme help gives a short summary. The examples in the man pages are run as root, so put sudo in front of the commands below.

A note on command names

Command names aren't the same in every guide, which trips people up when copying commands from the web. Ubuntu 24.04's packaged version (2.8) uses hyphenated commands such as nvme smart-log and nvme error-log, which is what this guide shows. The Arch Wiki's examples use a different form, such as nvme log smart and nvme log error. If a command isn't recognised, run nvme help to see the names your version expects.

Step 1: Find your NVMe drives

sudo nvme list

The man page says this scans the system for NVMe devices and returns the /dev node for each one along with some pertinent information. The Arch Wiki adds that the list includes the name, serial number, size and LBA format.

You'll see two kinds of name. /dev/nvme0 is the drive's controller (a character device) and /dev/nvme0n1 is a namespace on it, which is the block device your partitions live on. The man pages for the log and self-test commands below say they accept either. If you have more than one SSD, check you've picked the right one: the Arch Wiki warns that device node numbering is arbitrary.

To see what the drive supports, sudo nvme id-ctrl -H /dev/nvme0 sends an identify controller command, and the -H option parses many bit fields into human-readable form.

Step 2: Read the SMART/health log

sudo nvme smart-log /dev/nvme0

This retrieves the drive's SMART log page. The Arch Wiki describes it as covering health status, temperature, endurance and more. Percona's guide to NVMe health (written in 2017 by Peter Zaitsev, using the NVMe specification) explains the fields most worth reading:

  • critical_warning: the smartctl manual says this byte is what it uses to report an NVMe drive's overall health status, so a value other than 0 means the drive itself is flagging a problem. Back up first and investigate second.

  • available_spare and available_spare_threshold: a normalised percentage of spare capacity left. Percona notes that when available spare falls below the threshold, the drive can signal an event to the system.

  • percentage_used: a vendor-specific estimate of how much of the drive's rated life has been used, based on actual usage and the maker's prediction. Percona notes this can go past 100% on a drive used beyond its planned life.

  • data_units_read / data_units_written: each unit is 1,000 blocks of 512 bytes, so multiply by 512,000 to get bytes. This is the easiest way to compare your writes with the drive's TBW rating.

  • unsafe_shutdowns: how many times power was lost without a proper shutdown notice.

  • media_errors and num_err_log_entries: running counters of media errors and error log entries. What matters most is whether they keep growing.

  • Warning and Critical Composite Temperature Time: minutes spent above the drive's warning or critical temperature. Percona says these should be zero.

The unsafe_shutdowns counter records power losses rather than faults in the SSD itself, but Percona notes that, depending on the drive, an unsafe shutdown might corrupt user data, so a fast-rising count is worth tracking down. For Windows-side checks and general advice, see our guide to checking SSD health.

Step 3: Check the error log

sudo nvme error-log /dev/nvme0

The man page says this requests 64 entries by default (change that with -e). The Arch Wiki's tip is to look for entries where the error count isn't 0. Compare the list over time: a growing list alongside a rising media_errors count is a clearer warning sign than a single old entry.

Step 4: Run a drive self-test

NVMe drives that support it can run a built-in self-test. The device-self-test command takes a self-test code:

sudo nvme device-self-test /dev/nvme0 -n 1 -s 1    # short test
sudo nvme device-self-test /dev/nvme0 -n 1 -s 2    # extended test
sudo nvme device-self-test /dev/nvme0 -n 1 -s 0xf  # abort a running test

According to the man page, code 1 starts a short test, 2 starts an extended test and 0xf aborts the test, and -w makes the command wait until the test finishes. Then read the results:

sudo nvme self-test-log /dev/nvme0

The man page says this shows the 20 most recent results.

Step 5: Check firmware slots

sudo nvme fw-log /dev/nvme0

This reads the firmware log page, which the Arch Wiki uses to show the firmware revision in each of the drive's firmware slots. That's handy before a firmware update. The Arch Wiki also documents flashing firmware with nvme-cli, but for most people the simpler route is your SSD maker's own tool or fwupd where the drive is supported. Our guide to updating SSD firmware covers the general precautions.

Scripting and logging

Every command shown here supports -o json (or --output-format=json), so you can feed the results into a script or a monitoring dashboard. A simple weekly cron job that saves nvme smart-log -o json to a file gives you a history of percentage_used and media_errors, which is more useful than a one-off snapshot.

nvme-cli or smartctl?

smartctl from smartmontools also reads NVMe health data and works on SATA drives too, and GSmartControl puts a graphical front end on it. If you'd prefer a desktop app, GSmartControl and GNOME Disks both show SMART data graphically; for the smartctl side in depth, see smartmontools vs CrystalDiskInfo. nvme-cli's advantage is that it speaks NVMe natively and exposes NVMe-specific logs such as the firmware slots. For other Linux hardware tools, see our best Linux hardware info tools.

The bottom line

nvme-cli is the most direct way to check an NVMe SSD's health on Linux. Install the nvme-cli package, find your drive with nvme list, then read nvme smart-log and look at critical_warning, available_spare, percentage_used, media_errors and the temperature time counters. Check the error log, run a short self-test if the drive supports one, and save the JSON output now and then so you can spot trends. Command names vary between versions and guides, so use nvme help if one isn't recognised, and back up straight away if the drive raises a critical warning.

Sources

  1. 01nvme-cli project, nvme-cli and libnvme README
  2. 02nvme-cli project, nvme-cli 3.3 release
  3. 03Ubuntu Manpages, nvme-smart-log (nvme-cli 2.8)
  4. 04Ubuntu Manpages, nvme-error-log (nvme-cli 2.8)
  5. 05Ubuntu Manpages, nvme-device-self-test (nvme-cli 2.8)
  6. 06Ubuntu Manpages, nvme-self-test-log (nvme-cli 2.8)
  7. 07Ubuntu Manpages, nvme-list (nvme-cli 2.8)
  8. 08Ubuntu Manpages, nvme-id-ctrl (nvme-cli 2.8)
  9. 09Ubuntu Manpages, nvme-fw-log (nvme-cli 2.8)
  10. 10ArchWiki, Solid state drive/NVMe
  11. 11Ubuntu Manpages, smartctl (smartmontools)
  12. 12Percona (Peter Zaitsev), Using NVMe Command Line Tools to Check NVMe Flash Health

About the author

Marcus Thorne

Systems & Technical Editor

Marcus writes Forge PC's step-by-step build, troubleshooting and system optimisation guides. His background spans Windows kernel and power-state diagnostics, UEFI/BIOS configuration, NVMe storage arrays, ATX 3.1 power delivery and running local AI and LLM workloads on consumer graphics cards.

More from Marcus Thorne

Read next

How to Use Langflow as an MCP Server for Local AI Tools

How-To

How to Use Langflow as an MCP Server for Local AI Tools

Langflow can turn the flows in a project into MCP tools that apps such as LM Studio and Cursor can call. We cover choosing which flows to expose, naming them so agents pick the right one, connecting a client with an API key, and setting timeouts.

Marcus Thorne5 min

How to Use Langflow With Ollama to Build Local AI Agents on Your PC

How-To

How to Use Langflow With Ollama to Build Local AI Agents on Your PC

Langflow lets you build AI agents and workflows by wiring components together on a canvas. We show how to install it, connect it to a local Ollama model, build a simple agent with tools, call the flow from your own scripts and fix common problems.

Marcus Thorne6 min

How to Update Your Wi-Fi Driver in Windows 11

How-To

How to Update Your Wi-Fi Driver in Windows 11

Updating your Wi-Fi driver can fix dropouts and missing 6GHz or Wi-Fi 7 features. Using Microsoft's and Intel's own pages, we show how to find your adapter, use Windows Update, install Intel's latest Wi-Fi package, find drivers for older or non-Intel cards, and roll back a driver that makes things worse.

Marcus Thorne5 min