NVMECONTROL(8) | MidnightBSD System Manager's Manual | NVMECONTROL(8) |
nvmecontrol
— NVM
Express control utility
nvmecontrol |
devlist |
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 [-c
crkey] ⟨-k
nrkey⟩ ⟨-r
rrega⟩ [-i
iekey] [-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] [-o
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⟩ |
NVM Express (NVMe) is a storage protocol standard, for SSDs and other high-speed storage devices over PCI Express.
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
IDENTIFY_CONTROLLER
data associated with that
drive.The logpage command knows how to print log pages of various types. It also knows about vendor specific log pages from hgst/wdc and intel. Note that some vendors use the same log page numbers for different data.
Page
0x01
Page
0x02
Page
0x03
Page
0x04
Page
0x05
Page
0x06
Page
0x80
Page
0x81
Page
0xc1
Page
0xc1
Page
0xc2
Page
0xc5
Page
0xca
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.
Various namespace management commands. If namespace management is supported by device, allow list, create and delete namespaces, list, attach and detach controllers to namespaces.
Reports the namespace id and controller device associated with the ⟨namespace-id⟩ or ⟨device-id⟩ argument.
Acquire or preempt namespace reservation, using specified parameters:
Register, unregister or replace reservation key, using specified parameters:
Release or clear reservation, using specified parameters:
Print reservation status, using specified parameters:
Format either specified namespace, or all namespaces of specified
controller, using specified parameters: fmt LBA
Format, mset Metadata Settings,
pi Protection Information, pil
Protection Information Location. 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. Option -E
enables User Data Erase during format. Option -C
enables Cryptographic Erase during format.
Sanitize NVM subsystem of specified controller, using specified parameters:
-a
operation-p
argument. The number of times is given by
the -c
argument.-U
argument.-c
passes-d
-I
-p
pattern-U
-r
Manage the power modes of the NVMe controller.
-l
-p
modenvmecontrol power -l
-w
hintStart the specified device self-test:
The various wdc command 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.
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
--opcode
opcode-2
--cdw2
value-3
--cdw3
value-4
--cdw10
value-5
--cdw11
value-6
--cdw12
value-7
--cdw13
value-8
--cdw14
value-9
--cdw15
value-l
--data-len
-m
--metadata-len
-f
--flags
-n
--namespace-id
-p
--prefill
-b
--raw-binary
-d
--dry-run
-r
--read
-s
--show-command
-w
--write
MAXPHYS
bytes. Commands either read data or write it,
but not both. Commands needing metadata are not supported by the
nvme(4) drive.
Where ⟨namespace-id⟩ is required, you can use either the nvmeXnsY device, or the disk device such as ndaZ or nvdZ. The leading /dev/ is omitted. Where ⟨device-id⟩ is required, you can use either the nvmeX device, or the disk device such as nda Z 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.
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.
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.
The NVM Express Base Specification, https://nvmexpress.org/wp-content/uploads/NVM-Express-1_4-2019.06.10-Ratified.pdf, June 10, 2019.
The nvmecontrol
utility appeared in
FreeBSD 9.2.
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>.
December 19, 2020 | midnightbsd-3.1 |