$linuxjunkies
>

nvme(1)

Interact with NVMe (Non-Volatile Memory Express) solid-state drives and manage their settings.

UbuntuDebianFedoraArch

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

FlagWhat it does
listList all NVMe devices and controllers detected on the system
id-ctrlDisplay detailed controller identification information
id-nsDisplay detailed namespace identification information
smart-logRetrieve and display S.M.A.R.T. health information
get-featureQuery specific device features (followed by feature ID)
set-featureSet device features with optional value argument
-H, --human-readableFormat output in human-readable units (bytes, KB, MB, etc.)
-o, --output-formatSpecify output format: normal, json, or binary
-l, --namespace-idSpecify target namespace ID (default is 1)
fw-logRetrieve firmware log entries from the device
resetReset the NVMe controller
formatFormat a namespace (destructive operation)

Examples

List all NVMe devices connected to the system with basic info

sudo nvme list

Show detailed controller information for /dev/nvme0 in human-readable format

sudo nvme id-ctrl /dev/nvme0 -H

Display S.M.A.R.T. health and usage data for the first NVMe drive

sudo nvme smart-log /dev/nvme0 -H

Show namespace details including capacity and supported features

sudo nvme id-ns /dev/nvme0n1 -H

List NVMe devices as JSON and pipe to jq for custom parsing

sudo nvme list -o json | jq

Query feature ID 2 (power management) from the device

sudo nvme get-feature /dev/nvme0 -f 2 -H

Retrieve and display firmware log entries for diagnostic purposes

sudo nvme fw-log /dev/nvme0

Perform a controller reset (use cautiously; may interrupt I/O)

sudo nvme reset /dev/nvme0

Related commands