2 .\" Copyright (c) 2020 Warner Losh <imp@FreeBSD.org>
3 .\" Copyright (c) 2018-2019 Alexander Motin <mav@FreeBSD.org>
4 .\" Copyright (c) 2012 Intel Corporation
5 .\" All rights reserved.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\" notice, this list of conditions, and the following disclaimer,
12 .\" without modification.
13 .\" 2. Redistributions in binary form must reproduce at minimum a disclaimer
14 .\" substantially similar to the "NO WARRANTY" disclaimer below
15 .\" ("Disclaimer") and any redistribution must be conditioned upon
16 .\" including a substantially similar Disclaimer requirement for further
17 .\" binary redistribution.
20 .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 .\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 .\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
23 .\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 .\" HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
28 .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
29 .\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 .\" POSSIBILITY OF SUCH DAMAGES.
32 .\" nvmecontrol man page.
34 .\" Author: Jim Harris <jimharris@FreeBSD.org>
43 .Nd NVM Express control utility
52 .Aq Ar device-id | Ar namespace-id
55 .Aq Fl n Ar num_threads
56 .Aq Fl o Ar read|write
58 .Aq Fl s Ar size_in_bytes
59 .Aq Fl t Ar time_in_sec
68 .Op Fl v Ar vendor-string
73 .Aq Ar device-id | Ar namespace-id
121 .Aq Ar device-id | Ar namespace-id
152 .Op Fl f Ar path_to_firmware
163 .Aq Ar device-id | Ar namespace-id
178 .Op Fl w workload_hint
182 .Aq Ar device-id | Ar namespace-id
185 .Op Fl o path_template
189 .Op Fl o path_template
192 .Ic wdc get-crash-dump
193 .Op Fl o path_template
199 .\" .Ic wdc purge-monitor
210 NVM Express (NVMe) is a storage protocol standard, for SSDs and other
211 high-speed storage devices over PCI Express.
213 The identify commands reports information from the drive's
214 .Dv IDENTIFY_CONTROLLER
219 .Dv IDENTIFY_NAMESPACE
223 When used with disk names, the
224 .Dv IDENTIFY_NAMESPACE
225 data is reported, unless the namespace
227 is overridden with the
230 Then that namespace's data is reported, if it exists.
231 The command accepts the following parameters:
236 to use instead of the namespace associated with the device.
241 is used to retrieve the
242 .Dv IDENTIFY_CONTROLLER
243 data associated with that drive.
246 The logpage command knows how to print log pages of various types.
247 It also knows about vendor specific log pages from hgst/wdc and intel.
248 Note that some vendors use the same log page numbers for different data.
250 .Bl -tag -compact -width "Page 0x00"
258 Changed Namespace List
260 Commands Supported and Effects
264 Reservation Notification
268 Advanced SMART information (WDC/HGST)
270 Read latency stats (Intel)
272 Wite latency stats (Intel)
274 Temperature stats (Intel)
276 Advanced SMART information (Intel)
282 will list all valid vendors and pages.
284 will print the page as hex.
286 will print the binary data for the page.
288 will set Log Specific Field.
290 will set Log Specific Identifier.
292 will set Retain Asynchronous Event.
294 Various namespace management commands.
295 If namespace management is supported by device, allow list, create and delete
296 namespaces, list, attach and detach controllers to namespaces.
298 Reports the namespace id and controller device associated with the
304 Acquire or preempt namespace reservation, using specified parameters:
308 .Bl -tag -compact -width 6n
317 Current reservation key.
319 Preempt reservation key.
322 .Bl -tag -compact -width 6n
328 Write Exclusive - Registrants Only
330 Exclusive Access - Registrants Only
332 Write Exclusive - All Registrants
334 Exclusive Access - All Registrants
338 Register, unregister or replace reservation key, using specified parameters:
341 Current reservation key.
346 .Bl -tag -compact -width 6n
357 Change Persist Through Power Loss State:
358 .Bl -tag -compact -width 6n
360 No change to PTPL state
362 Set PTPL state to ‘0’.
363 Reservations are released and registrants are cleared on a power on.
365 Set PTPL state to ‘1’.
366 Reservations and registrants persist across a power loss.
370 Release or clear reservation, using specified parameters:
373 Current reservation key.
378 .Bl -tag -compact -width 6n
386 Print reservation status, using specified parameters:
389 Print reservation status in hex.
391 Use Extended Data Structure.
394 Format either specified namespace, or all namespaces of specified controller,
395 using specified parameters:
401 Protection Information,
403 Protection Information Location.
404 When formatting specific namespace, existing values are used as defaults.
405 When formatting all namespaces, all parameters should be specified.
406 Some controllers may not support formatting or erasing specific or all
410 enables User Data Erase during format.
413 enables Cryptographic Erase during format.
415 Sanitize NVM subsystem of specified controller,
416 using specified parameters:
418 .It Fl a Ar operation
419 Specify the sanitize operation to perform.
422 Perform an overwrite operation by writing a user supplied
423 data pattern to the device one or more times.
424 The pattern is given by the
427 The number of times is given by the
431 Perform a block erase operation.
432 All the device's blocks are set to a vendor defined
433 value, typically zero.
435 Perform a cryptographic erase operation.
436 The encryption keys are changed to prevent the decryption
439 Exits a previously failed sanitize operation.
440 A failed sanitize operation can only be exited if it was
441 run in the unrestricted completion mode, as provided by the
446 The number of passes when performing an
449 Valid values are between 1 and 16.
452 No Deallocate After Sanitize.
456 operation, the pattern is inverted between consecutive passes.
458 32 bits of pattern to use when performing an
461 The pattern is repeated as needed to fill each block.
463 Perform the sanitize in the unrestricted completion mode.
464 If the operation fails, it can later be exited with the
471 This will report status on a sanitize that is already running on the drive.
474 Start the specified device self-test:
477 Specify the device self-test command code.
479 .Bl -tag -compact -width 6n
481 Start a short device self-test operation
483 Start an extended device self-test operation
485 Start a vendor specific device self-test operation
487 Abort the device self-test operation
491 The various wdc command retrieve log data from the wdc/hgst drives.
494 flag specifies a path template to use to output the files.
495 Each file takes the path template (which defaults to nothing), appends
496 the drive's serial number and the type of dump it is followed
498 These logs must be sent to the vendor for analysis.
499 This tool only provides a way to extract them.
505 commands send NVMe commands to
506 either the administrative or the data part of the device.
507 These commands are expected to be compatible with nvme-cli.
508 Please see the NVMe Standard for details.
510 .It Fl o -opcode Ar opcode
512 .It Fl 2 -cdw2 Ar value
513 32-bit value for CDW2.
514 .It Fl 3 -cdw3 Ar value
515 32-bit value for CDW3.
516 .It Fl 4 -cdw10 Ar value
517 32-bit value for CDW10.
518 .It Fl 5 -cdw11 Ar value
519 32-bit value for CDW11.
520 .It Fl 6 -cdw12 Ar value
521 32-bit value for CDW12.
522 .It Fl 7 -cdw13 Ar value
523 32-bit value for CDW13.
524 .It Fl 8 -cdw14 Ar value
525 32-bit value for CDW14.
526 .It Fl 9 -cdw15 Ar value
527 32-bit value for CDW15.
529 Length of the data for I/O (bytes).
530 .It Fl m -metadata-len
531 Length of the metadata segment for command (bytes).
532 This is ignored and not implemented in
536 .It Fl n -namespace-id
537 Namespace ID for command (Ignored).
539 Value to prefill payload with.
541 Output in binary format (otherwise a hex dump is produced).
543 Do not actually execute the command, but perform sanity checks on it.
545 Command reads data from the device.
546 .It Fl s -show-command
547 Show all the command values on stdout.
549 Command writes data to the device.
551 Send arbitrary commands to the device.
552 Can be used to extract vendor specific logs.
553 Transfers to/from the device possible, but limited to
556 Commands either read data or write it, but not both.
557 Commands needing metadata are not supported by the
563 is required, you can use either the
565 device, or the disk device such as
574 is required, you can use either the
576 device, or the disk device such as
580 For commands that take an optional
582 you can use it to get information on other namespaces, or to query the
588 means query the drive itself.
590 .Dl nvmecontrol devlist
592 Display a list of NVMe controllers and namespaces along with their device nodes.
594 .Dl nvmecontrol identify nvme0
595 .Dl nvmecontrol identify -n 0 nvd0
597 Display a human-readable summary of the nvme0
598 .Dv IDENTIFY_CONTROLLER
600 In this example, nvd0 is connected to nvme0.
602 .Dl nvmecontrol identify -x -v nvme0ns1
603 .Dl nvmecontrol identify -x -v -n 1 nvme0
605 Display an hexadecimal dump of the nvme0
606 .Dv IDENTIFY_NAMESPACE
607 data for namespace 1.
609 .Dl nvmecontrol perftest -n 32 -o read -s 512 -t 30 nvme0ns1
611 Run a performance test on nvme0ns1 using 32 kernel threads for 30 seconds.
612 Each thread will issue a single 512 byte read command.
613 Results are printed to stdout when 30 seconds expires.
615 .Dl nvmecontrol reset nvme0
616 .Dl nvmecontrol reset nda4
618 Perform a controller-level reset of the nvme0 controller.
619 In this example, nda4 is wired to nvme0.
621 .Dl nvmecontrol logpage -p 1 nvme0
623 Display a human-readable summary of the nvme0 controller's Error Information Log.
624 Log pages defined by the NVMe specification include Error Information Log (ID=1),
625 SMART/Health Information Log (ID=2), and Firmware Slot Log (ID=3).
627 .Dl nvmecontrol logpage -p 0xc1 -v wdc nvme0
629 Display a human-readable summary of the nvme0's wdc-specific advanced
632 .Dl nvmecontrol logpage -p 1 -x nvme0
634 Display a hexadecimal dump of the nvme0 controller's Error Information Log.
636 .Dl nvmecontrol logpage -p 0xcb -b nvme0 > /tmp/page-cb.bin
638 Print the contents of vendor specific page 0xcb as binary data on
640 Redirect it to a temporary file.
642 .Dl nvmecontrol firmware -s 2 -f /tmp/nvme_firmware nvme0
644 Download the firmware image contained in "/tmp/nvme_firmware" to slot 2 of the
645 nvme0 controller, but do not activate the image.
647 .Dl nvmecontrol firmware -s 4 -a nvme0
649 Activate the firmware in slot 4 of the nvme0 controller on the next reset.
651 .Dl nvmecontrol firmware -s 7 -f /tmp/nvme_firmware -a nvme0
653 Download the firmware image contained in "/tmp/nvme_firmware" to slot 7 of the
654 nvme0 controller and activate it on the next reset.
656 .Dl nvmecontrol power -l nvme0
658 List all the current power modes.
660 .Dl nvmecontrol power -p 3 nvme0
662 Set the current power mode.
664 .Dl nvmecontrol power nvme0
666 Get the current power mode.
668 .Dl nvmecontrol identify -n 0 nda0
670 Identify the drive data associated with the
675 devices is used automatically.
677 .Dl nvmecontrol identify nda0
679 Get the namespace parameters associated with the
684 device is used automatically.
689 .Pa /usr/local/lib/nvmecontrol
690 are scanned for any .so files.
691 These files are loaded.
694 linker set are added to the top-level commands.
697 linker set are added to the logpage parsers.
700 .%T The NVM Express Base Specification
702 .%U https://nvmexpress.org/wp-content/uploads/NVM-Express-1_4-2019.06.10-Ratified.pdf
712 was developed by Intel and originally written by
713 .An Jim Harris Aq Mt jimharris@FreeBSD.org .
715 This man page was written by
716 .An Jim Harris Aq Mt jimharris@FreeBSD.org .