nvme(1)
Interact with NVMe (Non-Volatile Memory Express) solid-state drives and manage their settings.
Synopsis
nvme <command> [<device>] [<options>]Description
NVMe is a command-line utility for communicating with and controlling NVMe SSDs. It allows you to query device information, monitor health, manage namespaces, update firmware, and adjust power settings on NVMe drives connected to your system.
NVMe drives are typically accessed as /dev/nvmeX or /dev/nvmeXnY where X is the controller number and Y is the namespace number. Most operations require root privileges.
Common options
| Flag | What it does |
|---|---|
list | List all NVMe devices and controllers detected on the system |
id-ctrl | Display detailed controller identification information |
id-ns | Display detailed namespace identification information |
smart-log | Retrieve and display S.M.A.R.T. health information |
get-feature | Query specific device features (followed by feature ID) |
set-feature | Set device features with optional value argument |
-H, --human-readable | Format output in human-readable units (bytes, KB, MB, etc.) |
-o, --output-format | Specify output format: normal, json, or binary |
-l, --namespace-id | Specify target namespace ID (default is 1) |
fw-log | Retrieve firmware log entries from the device |
reset | Reset the NVMe controller |
format | Format a namespace (destructive operation) |
Examples
List all NVMe devices connected to the system with basic info
sudo nvme listShow detailed controller information for /dev/nvme0 in human-readable format
sudo nvme id-ctrl /dev/nvme0 -HDisplay S.M.A.R.T. health and usage data for the first NVMe drive
sudo nvme smart-log /dev/nvme0 -HShow namespace details including capacity and supported features
sudo nvme id-ns /dev/nvme0n1 -HList NVMe devices as JSON and pipe to jq for custom parsing
sudo nvme list -o json | jqQuery feature ID 2 (power management) from the device
sudo nvme get-feature /dev/nvme0 -f 2 -HRetrieve and display firmware log entries for diagnostic purposes
sudo nvme fw-log /dev/nvme0Perform a controller reset (use cautiously; may interrupt I/O)
sudo nvme reset /dev/nvme0