nvme
Manage and monitor NVMe storage devices
TLDR
List all nvme devices
Show device information
SYNOPSIS
nvme <command> [options] [arguments]
The nvme utility acts as a meta-command, where <command> refers to a specific subcommand (e.g., identify, smart-log, format) that performs a particular operation on an NVMe device. Each subcommand typically has its own specific set of options and arguments.
PARAMETERS
--device, -d
Specifies the NVMe device path (e.g., /dev/nvme0 or /dev/nvme0n1). This is often a mandatory or highly common option for subcommands.
--help, -h
Displays general help for the nvme command, or help for a specific subcommand if provided immediately after the subcommand (e.g., nvme identify --help).
--json
Outputs the command results in JSON format, which is useful for scripting and programmatic parsing.
--output-format, -o
Specifies the output format, e.g., 'normal' (default), 'json', 'binary'. Not all subcommands support all formats.
--human-readable, -H
Displays sizes and capacities in human-readable units (e.g., GB, TB).
--verbose, -v
Increases the verbosity of the output, showing more details about the operation.
DESCRIPTION
nvme is a powerful command-line interface tool used for managing Non-Volatile Memory Express (NVMe) devices. It provides a comprehensive set of functionalities for interacting with NVMe SSDs, including administrative tasks like firmware updates, namespace management, health monitoring, error logging, and I/O operations. This utility allows users and administrators to configure, debug, and monitor NVMe storage devices, making it an essential tool for systems utilizing modern high-performance storage that leverages the PCIe interface for faster data transfer.
CAVEATS
Most nvme commands require root privileges to execute, as they interact directly with hardware devices. Improper use of commands like nvme format or nvme firmware activate can lead to data loss or render the NVMe device unusable. Always ensure you are targeting the correct device and understand the implications of the subcommand being executed.
KEY SUBCOMMANDS
The nvme command's power comes from its various subcommands, each performing a specific task:
nvme list: Lists all NVMe devices and their basic information.
nvme identify: Displays detailed information about a specific NVMe controller or namespace.
nvme smart-log: Retrieves and displays S.M.A.R.T. (Self-Monitoring, Analysis, and Reporting Technology) and health information.
nvme format: Securely formats an NVMe namespace, erasing all data.
nvme firmware activate/download: Manages firmware updates for the NVMe device.
DEVICE NAMING CONVENTION
NVMe devices in Linux typically follow the naming convention /dev/nvmeXnYmP, where:
X: The controller ID (e.g., 0, 1).
n: Denotes a namespace.
Y: The namespace ID (e.g., 1, 2).
mP: (Optional) Denotes a partition on a namespace (e.g., p1, p2).
HISTORY
The Non-Volatile Memory Express (NVMe) specification emerged in 2011, designed to overcome the limitations of older storage interfaces (like SATA and SAS) by leveraging the high-speed PCI Express (PCIe) bus. This allowed SSDs to achieve significantly higher performance. The nvme-cli project, which provides the nvme command-line utility, was developed to provide user-space control and management capabilities for these advanced devices in Linux. Its development has closely tracked the increasing adoption of NVMe technology in data centers, enterprise servers, and consumer systems, becoming the standard tool for NVMe device interaction.