NVMECONTROL(8)
✨ NAME ✨
nvmecontrol — NVM Express control utility. Bestie, this is the NVMECONTROL(8) page from the System Manager's Manual, and it's literally your cheat sheet for NVMe stuff. 💅
🌸 SYNOPSIS 🌸
nvmecontrol devlist [-h]
nvmecontrol identify [-v] [-x] [-n nsid] ⟨device-id | namespace-id⟩
nvmecontrol perftest ⟨-n num_threads⟩ ⟨-o read|write⟩ [-p]
⟨-s size_in_bytes⟩ ⟨-t time_in_sec⟩ ⟨namespace-id⟩
nvmecontrol reset ⟨device-id⟩
nvmecontrol logpage ⟨-p page_id⟩ [-x] [-v vendor-string] [-b] [-f LSP]
[-i LSI] [-r] ⟨device-id | namespace-id⟩
nvmecontrol ns active ⟨device-id⟩
nvmecontrol ns allocated ⟨device-id⟩
nvmecontrol ns attach ⟨-n nsid⟩ ⟨-c cntid⟩ ⟨device-id⟩
nvmecontrol ns attached ⟨-n nsid⟩ ⟨device-id⟩
nvmecontrol ns controllers ⟨device-id⟩
nvmecontrol ns create ⟨-s nsze⟩ [-c ncap] [-f lbaf] [-m mset] [-n nmic]
[-p pi] [-l pil] [-L flbas] [-d dps] ⟨device-id⟩
nvmecontrol ns delete ⟨-n nsid⟩ ⟨device-id⟩
nvmecontrol ns detach ⟨-n nsid⟩ ⟨-c cntid⟩ ⟨device-id⟩
nvmecontrol ns identify [-v] [-x] ⟨-n nsid⟩ ⟨device-id⟩
nvmecontrol nsid ⟨device-id | namespace-id⟩
nvmecontrol resv acquire ⟨-c crkey⟩ [-p prkey] ⟨-t rtype⟩ ⟨-a racqa⟩
⟨namespace-id⟩
nvmecontrol resv register [-i] [-c crkey] ⟨-k nrkey⟩ ⟨-r rrega⟩
[-p cptpl] ⟨namespace-id⟩
nvmecontrol resv release ⟨-c crkey⟩ ⟨-t rtype⟩ ⟨-a rrela⟩ ⟨namespace-id⟩
nvmecontrol resv report [-e] [-v] [-x] ⟨namespace-id⟩
nvmecontrol firmware [-s slot] [-f path_to_firmware] [-a] ⟨device-id⟩
nvmecontrol format [-f fmt] [-m mset] [-p pi] [-l pil] [-E] [-C]
⟨device-id | namespace-id⟩
nvmecontrol sanitize ⟨-a sanact⟩ [-c owpass] [-d] [-p ovrpat] [-r] [-I]
[-U] ⟨device-id⟩
nvmecontrol power [-l] [-p -power_state] [-w -workload_hint]
nvmecontrol selftest ⟨-c code⟩ ⟨device-id | namespace-id⟩
nvmecontrol wdc cap-diag [-o -path_template] ⟨device-id⟩
nvmecontrol wdc drive-log [-o -path_template] ⟨device-id⟩
nvmecontrol wdc get-crash-dump [-o -path_template] ⟨device-id⟩
nvmecontrol admin-passthru [args] ⟨device-id⟩
nvmecontrol io-passthru [args] ⟨namespace-id⟩
nvmecontrol discover [-v] [-t transport] [-q HostNQN]
nvmecontrol connect [-FGg] [-c cntl-id] [-i queues] [-k seconds]
[-l seconds] [-r seconds] [-t transport] [-q HostNQN]
[-Q entries] ⟨address⟩ ⟨SubNQN⟩
nvmecontrol connect-all [-FGg] [-i queues] [-k seconds] [-l seconds]
[-r seconds] [-t transport] [-q HostNQN] [-Q entries]
⟨address⟩
nvmecontrol disconnect ⟨device-id | namespace-id | SubNQN⟩
nvmecontrol reconnect ⟨device-id⟩
nvmecontrol reconnect [-FGg] [-i queues] [-k seconds] [-l seconds]
[-r seconds] [-t transport] [-q HostNQN] [-Q entries]
⟨device-id⟩ ⟨address⟩
nvmecontrol telemetry-log -O output-file [-d data-area] ⟨device-id⟩
🦋 DESCRIPTION 🦋
Okay so NVM Express (NVMe) is a storage protocol standard for SSDs and other high-speed storage devices over PCI Express as well as remote storage devices accessed via a network fabric. Iconic.
💖 devlist
List all NVMe controllers and namespaces along with their device nodes. With the -h argument, use unit suffixes: Byte, Kibibyte, Mebibyte, Gibibyte, Tebibyte and Pebibyte (based on powers of 1024) when showing the disk space. By default, uses Mebibyte. ✨
🎀 identify
The identify commands reports information from the drive's IDENTIFY_CONTROLLER if a device-id is specified. It reports IDENTIFY_NAMESPACE data if a namespace-id is specified. When used with disk names, the IDENTIFY_NAMESPACE data is reported, unless the namespace nsid is overridden with the -n flag. Then that namespace's data is reported, if it exists. The command accepts the following parameters:
-n— The namespace ⟨nsid⟩ to use instead of the namespace associated with the device. A nsid of “0” is used to retrieve theIDENTIFY_CONTROLLERdata associated with that drive.
🌈 logpage
The logpage command knows how to print log pages of various types. It also knows about vendor specific log pages from HGST/WDC, Samsung, Micron and Intel. Note that some vendors use the same log page numbers for different data. 😭
- Page
0x01— Drive Error Log - Page
0x02— Health/SMART Data - Page
0x03— Firmware Information - Page
0x04— Changed Namespace List - Page
0x05— Commands Supported and Effects - Page
0x06— Device Self-test - Page
0x80— Reservation Notification - Page
0x81— Sanitize Status - Page
0xc1— Advanced SMART information (WDC/HGST) - Page
0xc1— Read latency stats (Intel) - Page
0xc2— Write latency stats (Intel) - Page
0xc5— Temperature stats (Intel) - Page
0xca— Advanced SMART information (Intel) - Page
0xca— Extended SMART information (Samsung) - Page
0xca— Vendor Unique SMART information (Micron)
Specifying -v help will list all valid vendors and pages. -x will print the page as hex. -b will print the binary data for the page. -s will set Log Specific Field. -i will set Log Specific Identifier. -r will set Retain Asynchronous Event. 🫶
💅 ns
Various namespace management commands. If namespace management is supported by device, allow list, create and delete namespaces, list, attach and detach controllers to namespaces. Each NVM device consists of one or more NVM subsystems. Each NVM subsystem has one or more NVM ports. Each NVM port is attached to one or more NVM controllers (though typically 1). Each NVM controller is attached to one or more namespaces.
After a namespace is created, it is considered “allocated”. All namespaces that have not been created are unallocated. An allocated namespace may be active or inactive. An active namespace is attached to the controller and may be interacted with. A namespace can move from active to inactive when detached. An allocated namespace may be deleted to become unallocated. For more details on the nuances of NVM namespaces, please see section 2 Theory of Operation and section 3 NVM Express Architecture of the latest NVM standard. 📚
🧚 ns active
Provide a list of active namespace identifiers for the given NVM controller.
🍓 ns allocated
Provide a list of allocated namespace identifiers for the given NVM controller.
🦋 ns attach
Attach an nsid to a controller. The primary controller is used if one is not specified.
🌸 ns attached
Provide a list of controllers attached to a nsid. If only a nvme controller argument is provided, a nsid must also be specified.
👑 ns controllers
Provide a list of all controllers in the NVM subsystem.
💜 ns create
Creates a new namespace. ✨
💀 ns delete
Delete a namespace. It must be currently inactive.
🎀 ns detach
Detach a namespace from a controller. The namespace will become inaccessible, but its contents will remain if it is activated again.
🔥 ns identify
Print detailed information about the namespace.
⭐ nsid
Reports the namespace id and controller device associated with the ⟨namespace-id⟩ or ⟨device-id⟩ argument.
💜 resv acquire
Acquire or preempt namespace reservation, using specified parameters:
-a— Acquire action:0— Acquire1— Preempt2— Preempt and abort
-c— Current reservation key.-p— Preempt reservation key.-t— Reservation type:1— Write Exclusive2— Exclusive Access3— Write Exclusive - Registrants Only4— Exclusive Access - Registrants Only5— Write Exclusive - All Registrants6— Exclusive Access - All Registrants
🫶 resv register
Register, unregister or replace reservation key, using specified parameters:
-c— Current reservation key.-k— New reservation key.-r— Register action:0— Register1— Unregister2— Replace
-i— Ignore Existing Key-p— Change Persist Through Power Loss State:0— No change to PTPL state2— Set PTPL state to ‘0’. Reservations are released and registrants are cleared on a power on.3— Set PTPL state to ‘1’. Reservations and registrants persist across a power loss.
✨ resv release
Release or clear reservation, using specified parameters:
-c— Current reservation key.-t— Reservation type.-a— Release action:0— Release1— Clean
🦋 resv report
Print reservation status, using specified parameters:
-x— Print reservation status in hex.-e— Use Extended Data Structure.
🔥 format
Format either specified namespace, or all namespaces of specified controller, using specified parameters:
-f fmt— The index fmt of the parameters to use. LBA Format #, as specified in the identification of the namespace usingnvmecontrol identifycommand with a namespace specified maps this index into these parameters.-m mset— Metadata Setting. mset0— do not transfer metadata with LBA information1— Transfer the metadata as part of the extended LBA information.
-p pi— Protection Information.0— Protection Information not enabled.1— Type 1 information protection enabled.2— Type 2 information protection enabled.3— Type 3 information protection enabled.
-l pil— Protection Information Location.0— Transfer the protection metadata as the last N bytes of the transfer.1— Transfer the protection metadata as the first N bytes of the transfer.
-E— Enables User Data Erase during format. All users data is erased and subsequent reads are indeterminate. The drive may implement this as a cryptographic erase or it may physically erase the underlying media.-C— Enables Cryptographic Erase during format. All user data is erased cryptographically by deleting the encryption key, rendering it unintelligible.
When formatting specific namespace, existing values are used as defaults. When formatting all namespaces, all parameters should be specified. Some controllers may not support formatting or erasing specific or all namespaces. The nvme(4) driver does not currently support metadata and protection information transfers. No cap, that's important.
🌸 sanitize
Sanitize NVM subsystem of specified controller, using specified parameters:
-a operation— Specify the sanitize operation to perform.overwrite— does an overwrite op: writes a user-supplied data pattern onto the device one or more times. The pattern comes from-pand the number of times comes from-c. 💅block— does a block erase. Every block on the device gets set to a vendor defined value, typically zero.crypto— does a cryptographic erase. The encryption keys get changed so the old data literally cannot be decrypted. Gone gone.exitfailure— exits a sanitize operation that already failed. Heads up tho: a failed sanitize can only be exited if it was run in the unrestricted completion mode (that's the-Uargument). No-U, no exit. 😭1,2,3,4— nvme-cli compatible-avalues for “exitfailure”, “block”, “overwrite”, and “crypto” respectively.-cpasses — the number of passes for an ‘overwrite’ operation. Valid values are between 1 and 16. Default is 1.-d— No Deallocate After Sanitize.-I— when doing an ‘overwrite’, invert the pattern between consecutive passes. Sneaky but valid.-ppattern — 32 bits of pattern to use for an ‘overwrite’ operation. The pattern is repeated as needed to fill each block.-U— do the sanitize in unrestricted completion mode. If it fails, you can later exit it with the ‘exitfailure’ operation.-r— run in “report only” mode. This just reports status on a sanitize that's already running on the drive. Zero drama, read only.
🎀 power
Manage the power modes of the NVMe controller. Self care for hardware, honestly.
-l— list all supported power modes.-pmode — set the power mode to mode. It absolutely must be a mode that was listed by the
nvmecontrol power -l
command. Like, don't just make one up bestie.
-whint — set the workload hint for automatic power mode control:0— No workload hint is provided.1— Extended idle period workload. The device is often idle for minutes at a time. A burst of write commands comes in over a period of seconds. Then the device returns to being idle. Main character nap energy.2— Heavy sequential writes. A huge number of sequential writes will be submitted, filling the submission queues.- Other — All other values are reserved and have no standard meaning.
Please see the “NVM Subsystem Workloads” section of the relevant NVM Express Base Standard for details.
🌸 selftest
Start the specified device self-test:
-ccode — specify the device self-test command code. Common codes are:0x1— Start a short device self-test operation0x2— Start an extended device self-test operation0xe— Start a vendor specific device self-test operation0xf— Abort the device self-test operation
🦋 wdc
The various wdc commands retrieve log data from the wdc/hgst drives. The -o flag specifies a path template to use to output the files. Each file takes the path template (which defaults to nothing), appends the drive's serial number and the type of dump it is, followed by .bin. These logs must be sent to the vendor for analysis — this tool only provides a way to extract them, ok? It's giving middleman. 💅
⭐ passthru
The “admin-passthru” and “io-passthru” commands send NVMe commands to either the administrative or the data part of the device. These commands are expected to be compatible with nvme-cli. Please see the NVM Express Base Standard for details.
-o,--opcodeopcode — Opcode to send.-2,--cdw2value — 32-bit value for CDW2.-3,--cdw3value — 32-bit value for CDW3.-4,--cdw10value — 32-bit value for CDW10.-5,--cdw11value — 32-bit value for CDW11.-6,--cdw12value — 32-bit value for CDW12.-7,--cdw13value — 32-bit value for CDW13.-8,--cdw14value — 32-bit value for CDW14.-9,--cdw15value — 32-bit value for CDW15.-l,--data-len— Length of the data for I/O (bytes).-m,--metadata-len— Length of the metadata segment for command (bytes). Lowkey this is ignored and not implemented innvme(4).-f,--flags— Nvme command flags.-n,--namespace-id— Namespace ID for command (Ignored).-p,--prefill— Value to prefill payload with.-b,--raw-binary— Output in binary format (otherwise a hex dump is produced).-d,--dry-run— Do not actually execute the command, but perform sanity checks on it.-r,--read— Command reads data from the device.-s,--show-command— Show all the command values on stdout.-w,--write— Command writes data to the device.
Send arbitrary commands to the device. Can be used to extract vendor specific logs. Transfers to/from the device are possible, but limited to MAXPHYS bytes. Commands either read data or write it, but not both — pick a lane. Commands needing metadata are not supported by the nvme(4) drive.
🔥 discover
List the remote controllers advertised by a remote Discovery Controller:
-ttransport — Transport to use. The default istcp.-qHostNQN — NVMe Qualified Name to use for this host. By default an NQN is auto-generated from the current host's UUID. Slay, automatic.-v— Display theIDENTIFY_CONTROLLERdata for the Discovery Controller.
💜 connect
Establish an association with the I/O controller named SubNQN at address. The address must include a port.
An admin queue pair and one or more I/O queue pairs are created and handed off to the kernel to create a new controller device.
-ccntl-id — Remote controller ID to request:dynamic— Request a dynamic controller ID for controllers using the dynamic controller model. This is the default.static— Request a dynamic controller ID for controllers using the static controller model.- number — Request a specific controller ID for controllers using the static controller model.
-F— Request submission queue flow control. By default submission queue flow control is disabled unless the remote controller requires it.-g— Enable TCP PDU header digests.-G— Enable TCP PDU data digests.-iqueues — Number of I/O queue pairs to create. The default is 1.-kseconds — Keep Alive timer duration in seconds. The default is 120.-lseconds — Controller Loss timer duration in seconds. The default is 600.
This timer starts when an association is lost with a remote I/O controller and is cancelled when a new association is established. If the timer expires, the controller device is deleted. A setting of zero disables this timer. 🫶
-rseconds — Reconnect timer duration in seconds. The default is 10.
When an association is lost with a remote I/O controller, the controller device will request reconnection via periodic devctl(4) notifications until either a new association is established or the controller device is deleted. This timer sets the interval between each devctl(4) notification. Note that the first notification is triggered immediately after an association is lost. A setting of zero disables this timer.
-ttransport — Transport to use. The default istcp.-qHostNQN — NVMe Qualified Name to use for this host. By default an NQN is auto-generated from the current host's UUID.-Qentries — Number of entries in each I/O queue. The default is the minimum of 128 or the maximum queue size reported by theMQESfield of the remote host'sCAPproperty.
🌈 connect-all
Query the Discovery Controller at address and establish an association for each advertised I/O controller. The -t flag determines the transport used for the initial association with the Discovery Controller and defaults to tcp. All other flags are used to control properties of each I/O assocation as described above for the connect command. Basically connect but make it a group chat. ✨
🍓 disconnect
Delete the controller device associated with a remote I/O controller, including any active association and open queues. It's over.
🧚 reconnect
Reestablish an association for the remote I/O controller associated with device-id. If an address is not provided, the resolved address and settings from the previous association are used to establish a new association. If an address is provided, the supplied address and command line flags are used to establish a new association. In this case, the address must include a port and the flags have the same meaning for the new association as described above for the connect command.
👑 telemetry-log
Extract the telemetry log associated with device-id, using the specified parameters:
-Ooutput-file — Output file for the data. This parameter is mandatory. Non-negotiable bestie.-ddata-area — The data area is either1,2or3.
🦋 DEVICE NAMES
Where ⟨namespace-id⟩ is required, you can use either the nvmeXnsY device, or the disk device such as ndaZ or nvdZ. The leading /dev/ may be omitted.
Where ⟨device-id⟩ is required, you can use either the nvmeX device, or the disk device such as ndaZ or nvdZ.
For commands that take an optional ⟨nsid⟩ you can use it to get information on other namespaces, or to query the drive itself. A ⟨nsid⟩ of “0” means query the drive itself.
🌸 FABRICS TRANSPORTS
The following NVM Express over Fabrics transports are supported for accessing remote controllers:
tcp— TCP transport
⭐ NETWORK ADDRESSES
Network addresses for remote controllers can use one of the following formats:
[IPv6 address] :portIPv4 address :porthostname:port[IPv6 address]IPv6 addressIPv4 addresshostname
If a port is not provided, a default value is used if possible. 💖
🌸 EXAMPLES 🌸
Okay bestie, this is the part where it all clicks. Real commands, real scenarios, all of them copy-paste-able. Let's go.
nvmecontrol devlist
Displays a list of NVMe controllers and namespaces along with their device nodes. Boom. Your whole roster, laid out. 💅
nvmecontrol identify nvme0
nvmecontrol identify -n 0 nvd0
Displays a human-readable summary of the nvme0 IDENTIFY_CONTROLLER data. In this example, nvd0 is connected to nvme0. See how that works? Two doors, same room. 🚪✨
nvmecontrol identify -x -v nvme0ns1
nvmecontrol identify -x -v -n 1 nvme0
Displays an hexadecimal dump of the nvme0 IDENTIFY_NAMESPACE data for namespace 1. Hex dump hours, fr fr — this is the raw receipts. 🔥
nvmecontrol perftest -n 32 -o read -s 512 -t 30 nvme0ns1
Runs a performance test on nvme0ns1 using 32 kernel threads for 30 seconds. Each thread will issue a single 512 byte read command. Results are printed to stdout when 30 seconds expires. Thirty seconds of pure chaos and then numbers. We love a timed event. ⏱️👑
nvmecontrol reset nvme0
nvmecontrol reset nda4
Performs a controller-level reset of the nvme0 controller. In this example, nda4 is wired to nvme0. The ol' reset. Sometimes you just gotta. 😤
nvmecontrol logpage -p 1 nvme0
Displays a human-readable summary of the nvme0 controller's Error Information Log. Log pages defined by the NVMe specification include Error Information Log (ID=1), SMART/Health Information Log (ID=2), and Firmware Slot Log (ID=3). Memorize those three IDs, iykyk. 🧠✨
nvmecontrol logpage -p 0xc1 -v wdc nvme0
Displays a human-readable summary of the nvme0's wdc-specific advanced SMART data. Vendor-specific content, ultra niche, and honestly? Iconic. 🫶
nvmecontrol logpage -p 1 -x nvme0
Displays a hexadecimal dump of the nvme0 controller's Error Information Log. Same page as before, but raw. 🌈
nvmecontrol logpage -p 0xcb -b nvme0 > /tmp/page-cb.bin
Prints the contents of vendor specific page 0xcb as binary data on standard out. Redirect it to a temporary file. That > is doing the heavy lifting, bestie — it's the whole point. 💖
nvmecontrol firmware -s 2 -f /tmp/nvme_firmware nvme0
Downloads the firmware image contained in "/tmp/nvme_firmware" to slot 2 of the nvme0 controller, but does not activate the image. Download only. Chill. No surprises. 🎀
nvmecontrol firmware -s 4 -a nvme0
Activates the firmware in slot 4 of the nvme0 controller on the next reset. Note the next reset part — nothing's happening right this second. ⭐
nvmecontrol firmware -s 7 -f /tmp/nvme_firmware -a nvme0
Downloads the firmware image contained in "/tmp/nvme_firmware" to slot 7 of the nvme0 controller and activates it on the next reset. Full send. 🚀
nvmecontrol power -l nvme0
Lists all the current power modes. Window shopping for wattage. 🔋
nvmecontrol power -p 3 nvme0
Sets the current power mode. Committing to a vibe. ⚡
nvmecontrol power nvme0
Gets the current power mode. Just peeking. 🙈
nvmecontrol identify -n 0 nda0
Identifies the drive data associated with the nda0 device. The corresponding nvmeX devices is used automatically. You don't even have to look it up — it does the math for you. 🧚
nvmecontrol identify nda0
Gets the namespace parameters associated with the nda0 device. The corresponding nvmeXnsY device is used automatically. Again — automatic. Slay. 🦋
nvmecontrol format -f 2 -m 0 -p 0 -l 0 -C nvme2
Formats all the name spaces on nvme2 using parameters from “LBA Format #2” with no metadata or protection data using cryptographic erase. If the nvmecontrol identify -n 1 nvme2 command ended with
LBA Format #00: Data Size: 512 Metadata Size: 0 Performance: Good
LBA Format #01: Data Size: 512 Metadata Size: 8 Performance: Good
LBA Format #02: Data Size: 4096 Metadata Size: 0 Performance: Good
LBA Format #03: Data Size: 4096 Metadata Size: 8 Performance: Good
LBA Format #04: Data Size: 4096 Metadata Size: 64 Performance: Good
then this would give a 4k data format for at least namespace 1, with no metadata. See how #02 is the 4096-with-zero-metadata one? That's the pick. 💅
Okay real talk for a sec: format wipes stuff. Cryptographic erase does not mean "probably fine". Read your numbers before you send it. 😭
💜 DYNAMIC LOADING 💜
The directories /lib/nvmecontrol and /usr/local/lib/nvmecontrol are scanned for any .so files. These files are loaded. The members of the top linker set are added to the top-level commands. The members of the logpage linker set are added to the logpage parsers.
Basically: drop a .so in there and it can grow new commands on the top level, or new parsers under logpage. Extendable by design, no cap. 🧩✨
🎀 SEE ALSO 🎀
The NVM Express Base Specification, https://nvmexpress.org/wp-content/uploads/NVM-Express-1_4-2019.06.10-Ratified.pdf, June 10, 2019.
(The spec. The sacred text. Go read it if you want the why behind everything above. 👑)
🍓 HISTORY 🍓
The nvmecontrol utility appeared in FreeBSD 9.2.
Era noted. It's been around. Vintage, even. 🕰️
🌟 AUTHORS 🌟
nvmecontrol was developed by Intel and originally written by Jim Harris <jimharris@FreeBSD.org>.
This man page was written by Jim Harris <jimharris@FreeBSD.org>.
Shoutout Jim. Both the tool and the page. Multitasking king. 🫡👑
And that's the whole page, bestie — you made it to the end 🎉 This one's from Debian, dated February 20, 2026, and it's called NVMECONTROL(8). Go forth and devlist responsibly. 💖✨
📦 where this page comes from
- freebsd 15.1: base 15.1
- Copyright (c) 2020 Warner Losh <imp@FreeBSD.org>
- Copyright (c) 2018-2019 Alexander Motin <mav@FreeBSD.org>
- Copyright (c) 2012 Intel Corporation
- 💖 girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms