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 Manage the power modes of the NVMe controller.
477 List all supported power modes.
479 Set the power mode to
481 This must be a mode listed with the
482 .Dl nvmecontrol power -l
485 Set the workload hint for automatic power mode control.
486 .Bl -tag -compact -width 6n
488 No workload hint is provided.
490 Extended idle period workload.
491 The device is often idle for minutes at a time.
492 A burst of write commands comes in over a period of seconds.
493 Then the device returns to being idle.
495 Heavy sequential writes.
496 A huge number of sequential writes will be submitted, filling the submission queues.
498 All other values are reserved and have no standard meaning.
501 .Dq NVM Subsystem Workloads
502 section of the relevant NVM Express Base Standard for details.
505 Start the specified device self-test:
508 Specify the device self-test command code.
510 .Bl -tag -compact -width 6n
512 Start a short device self-test operation
514 Start an extended device self-test operation
516 Start a vendor specific device self-test operation
518 Abort the device self-test operation
522 The various wdc command retrieve log data from the wdc/hgst drives.
525 flag specifies a path template to use to output the files.
526 Each file takes the path template (which defaults to nothing), appends
527 the drive's serial number and the type of dump it is followed
529 These logs must be sent to the vendor for analysis.
530 This tool only provides a way to extract them.
536 commands send NVMe commands to
537 either the administrative or the data part of the device.
538 These commands are expected to be compatible with nvme-cli.
539 Please see the NVM Express Base Standard for details.
541 .It Fl o -opcode Ar opcode
543 .It Fl 2 -cdw2 Ar value
544 32-bit value for CDW2.
545 .It Fl 3 -cdw3 Ar value
546 32-bit value for CDW3.
547 .It Fl 4 -cdw10 Ar value
548 32-bit value for CDW10.
549 .It Fl 5 -cdw11 Ar value
550 32-bit value for CDW11.
551 .It Fl 6 -cdw12 Ar value
552 32-bit value for CDW12.
553 .It Fl 7 -cdw13 Ar value
554 32-bit value for CDW13.
555 .It Fl 8 -cdw14 Ar value
556 32-bit value for CDW14.
557 .It Fl 9 -cdw15 Ar value
558 32-bit value for CDW15.
560 Length of the data for I/O (bytes).
561 .It Fl m -metadata-len
562 Length of the metadata segment for command (bytes).
563 This is ignored and not implemented in
567 .It Fl n -namespace-id
568 Namespace ID for command (Ignored).
570 Value to prefill payload with.
572 Output in binary format (otherwise a hex dump is produced).
574 Do not actually execute the command, but perform sanity checks on it.
576 Command reads data from the device.
577 .It Fl s -show-command
578 Show all the command values on stdout.
580 Command writes data to the device.
582 Send arbitrary commands to the device.
583 Can be used to extract vendor specific logs.
584 Transfers to/from the device possible, but limited to
587 Commands either read data or write it, but not both.
588 Commands needing metadata are not supported by the
594 is required, you can use either the
596 device, or the disk device such as
605 is required, you can use either the
607 device, or the disk device such as
611 For commands that take an optional
613 you can use it to get information on other namespaces, or to query the
619 means query the drive itself.
621 .Dl nvmecontrol devlist
623 Display a list of NVMe controllers and namespaces along with their device nodes.
625 .Dl nvmecontrol identify nvme0
626 .Dl nvmecontrol identify -n 0 nvd0
628 Display a human-readable summary of the nvme0
629 .Dv IDENTIFY_CONTROLLER
631 In this example, nvd0 is connected to nvme0.
633 .Dl nvmecontrol identify -x -v nvme0ns1
634 .Dl nvmecontrol identify -x -v -n 1 nvme0
636 Display an hexadecimal dump of the nvme0
637 .Dv IDENTIFY_NAMESPACE
638 data for namespace 1.
640 .Dl nvmecontrol perftest -n 32 -o read -s 512 -t 30 nvme0ns1
642 Run a performance test on nvme0ns1 using 32 kernel threads for 30 seconds.
643 Each thread will issue a single 512 byte read command.
644 Results are printed to stdout when 30 seconds expires.
646 .Dl nvmecontrol reset nvme0
647 .Dl nvmecontrol reset nda4
649 Perform a controller-level reset of the nvme0 controller.
650 In this example, nda4 is wired to nvme0.
652 .Dl nvmecontrol logpage -p 1 nvme0
654 Display a human-readable summary of the nvme0 controller's Error Information Log.
655 Log pages defined by the NVMe specification include Error Information Log (ID=1),
656 SMART/Health Information Log (ID=2), and Firmware Slot Log (ID=3).
658 .Dl nvmecontrol logpage -p 0xc1 -v wdc nvme0
660 Display a human-readable summary of the nvme0's wdc-specific advanced
663 .Dl nvmecontrol logpage -p 1 -x nvme0
665 Display a hexadecimal dump of the nvme0 controller's Error Information Log.
667 .Dl nvmecontrol logpage -p 0xcb -b nvme0 > /tmp/page-cb.bin
669 Print the contents of vendor specific page 0xcb as binary data on
671 Redirect it to a temporary file.
673 .Dl nvmecontrol firmware -s 2 -f /tmp/nvme_firmware nvme0
675 Download the firmware image contained in "/tmp/nvme_firmware" to slot 2 of the
676 nvme0 controller, but do not activate the image.
678 .Dl nvmecontrol firmware -s 4 -a nvme0
680 Activate the firmware in slot 4 of the nvme0 controller on the next reset.
682 .Dl nvmecontrol firmware -s 7 -f /tmp/nvme_firmware -a nvme0
684 Download the firmware image contained in "/tmp/nvme_firmware" to slot 7 of the
685 nvme0 controller and activate it on the next reset.
687 .Dl nvmecontrol power -l nvme0
689 List all the current power modes.
691 .Dl nvmecontrol power -p 3 nvme0
693 Set the current power mode.
695 .Dl nvmecontrol power nvme0
697 Get the current power mode.
699 .Dl nvmecontrol identify -n 0 nda0
701 Identify the drive data associated with the
706 devices is used automatically.
708 .Dl nvmecontrol identify nda0
710 Get the namespace parameters associated with the
715 device is used automatically.
720 .Pa /usr/local/lib/nvmecontrol
721 are scanned for any .so files.
722 These files are loaded.
725 linker set are added to the top-level commands.
728 linker set are added to the logpage parsers.
731 .%T The NVM Express Base Specification
733 .%U https://nvmexpress.org/wp-content/uploads/NVM-Express-1_4-2019.06.10-Ratified.pdf
743 was developed by Intel and originally written by
744 .An Jim Harris Aq Mt jimharris@FreeBSD.org .
746 This man page was written by
747 .An Jim Harris Aq Mt jimharris@FreeBSD.org .