| Main index | Section 8 | Options |
| | |
| The namespace <nsid> to use instead of the namespace associated with the device. A nsid of "0" is used to retrieve the IDENTIFY_CONTROLLER data associated with that drive. | |
| 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 | Wite latency stats (Intel) |
| Page 0xc5 | Temperature stats (Intel) |
| Page 0xca | Advanced SMART information (Intel) |
| Page 0xca | Extended SMART information (Samsung) |
Specifying
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.
| | |
| Acquire action: | |
| 0 | Acquire |
| 1 | Preempt |
| 2 | Preempt and abort |
| | Current reservation key. |
| | Preempt reservation key. |
| | Reservation type: |
| 1 | Write Exclusive |
| 2 | Exclusive Access |
| 3 | Write Exclusive - Registrants Only |
| 4 | Exclusive Access - Registrants Only |
| 5 | Write Exclusive - All Registrants |
| 6 | Exclusive Access - All Registrants |
| | |
| Current reservation key. | |
| | |
| New reservation key. | |
| | |
| Register action: | |
| 0 | Register |
| 1 | Unregister |
| 2 | Replace |
| | Ignore Existing Key |
| | Change Persist Through Power Loss State: |
| 0 | No change to PTPL state |
| 2 | 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. |
| | |
| Current reservation key. | |
| | |
| Reservation type. | |
| | |
| Release action: | |
| 0 | Release |
| 1 | Clean |
| | |
| Print reservation status in hex. | |
| | |
| Use Extended Data Structure. | |
| | |
| The index fmt of the parameters to use. LBA Format #, as specified in the identification of the namespace using "nvmecontrol identify" command with a namespace specified maps this index into these parameters. | |
| | |
| Metadata Setting. mset | |
| 0 | do not transfer metadata with LBA information |
| 1 | Transfer the metadata as part of the extended LBA information. |
| | 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. |
| | 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. |
| | 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. |
| | 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.
| | |
| Specify the sanitize operation to perform. | |
| overwrite | |
|
Perform an overwrite operation by writing a user supplied
data pattern to the device one or more times.
The pattern is given by the
| |
| block | Perform a block erase operation. All the device's blocks are set to a vendor defined value, typically zero. |
| crypto | |
| Perform a cryptographic erase operation. The encryption keys are changed to prevent the decryption of the data. | |
| exitfailure | |
|
Exits a previously failed sanitize operation.
A failed sanitize operation can only be exited if it was
run in the unrestricted completion mode, as provided by the
| |
| | |
| The number of passes when performing an 'overwrite' operation. Valid values are between 1 and 16. The default is 1. | |
| | |
| No Deallocate After Sanitize. | |
| | |
| When performing an 'overwrite' operation, the pattern is inverted between consecutive passes. | |
| | |
| 32 bits of pattern to use when performing an 'overwrite' operation. The pattern is repeated as needed to fill each block. | |
| | |
| Perform the sanitize in the unrestricted completion mode. If the operation fails, it can later be exited with the 'exitfailure' operation. | |
| | |
| Run in "report only" mode. This will report status on a sanitize that is already running on the drive. | |
| | |
| List all supported power modes. | |
| | |
|
Set the power mode to
mode.
This must be a mode listed with the
nvmecontrol power -l command. | |
| | |
| 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. |
| 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. |
| | |
| Specify the device self-test command code. Common codes are: | |
| 0x1 | Start a short device self-test operation |
| 0x2 | Start an extended device self-test operation |
| 0xe | Start a vendor specific device self-test operation |
| 0xf | Abort the device self-test operation |
| | |
| Opcode to send. | |
| | |
| 32-bit value for CDW2. | |
| | |
| 32-bit value for CDW3. | |
| | |
| 32-bit value for CDW10. | |
| | |
| 32-bit value for CDW11. | |
| | |
| 32-bit value for CDW12. | |
| | |
| 32-bit value for CDW13. | |
| | |
| 32-bit value for CDW14. | |
| | |
| 32-bit value for CDW15. | |
| | |
| Length of the data for I/O (bytes). | |
| | |
| Length of the metadata segment for command (bytes). This is ignored and not implemented in nvme(4). | |
| | |
| Nvme command flags. | |
| | |
| Namespace ID for command (Ignored). | |
| | |
| Value to prefill payload with. | |
| | |
| Output in binary format (otherwise a hex dump is produced). | |
| | |
| Do not actually execute the command, but perform sanity checks on it. | |
| | |
| Command reads data from the device. | |
| | |
| Show all the command values on stdout. | |
| | |
| 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 possible, but limited to MAXPHYS bytes. Commands either read data or write it, but not both. Commands needing metadata are not supported by the nvme(4) drive.
nvmecontrol devlist
Display a list of NVMe controllers and namespaces along with their device nodes.
nvmecontrol identify nvme0
nvmecontrol identify -n 0 nvd0
Display a human-readable summary of the nvme0 IDENTIFY_CONTROLLER data. In this example, nvd0 is connected to nvme0.
nvmecontrol identify -x -v nvme0ns1
nvmecontrol identify -x -v -n 1 nvme0
Display an hexadecimal dump of the nvme0 IDENTIFY_NAMESPACE data for namespace 1.
nvmecontrol perftest -n 32 -o read -s 512 -t 30 nvme0ns1
Run 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.
nvmecontrol reset nvme0
nvmecontrol reset nda4
Perform a controller-level reset of the nvme0 controller. In this example, nda4 is wired to nvme0.
nvmecontrol logpage -p 1 nvme0
Display 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).
nvmecontrol logpage -p 0xc1 -v wdc nvme0
Display a human-readable summary of the nvme0's wdc-specific advanced SMART data.
nvmecontrol logpage -p 1 -x nvme0
Display a hexadecimal dump of the nvme0 controller's Error Information Log.
nvmecontrol logpage -p 0xcb -b nvme0 > /tmp/page-cb.bin
Print the contents of vendor specific page 0xcb as binary data on standard out. Redirect it to a temporary file.
nvmecontrol firmware -s 2 -f /tmp/nvme_firmware nvme0
Download the firmware image contained in "/tmp/nvme_firmware" to slot 2 of the nvme0 controller, but do not activate the image.
nvmecontrol firmware -s 4 -a nvme0
Activate the firmware in slot 4 of the nvme0 controller on the next reset.
nvmecontrol firmware -s 7 -f /tmp/nvme_firmware -a nvme0
Download the firmware image contained in "/tmp/nvme_firmware" to slot 7 of the nvme0 controller and activate it on the next reset.
nvmecontrol power -l nvme0
List all the current power modes.
nvmecontrol power -p 3 nvme0
Set the current power mode.
nvmecontrol power nvme0
Get the current power mode.
nvmecontrol identify -n 0 nda0
Identify the drive data associated with the nda0 device. The corresponding nvmeX devices is used automatically.
nvmecontrol identify nda0
Get the namespace parameters associated with the nda0 device. The corresponding nvmeXnsY device is used automatically.
nvmecontrol format -f 2 -m 0 -p 0 -l 0 -C nvme2
Format 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.
The NVM Express Base Specification, June 10, 2019.
This man page was written by Jim Harris <Mt jimharris@FreeBSD.org>.
| NVMECONTROL (8) | May 3, 2024 |
| Main index | Section 8 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
| “ | If you have any trouble sounding condescending, find a Unix user to show you how it's done. | ” |
| — Scott Adams | ||