xref: /illumos-gate/usr/src/man/man8/nvmeadm.8 (revision 48d6e6ab8fae1f82ef9fbee512e42a4f9d4de74b)
1.\"
2.\" This file and its contents are supplied under the terms of the
3.\" Common Development and Distribution License ("CDDL"), version 1.0.
4.\" You may only use this file in accordance with the terms of version
5.\" 1.0 of the CDDL.
6.\"
7.\" A full copy of the text of the CDDL should have accompanied this
8.\" source.  A copy of the CDDL is also available via the Internet at
9.\" http://www.illumos.org/license/CDDL.
10.\"
11.\"
12.\" Copyright 2025 Oxide Computer Company
13.\" Copyright 2022 Tintri by DDN, Inc. All rights reserved.
14.\"
15.Dd October 4, 2025
16.Dt NVMEADM 8
17.Os
18.Sh NAME
19.Nm nvmeadm
20.Nd NVMe administration utility
21.Sh SYNOPSIS
22.Nm
23.Fl h
24.Op Ar command
25.Nm
26.Op Fl dv
27.Cm list
28.Oo
29.Fl c
30.Oc
31.Oo
32.Fl p o Ar field Ns [,...]
33.Oc
34.Op Ar ctl[/ns] Ns [,...]
35.Nm
36.Op Fl dv
37.Cm identify
38.Op Fl C | c | d | Oo Fl a Oc Fl n
39.Ar ctl[/ns] Ns [,...]
40.Nm
41.Op Fl dv
42.Cm identify-controller
43.Op Fl C | c | Oo Fl a Oc Fl n
44.Ar ctl Ns [,...]
45.Nm
46.Op Fl dv
47.Cm identify-namespace
48.Op Fl c | d
49.Ar ctl/ns Ns [,...]
50.Nm
51.Op Fl dv
52.Cm list-logpages
53.Op Fl a
54.Op Fl H
55.Op Fl o Ar field Ns [,...] Op Fl p
56.Op Fl s Ar scope Ns [,...]
57.Ar ctl[/ns] Ns [,...]
58.Op Ar logpage...
59.Nm
60.Op Fl dv
61.Cm get-logpage
62.Op Fl O Ar output-file
63.Ar ctl[/ns] Ns [,...]
64.Ar logpage
65.Nm
66.Op Fl dv
67.Cm list-features
68.Op Fl a
69.Op Fl H
70.Op Fl o Ar field Ns [,...] Op Fl p
71.Ar ctl[/ns] Ns [,...]
72.Op Ar feature...
73.Nm
74.Op Fl dv
75.Cm get-features
76.Ar ctl[/ns] Ns [,...]
77.Op Ar feature-list
78.Nm
79.Op Fl dv
80.Cm format
81.Ar ctl[/ns]
82.Op Ar lba-format
83.Nm
84.Op Fl dv
85.Cm secure-erase
86.Op Fl c
87.Ar ctl[/ns]
88.Nm
89.Op Fl dv
90.Cm create-namespace
91.Fl b Ar block-size | Fl f Ar flbas
92.Op Fl c Ar cap
93.Op Fl n Ar nmic
94.Op Fl t Ar type
95.Ar ctl
96.Ar size
97.Nm
98.Op Fl dv
99.Cm delete-namespace
100.Ar ctl/ns
101.Nm
102.Op Fl dv
103.Cm attach-namespace
104.Ar ctl/ns
105.Nm
106.Op Fl dv
107.Cm detach-namespace
108.Ar ctl/ns
109.Nm
110.Op Fl dv
111.Cm attach
112.Ar ctl[/ns]
113.Nm
114.Op Fl dv
115.Cm detach
116.Ar ctl[/ns]
117.Nm
118.Op Fl dv
119.Cm list-firmware
120.Ar ctl
121.Nm
122.Op Fl dv
123.Cm load-firmware
124.Ar ctl
125.Ar firmware-file
126.Op Ar offset
127.Nm
128.Op Fl dv
129.Cm commit-firmware
130.Ar ctl
131.Ar slot
132.Nm
133.Op Fl dv
134.Cm activate-firmware
135.Ar ctl
136.Ar slot
137.Nm
138.Op Fl dv
139.Cm wdc/e6dump
140.Fl o Ar output
141.Ar ctl
142.Nm
143.Op Fl dv
144.Cm wdc/resize
145.Fl s Ar size | Fl g
146.Ar ctl
147.Nm
148.Op Fl dv
149.Cm wdc/clear-assert
150.Ar ctl
151.Nm
152.Op Fl dv
153.Cm wdc/inject-assert
154.Ar ctl
155.Sh DESCRIPTION
156The
157.Nm
158utility can be used to enumerate the NVMe controllers and their
159namespaces, query hardware information from a NVMe controller or
160namespace, and to format or secure-erase a NVMe controller or
161namespace.
162.Pp
163The information returned by the hardware is printed by
164.Nm
165in a human-readable form were applicable.
166Generally all 0-based counts are normalized and values may be
167converted to human-readable units such as MB (megabytes), W (watts),
168or C (degrees Celsius).
169.Sh OPTIONS
170The following options are supported:
171.Bl -tag -width Ds
172.It Fl h
173Print a short help text for
174.Nm ,
175or for an optionally specified
176.Nm
177command.
178.It Fl d
179Enable debugging output.
180.It Fl v
181Enable verbose output.
182.El
183.Sh ARGUMENTS
184.Nm
185expects the following kinds of arguments:
186.Bl -tag -width "ctl[/ns]"
187.It Ar command
188Any command
189.Nm
190understands.
191See section
192.Sx COMMANDS .
193.It Ar ctl[/ns]
194Specifies a NVMe controller and optionally a namespace within that
195controller.
196The controller name consists of the driver name
197.Qq nvme
198followed by an instance number.
199A namespace is specified by appending a single
200.Qq /
201to the controller name, followed by either the namespace ID or the namespace
202EUI64 or NGUID as reported by the
203.Cm identify
204command.
205The namespace ID is a positive non-zero decimal number.
206For commands that don't change the device state multiple controllers
207and namespaces can be specified as a comma-separated list.
208.Pp
209The list of controllers and namespaces present in the system can be
210queried with the
211.Cm list
212command without any arguments.
213.It Ar logpage
214Specifies the log page name for the
215.Cm get-logpage
216command.
217.It Ar feature-list
218A comma-separated list of feature names for the
219.Cm get-features
220command.
221Feature names can be specified in upper or lower case.
222All features can be specified either by a short name listed below or by
223the full name that the specification uses.
224.It Ar lba-format
225A non-zero integer specifying the LBA format for the
226.Cm format
227command.
228The list of supported LBA formats on a namespace can be retrieved
229with the
230.Nm
231.Cm identify
232command.
233.It Ar firmware-file
234Specifies the name of a firmware file to be loaded into the controller
235using the
236.Cm load-firmware
237command.
238.It Ar offset
239Specifies the byte offset at which to load
240.It Ar output-file
241Specifies a file system location to write raw binary data out to.
242.Ar firmware-file
243within the controller's upload buffer.
244Vendors may require multiple images to be loaded at different offsets
245before a firmware set is committed to a
246.Ar slot .
247.It Ar scope
248Specifies the scope of a given type of thing to look at, such as a log
249page.
250Scopes can either be specified by their full name or a shortened form.
251For log pages, the following scopes are supported:
252.Bl -tag -width Ds
253.It Sy controller
254Indicates that the log is scoped to the controller.
255The short form is
256.Dq ctrl .
257.It Sy nvm
258Indicates that the log is scoped to the NVM subsystem.
259There is no short form.
260.It Sy namespace
261Indicates that the log is scoped to the namespace.
262The short form is
263.Dq ns .
264.El
265.Pp
266For more information on the differences between these, please see the
267NVMe specification.
268.It Ar size
269Indicates a size in bytes.
270The size may be specified in base 10 or in hexadecimal.
271An optional binary prefix may follow the string.
272For example, a size of 10G would indicate 10 GiB
273.Pq Gibibytes
274or 10,737,418,240 bytes.
275Valid binary prefixes include:
276.Bl -tag -width Ds
277.It Sy b, B
278The size is in bytes.
279It is not adjusted.
280.It Sy k, K
281The size is in KiB.
282It will be multiplied by 2^10.
283.It Sy m, M
284The size is in MiB.
285It will be multiplied by 2^20.
286.It Sy g, G
287The size is in GiB.
288It will be multiplied by 2^30.
289.It Sy t, T
290The size is in TiB.
291It will be multiplied by 2^40.
292.It Sy p, P
293The size is in PiB.
294It will be multiplied by 2^50.
295.El
296.Pp
297This is used by the
298.Cm create-namespace
299command.
300.It Ar slot
301Specifies the firmware slot into which a firmware set is committed
302using the
303.Cm commit-firmware
304command, and subsequently activated with the
305.Cm activate-firmware
306command.
307Slots and their contents can be printed using the
308.Nm
309.Cm list-firmware
310command.
311.El
312.Sh COMMANDS
313.Bl -tag -width ""
314.It Xo
315.Nm
316.Cm list
317.Oo
318.Fl c
319.Oc
320.Oo
321.Fl p o Ar field Ns [,...]
322.Oc
323.Op Ar ctl[/ns] Ns [,...]
324.Xc
325Lists the NVMe controllers and by default also their active
326namespaces, printing a 1-line summary of their basic properties for each.
327If a list of controllers and/or namespaces is given then the listing
328is limited to those devices.
329If no controllers or namespaces are given as arguments, then all controllers
330in the system and their respective active namespaces are listed.
331When using the
332.Fl v
333option
334to
335.Nm ,
336all possible namespaces of the controllers will be listed.
337.Pp
338The
339.Nm
340.Cm list
341command supports the following options:
342.Bl -tag -width Fl
343.It Fl c
344List controllers only and not their namespaces.
345.It Fl p
346Produce parsable output rather than human-readable output.
347This option requires that output fields be selected with the
348.Fl o
349option.
350.It Fl o Ar field Ns [,...]
351A comma-separated list of one or more output fields to be used.
352Fields are listed below and the name is case insensitive.
353.El
354.Pp
355The following fields can be specified when using the parsable form:
356.Bl -tag -width UNALLOCATED
357.It Sy MODEL
358The model number of the device, generally containing information about
359both the manufacturer and the product.
360.It Sy SERIAL
361The NVMe controller's serial number.
362.It Sy FWREV
363The controller's firmware revision.
364.It Sy VERSION
365The version of the NVMe specification the controller supports.
366.It Sy INSTANCE
367The name of the device node and instance of it.
368.It Sy CTRLPATH
369The
370.Pa /devices
371path of the controller.
372.El
373.Pp
374In addition, the following fields can be specified when listing namespaces, not
375using the
376.Fl c
377option:
378.Bl -tag -width UNALLOCATED
379.It Sy CAPACITY
380The amount of logical bytes that the namespace may actually have allocated at
381any time.
382This may be different than size due to the use of thin provisioning or due to
383administrative action.
384.It Sy SIZE
385The logical size in bytes of the namespace.
386.It Sy USED
387The number of bytes used in the namespace.
388.It Sy NAMESPACE
389The numerical value of the namespace which can be used as part of other
390.Nm
391operations.
392.It Sy DISK
393The name of the disk device that corresponds to the namespace, if any.
394.It Sy NS-STATE
395The current state of the namespace.
396This is one of the following:
397.Bl -tag -width Ds
398.It Dq unallocated
399the namesapce is currently unallocated.
400There is no non-volatile memory assosciated with it.
401.It Dq allocated
402The namespace has non-volatile memory allocated to it, but it is not currently
403attached to the controller.
404.It Dq active
405The namespace is currently attached to the local controller; however, the kernel
406cannot actively attach a block device to the driver.
407.It Dq active-usable
408The namespace is currently attached to the local controller and the kernel can
409use the namespace with
410.Xr blkdev 4D .
411.It Dq blkdev
412The namespace is exposing a block device and is actively attached to
413.Xr blkdev 4D .
414.El
415.El
416.Pp
417When using the
418.Fl c
419option to list controllers, the following additional fields are supported:
420.Bl -tag -width UNALLOCATED
421.It Sy CAPACITY
422The total raw capacity of the NVMe controller in bytes.
423.It Sy UNALLOCATED
424The number of bytes not currently assigned to any namespace in the controller.
425.El
426.It Xo
427.Nm
428.Cm identify-controller
429.Op Fl C | c | Oo Fl a Oc Fl n
430.Ar ctl Ns [,...]
431.Xc
432Print detailed information about the specified controllers.
433For an explanation of the data printed by this command refer to the description
434of the
435.Qq IDENTIFY
436admin command in the NVMe specification.
437.Pp
438By default, a relevant subset of the
439.Qq IDENTIFY CONTROLLER
440data structure is printed.
441The full data structure is only printed when verbose output is requested.
442.Pp
443The following options can be used to print other
444.Qq IDENTIFY
445information:
446.Bl -tag -width Fl
447.It Fl C
448Print the Common Namespace Identification of the controller.
449.It Fl a
450Alter the output of the
451.Fl n
452option to print the list allocated namespace identifiers.
453Can only be specified together with the
454.Fl n
455option.
456.It Fl c
457Print the list of all unique controller identifiers in the NVMe subsystem the
458specified controller belongs to.
459.It Fl n
460Print the list of active namespace identifiers of the controller.
461.El
462.It Xo
463.Nm
464.Cm identify-namespace
465.Op Fl c | d
466.Ar ctl/ns Ns [,...]
467.Xc
468Print detailed information about the specified namespace.
469For an explanation of the data printed by this command refer to the description
470of the
471.Qq IDENTIFY
472admin command in the NVMe specification.
473.Pp
474By default, a relevant subset of the
475.Qq IDENTIFY NAMESPACE
476data structure is printed.
477The full data structure is only printed when verbose output is requested.
478.Pp
479The following options can be used to print other
480.Qq IDENTIFY
481information:
482.Bl -tag -width Fl
483.It Fl c
484Print the list of all unique controller identifiers in the NVMe subsystem the
485specified namespace belongs to and which are currently attached to this
486namespace.
487.It Fl d
488Print the list of namespace identification descriptors of the namespace.
489.El
490.It Xo
491.Nm
492.Cm identify
493.Op Fl C | c | d | Oo Fl a Oc Fl n
494.Ar ctl[/ns] Ns [,...]
495.Xc
496Short-hand for the
497.Cm identify-controller
498and
499.Cm identify-namespace
500commands, prints the same information about the specified controllers and/or
501namespaces, depending on whether a controller or a namespace was specified.
502.Pp
503For a description of the various optional flags refer to the above description
504of the
505.Cm identify-controller
506and
507.Cm identify-namespace
508commands.
509.It Xo
510.Nm
511.Op Fl dv
512.Cm list-logpages
513.Op Fl a
514.Op Fl H
515.Op Fl o Ar field Ns [,...] Op Fl p
516.Op Fl s Ar scope Ns [,...]
517.Ar ctl[/ns] Ns [,...]
518.Op Ar logpage...
519.Xc
520Prints the list of log pages and information about them specific to the
521given controller or namespace.
522This is intended as a discovery mechanism and will print information
523about mandatory, optional, and vendor-specific log pages as well as all
524the information that is useful for retrieving information about them.
525.Pp
526The
527.Nm
528.Cm list-logpages
529command supports the following options:
530.Bl -tag -width Fl
531.It Fl a
532Print all log pages.
533By default, only logs that are implemented are printed.
534.It Fl H
535Omit the output header columns.
536.It Fl o Ar field Ns [,...]
537A comma-separated list of one or more output fields to be used.
538Fields are listed below and the name is case insensitive.
539.It Fl p
540Produce parsable output rather than human-readable output.
541This option requires that output fields be selected with the
542.Fl o
543option.
544.It Fl s Ar scope Ns [,...]
545Print log pages that match the specified scope.
546If no
547.Ar scope
548arguments are specified, then the scope will be set to
549.Dq ctrl,nvm
550when the device is a controller and
551.Dq ns
552when the device refers to a namespace.
553.El
554.Pp
555The following fields are supported:
556.Bl -tag -width MINSIZE
557.It Sy DEVICE
558Prints the name of the controller or namespace.
559.It Sy NAME
560Prints the name of the log page.
561This is the name that can be used to get the log page with the
562.Cm get-logpage
563command.
564This is a shortened form from the NVMe or vendor-specific documentation.
565.It Sy DESC
566This is a description of the log page and generally corresponds to
567information from the specification the log page is drawn from.
568.It Sy SCOPE
569This is the set of scopes that the log page is applicable to.
570As described earlier in the manual, valid scopes include
571.Dq ctrl ,
572.Dq nvm ,
573and
574.Dq ns .
575This indicates whether a controller
576.Po
577.Dq ctrl
578and
579.Dq nvm
580.Pc
581or a namespace
582.Po
583.Dq ns
584.Pc
585will work for this log page when running the
586.Cm get-logpage
587command to get the log.
588.It Sy FIELDS
589This indicates the command fields that are accepted when retrieving the
590log page from the controller.
591The fields include:
592.Bl -tag -width lsp
593.It Sy lsp
594Indicates that a log specific parameter is accepted for this page.
595.It Sy lsi
596Indicates that a log specific identifier is accepted for this page.
597.It Sy rae
598Indicates that one can control whether or not an asynchronous event is
599retained when retrieving the log page.
600By default, asynchronous events are cleared when certain log pages are
601fetched such as the health log page.
602.El
603For more information on these fields, please see the NVMe specification.
604.It Sy CSI
605Indicates the log page's command set interface.
606.It Sy LID
607Indicates the log page's numeric ID.
608This when combined with the log page's CSI is the unique identifier that
609identifies the log page to the controller.
610.It Sy IMPL
611Indicates whether or not the system believes that the log page is
612implemented.
613.It Sy SIZE
614Indicates the size of the log page.
615Not all log pages have a fixed size and in such cases this field will
616not contain a value.
617.It Sy MINSIZE
618When a log page is known to have a variable size, this indicates the
619minimum amount of the log page to read to determine the full size of the
620log page.
621.It Sy SOURCES
622This is a comma separated list of values that indicates where
623information about this log page and its support came from primarily.
624These include the following:
625.Bl -tag -width identify-controller
626.It Dq spec
627This comes from the NVMe specification.
628Generally this refers to mandatory log pages that are not dependent on
629any information in the identify controller data structure.
630.It Dq identify-controller
631Information about this log page comes from the identify controller data
632structure.
633Many log pages are described by the standard but are optional and their
634support is indicated through that.
635.It Dq internal-db
636This indicates that information about this log page comes from our
637internal databases in libnvme.
638Most vendor-specific logs are described in datasheets whose information
639is encoded into the library and system and there is not always a way to
640discover that it is supported or not.
641.It Dq command
642This indicates that information about this log page came from another
643command that was issued to the controller which indicates what was
644implemented and present.
645.El
646.It Sy KIND
647This indicates the kind of log page that this is.
648Valid options are:
649.Bl -tag -width vendor-specific
650.It Dq mandatory
651Indicates that the NVMe specification considers this mandatory for all
652controllers of a given version.
653.It Dq optional
654Indicates that the NVMe specification considers this log page optional.
655Some items may be mandatory if a device implements an optional feature
656like namespace management, but they will still be considered optional as
657the underlying feature is.
658.It Dq vendor-specific
659Indicates that this log is a vendor-specific log page.
660These log pages are not part of the NVMe standard and are generally
661described in their own device's datasheets or a separate standard such
662as the
663.%T OCP Datacenter NVMe SSD Specification .
664.El
665.El
666.Pp
667The
668.Cm list-logpages
669command supports a series of operands which can be used to filter the
670list of log pages that information is printed out about.
671Each
672.Ar logpage
673operand is the name of a log page.
674Only matching log pages will be printed and if no log pages match a
675given operand argument or not log pages are printed at all
676.Pq which can happen due to a log being unsupported
677then the command will generate an error.
678.It Xo
679.Nm
680.Cm get-logpage
681.Op Fl O Ar output-file
682.Ar ctl[/ns] Ns [,...]
683.Ar logpage
684.Xc
685Print the specified log page of the specified controllers and/or namespaces.
686If
687.Fl O
688is specified, rather than print the contents of the log, the raw binary payload
689of the log will be written to
690.Ar output-file .
691Most log pages are only available on a per-controller basis.
692Known log pages are:
693.Bl -tag -width "firmware"
694.It suplog
695Supported Log Pages.
696Lists information about log pages that the device supports.
697Available starting in NVMe 2.0 devices.
698.It error
699Error Information
700.It health
701SMART/Health Information.
702A controller may support this log page on a per-namespace basis.
703.It firmware
704Firmware Slot Information
705.It changens
706Changed Namespaces.
707.It cmdeff
708Commands Supported and Effects.
709An optional log page added in NVMe 1.2 that indicates what commands
710the controller itself actually supports.
711.It pev
712Persistent Event Log.
713An optional log page added in NVMe 1.4 that contains a series of events
714that have occurred on the device.
715.It telemetry
716Host-initiated telemetry log.
717Contains vendor-specific diagnostic information about the controller.
718This log page requires that the
719.Fl O
720option be specified.
721.El
722.Pp
723The following vendor-specific log pages are supported.
724Not all devices from a vendor support every log page.
725Use the
726.Cm list-logpages
727command to determine which are supported for a given device and whether
728they operate on a controller or namespace.
729.Bl -tag -width "solidigm/outlier"
730.It kioxia/extsmart
731Kioxia Extended SMART.
732.It micron/smart
733Micron Vendor Unique SMART.
734.It micron/extsmart
735Micron Extended SMART.
736.It ocp/smart
737Open Compute Datacenter NVMe SSD specification SMART / Health information.
738.It ocp/errrec
739Open Compute Datacenter NVMe SSD specification error recovery log.
740.It ocp/fwact
741Open Compute Datacenter NVMe SSD specification firmware activation log.
742.It ocp/latency
743Open Compute Datacenter NVMe SSD specification latency monitor.
744.It ocp/devcap
745Open Compute Datacenter NVMe SSD specification device capabilities.
746.It ocp/unsup
747Open Compute Datacenter NVMe SSD specification unsupported requirements.
748.It solidigm/rlat
749Solidigm/Intel read command latency statistics.
750.It solidigm/wlat
751Solidigm/Intel write command latency statistics.
752.It solidigm/temp
753Solidigm/Intel temperature statistics.
754.It solidigm/smart
755Solidigm/Intel vendor unique SMART log.
756.It solidigm/ioqueue
757Solidigm/Intel I/O queue metrics.
758.It solidigm/name
759Solidigm/Intel drive marketing name.
760.It solidigm/power
761Solidigm/Intel power usage.
762.It solidigm/gc
763Solidigm/Intel garbage collection.
764.It solidigm/outlier
765Solidigm/Intel latency outlier.
766.It wdc/eol
767Western Digital end-of-life.
768.It wdc/devmgmt
769Western Digital device manageability.
770.It wdc/pciesi
771Western Digital PCIe signal integrity.
772.It wdc/power
773Western Digital power samples.
774.It wdc/temp
775Western Digital temperature samples.
776.It wdc/fwact
777Western Digital firmware activation history.
778.It wdc/ccds
779Western Digital CCDS build information.
780.It wdc/cusmart
781Western Digital customer unique SMART data.
782.El
783.Pp
784For an explanation of the contents of the log pages refer to the
785description of the
786.Qq GET LOGPAGE
787admin command in the NVMe specification.
788.It Xo
789.Nm
790.Cm list-features
791.Op Fl a
792.Op Fl H
793.Op Fl o Ar field Ns [,...] Op Fl p
794.Ar ctl[/ns] Ns [,...]
795.Op Ar feature Ns [,...]
796.Xc
797Prints the list of features and information about them specific to the
798given controller or namespace.
799This is intended as a discovery mechanism and will print information
800about known mandatory, optional, and vendor-specific features as well as
801the information that is useful for retrieving information about them.
802.Pp
803The
804.Nm
805.Cm list-features
806command supports the following options:
807.Bl -tag -width Fl
808.It Fl a
809Print all features, regardless of whether or not the controller is known
810to implement them.
811By default unimplemented features are not printed, but implemented and
812unknown ones are.
813.It Fl H
814Omit the output header columns.
815.It Fl o Ar field Ns [,...]
816A comma-separated list of one or more output fields to be used.
817Fields are listed below and the name is case insensitive.
818.It Fl p
819Produce parsable output rather than human-readable output.
820This option requires that output fields be selected with the
821.Fl o
822option.
823.El
824.Pp
825The following fields are supported:
826.Bl -tag -width DATALEN
827.It Sy DEVICE
828Prints the name of the controller or namespace.
829.It Sy SHORT
830This is a shortened name for a feature which can be used to identify it.
831These short names are unique to illumos and not part of the NVMe
832specification.
833.It Sy SPEC
834This is the specification's name for a given feature.
835.It Sy FID
836This is the numeric ID that can be used to uniquely identify a feature.
837.It Sy SCOPE
838This is a comma separated list of values that identifies what scopes
839this feature covers.
840The supported scopes are
841.Dq controller ,
842which indicates that it impacts the entire controller and
843.Dq namespace ,
844which indicates that it impacts just a single namespace.
845.It Sy KIND
846This indicates the kind of feature that this is.
847Valid options are:
848.Bl -tag -width vendor-specific
849.It Dq mandatory
850Indicates that the NVMe specification considers this mandatory for all
851controllers of a given version.
852.It Dq optional
853Indicates that the NVMe specification considers this feature optional.
854Some items may be mandatory if a device implements an optional feature
855like namespace management, but they will still be considered optional as
856the underlying feature is.
857.It Dq vendor-specific
858Indicates that this log is a vendor-specific feature.
859These features are not part of the NVMe standard and are generally
860described in their own device's datasheets or a separate standard such
861as the
862.%T OCP Datacenter NVMe SSD Specification .
863.El
864.It Sy CSI
865The command set interface that the feature is specific to.
866Most features are not specific to a CSI.
867.It Sy FLAGS
868The flags are a series of comma separated strings which describe
869properties of the feature.
870The following flags are currently supported:
871.Bl -tag -width "get-bcastns"
872.It Dq get-bcastns
873Indicates that the broadcast namespace is supported when getting this
874feature.
875.It Dq set-bcastns
876Indicates that the broadcast namespace is supported when setting this
877feature.
878Using the broadcast namespace indicates that all namespace are impacted.
879.El
880.It Sy GET-IN
881A series of comma separated values indicating what is required to get
882this feature.
883The following values are supported:
884.Bl -tag -width cdw11
885.It cdw11
886Indicates that the feature requires an argument in the cdw11 field of
887the command.
888This is generally a selector of some kind.
889For example, for the temperature threshold feature, it selects which of
890several sensors may be referred to.
891.It data
892Indicates that a data buffer is required when getting this feature.
893Its size is indicated by the DATALEN field.
894.It nsid
895Indicates that a namespace ID is required when getting this feature.
896.El
897.It Sy SET-IN
898A series of comma separated values indicating what is required to get
899this feature.
900The following values are supported:
901.Bl -tag -width cdw11
902.It cdw11
903Indicates that the feature uses information in cdw11 to set the feature.
904.It cdw12
905Indicates that the feature uses information in cdw12 to set the feature.
906.It cdw13
907Indicates that the feature uses information in cdw13 to set the feature.
908.It cdw14
909Indicates that the feature uses information in cdw14 to set the feature.
910.It cdw15
911Indicates that the feature uses information in cdw15 to set the feature.
912.It data
913Indicates that the feature takes a data payload to set the feature.
914Its size is indicated by the DATALEN field.
915.It nsid
916Indicates that the feature requires a valid namespace identifier.
917.El
918.It Sy GET-OUT
919A series of comma separated values indicating what the controller will
920return information about this feature in.
921The following values are supported:
922.Bl -tag -width cdw0
923.It cdw0
924Indicates that the controller will give information about the feature in
925the command output 32-bit value.
926.It data
927Indicates that the controller will output information about the feature
928into the output buffer.
929.El
930.It Sy SET-OUT
931A series of comma separated values indicating what the controller will
932update following the successful completion of setting the feature.
933These values are the same as with the GET-OUT field.
934.It Sy DATALEN
935Indicates the length of data for the feature.
936.It Sy IMPL
937Indicates whether or not the feature is known to be implemented or not.
938The following values are possible:
939.Bl -tag -width unknown
940.It Dq unknown
941Indicates that it is unknown as to whether or not the feature is
942implemented.
943Some features are optional and there is no way to determine this short
944of issuing an attempt to get the feature itself.
945.It Dq yes
946Indicates that we know the feature is implemented by the controller.
947.It Dq no
948Indicates that we know the feature is not implemented by the controller.
949.El
950.El
951.Pp
952The
953.Cm list-features
954command supports a series of operands which can be used to filter the
955list of features that information is printed out about.
956Each
957.Ar feature
958operand is either the short name or the specification's name for a given
959feature.
960In addition, the numeric feature ID can also be used as a filter.
961If no features match a given operand or no features are printed at all
962then the command will generate an error.
963.It Xo
964.Nm
965.Cm get-features
966.Ar ctl[/ns] Ns [,...]
967.Op Ar feature-list
968.Xc
969Prints information about the specified features, or all features if
970none are given, of the specified controllers and/or namespaces.
971Feature names are case-insensitive, and they can be shortened as long
972as they remain unique.
973Some features also have alternative short names to which the same
974rules apply.
975The following features are supported:
976.Pp
977.TS
978tab(:);
979l l l.
980FULL NAME:SHORT NAME:CONTROLLER/NAMESPACE
981Arbitration:arb:controller
982Power Management:pm:controller
983LBA Range Type:range:namespace
984Temperature Threshold:temp:controller
985Error Recovery:errec:controller
986Volatile Write Cache:cache:controller
987Number of Queues:queues:controller
988Interrupt Coalescing:coalescing:controller
989Interrupt Vector Configuration:vector:controller
990Write Atomicity:atomicity:controller
991Asynchronous Event Configuration:event:controller
992Autonomous Power State Transition:apst:controller
993Software Progress Marker:progress:controller
994Host Behavior Support:hostsup:controller
995.TE
996.Pp
997For an explanation of the individual features refer to the description
998of the
999.Qq SET FEATURES
1000admin command in the NVMe specification.
1001.It Xo
1002.Nm
1003.Cm format
1004.Ar ctl[/ns]
1005.Op Ar lba-format
1006.Xc
1007Formats the specified namespace or all namespaces of the specified
1008controller.
1009This command implies a
1010.Nm
1011.Cm detach
1012and subsequent
1013.Nm
1014.Cm attach
1015of the specified namespace(s), which will cause a changed LBA format
1016to be detected.
1017If no LBA format is specified the LBA format currently used by the
1018namespace will be used.
1019When formatting all namespaces without specifying a LBA format the LBA
1020format of namespace 1 will be used.
1021A list of LBA formats supported by a namespace can be queried with the
1022.Nm
1023.Cm identify
1024command.
1025.Pp
1026Note that not all devices support formatting individual or all
1027namespaces, or support formatting at all.
1028.Pp
1029LBA formats using a non-zero metadata size are not supported by
1030.Nm
1031or
1032.Xr nvme 4D .
1033.Pp
1034The list of supported LBA formats on a namespace can be retrieved
1035with the
1036.Nm
1037.Cm identify
1038command.
1039.It Xo
1040.Nm
1041.Cm secure-erase
1042.Op Fl c
1043.Ar ctl[/ns]
1044.Xc
1045Erases the specified namespace or all namespaces of the controller.
1046The flag
1047.Fl c
1048will cause a cryptographic erase instead of a normal erase.
1049This command implies a
1050.Nm
1051.Cm detach
1052and
1053.Nm
1054.Cm attach
1055of the specified namespace(s).
1056.Pp
1057Note that not all devices support erasing individual or all
1058namespaces, or support erasing at all.
1059.It Xo
1060.Nm
1061.Cm create-namespace
1062.Fl b Ar block-size | Fl f Ar flbas
1063.Op Fl c Ar cap
1064.Op Fl n Ar nmic
1065.Op Fl t Ar type
1066.Ar ctl
1067.Ar size
1068.Xc
1069Creates a new namespace of size
1070.Ar size
1071in the controller
1072.Ar ctl .
1073NVM will be allocated for the namespace and the namespace will transition to the
1074allocated state.
1075A created namespace must subsequently be attached to the local controller,
1076.Cm attach-namespace ,
1077and to the block device framework
1078.Pq Xr blkdev 4D ,
1079.Cm attach ,
1080to provide I/O capabilities.
1081.Pp
1082By default, a newly created namespace:
1083.Bl -bullet
1084.It
1085Uses the NVM command set interface
1086.Pq CSI .
1087This can be changed with the
1088.Fl t
1089option.
1090.It
1091Has the namespace's capacity set to the namespace's size.
1092To thinly provision a namespace, you may use the
1093.Fl c
1094option to specify a value less than the
1095.Ar size
1096argument.
1097Note, the controller may not support thin provisioning.
1098.It
1099Configures the namespace so it may only be used with one controller at a time.
1100This can be changed with the
1101.Fl n
1102option.
1103.El
1104.Pp
1105When creating a namespace, one must specify what formatted LBA index to use.
1106This index may be specified directly with the
1107.Fl f
1108option or instead the target block size may be specified with the
1109.Fl b
1110option.
1111If
1112.Fl b
1113is specified, then the command will search for a namespace with that block size,
1114with no metdata section, and with the highest relative performance and use that.
1115Available LBA format options may be listed by printing the Common Namespace
1116Identification values through the
1117.Nm identify-controller
1118option with the
1119.Fl C
1120option.
1121.Pp
1122The
1123.Cm create-namespace
1124command supports the following options:
1125.Bl -tag -width Fl
1126.It Fl b Ar block-size
1127Specifies the target data block size of the namespace to be created.
1128This option is exclusive with the
1129.Fl f
1130option.
1131.Ar block-size
1132allow a binary prefix to be specified as per the description of the
1133.Ar size
1134operand.
1135.It Fl c Ar cap
1136Specifies the namespace's capacity in bytes, which may use a binary prefix like,
1137such as
1138100G,
1139as per the description of the
1140.Ar size
1141operand.
1142If this option is left out, the namespace's capacity will be set to its size,
1143fully provisioning the namespace.
1144Not all controllers support thinly provisioning a namespace.
1145.It Fl f Ar flbas
1146Specifies the index of the formatted LBA size.
1147.It Fl n Ar nmic
1148Specifies the multipath I/O and namespace sharing capabilities.
1149The current valid options for this are:
1150.Bl -tag -width Ds
1151.It Sy none
1152Indicates that only a single controller may attach to the namespace at any given
1153time.
1154.It Sy shared
1155Indicates that two or more controllers may attach to the namespace at the same
1156time.
1157.El
1158.It Fl t Ar type
1159Specifies the command set interface for newly created namespace.
1160The default is
1161.Dq nvm .
1162The system understands the following command set interfaces; however, not all
1163controllers support all CSIs and currently the
1164.Xr nvme 4D
1165driver only supports the
1166NVM CSI.
1167.Bl -tag -width Ds
1168.It nvm
1169The non-volatile memory CSI.
1170This is the default CSI of all NVMe devices and provides a regular block
1171interface.
1172.It kv
1173Key Value command set interface.
1174This interface does not provide standard a logical block abstraction and instead
1175allows for someone to read and write an arbitrary-sized object with a 128-bit
1176key.
1177.It zns
1178Zoned namespace command set interface.
1179This interface provides a block-like abstraction where blocks are broken into
1180different sized zones, which contain ranges of logical blocks.
1181Writing to a zone offers different semantics from a common block device.
1182.El
1183.El
1184.It Xo
1185.Nm
1186.Cm delete-namespace
1187.Ar ctl/ns
1188.Xc
1189This deletes the specified namespace, freeing any capacity back to the
1190underlying NVM subsystem.
1191The namespace identifier will be considered inactive in
1192.Ar ctl .
1193.Pp
1194To delete a namespace, the namespace must already be detached from all
1195controllers through the
1196.Cm detach-namespace
1197command.
1198.Pp
1199Upon deleting a namespace, all information that was contained in the namespace
1200.Sy will be lost .
1201.It Xo
1202.Nm
1203.Cm attach-namespace
1204.Ar ctl/ns
1205.Xc
1206Attach the specified namespace to the controller
1207.Ar ctl .
1208This will transition the namespace to the active state, allowing additional
1209information about the namespace to be queried.
1210This also allows the namespace to provide a block device interface through
1211.Xr blkdev 4D ,
1212which can be enabled by subsequently using the
1213.Cm attach
1214command.
1215.It Xo
1216.Nm
1217.Cm detach-namespace
1218.Ar ctl/ns
1219.Xc
1220Detach the specified namespace from the controller
1221.Ar ctl .
1222The namespace must already be detached from
1223.Xr blkdev 4D
1224through the
1225.Cm detach command.
1226When detached, the namespace transitions from active to allocated in the
1227controller.
1228Data in the namespace remains valid; however, not all commands will function
1229against the namespace and I/O may not be performed to it.
1230.It Xo
1231.Nm
1232.Cm attach
1233.Ar ctl[/ns]
1234.Xc
1235Attaches the
1236.Xr blkdev 4D
1237instance to the specified namespace or all namespaces of the controller.
1238This will make I/O accesses to the namespace(s) possible again after a
1239previous
1240.Nm
1241.Cm detach
1242command.
1243.Pp
1244It is not an error to attach a namespace that is already attached, any such
1245request will be silently ignored.
1246.It Xo
1247.Nm
1248.Cm detach
1249.Ar ctl[/ns]
1250.Xc
1251Temporarily detaches the
1252.Xr blkdev 4D
1253instance from the specified namespace or all namespaces of the controller.
1254This will prevent I/O access to the affected namespace(s).
1255Detach will only succeed if the affected namespace(s) are not
1256currently opened.
1257The detached state will not persist across reboots or reloads of the
1258.Xr nvme 4D
1259driver.
1260.Pp
1261It is not an error to detach a namespace that is already detached, any such
1262request will be silently ignored.
1263.It Xo
1264.Nm
1265.Cm list-firmware
1266.Ar ctl
1267.Xc
1268List currently active firmware slot, the next active firmware slot, and the
1269current contents of all firmware slots of an NVMe controller.
1270This is a synonym for the
1271.Nm
1272.Cm get-logpage
1273.Ar ctl
1274.Cm firmware
1275command.
1276.It Xo
1277.Nm
1278.Cm load-firmware
1279.Ar ctl
1280.Ar firmware-file
1281.Op Ar offset
1282.Xc
1283Loads
1284.Ar firmware-file
1285into the controller's upload memory at
1286.Ar offset ,
1287the default is 0. A vendor may require multiple files to be loaded
1288at different offsets before the firmware is committed to a
1289.Ar slot .
1290.It Xo
1291.Nm
1292.Cm commit-firmware
1293.Ar ctl
1294.Ar slot
1295.Xc
1296Commits firmware previously loaded by the
1297.Cm load-firmware
1298command to
1299.Ar slot .
1300.It Xo
1301.Nm
1302.Cm activate-firmware
1303.Ar ctl
1304.Ar slot
1305.Xc
1306Activates the firmware in slot
1307.Ar slot .
1308The firmware image in
1309.Ar slot
1310is activated at the next NVM controller reset.
1311.It Xo
1312.Nm
1313.Cm wdc/e6dump
1314.Fl o Ar output
1315.Ar ctl
1316.Xc
1317This vendor-specific command performs a diagnostic dump of device data
1318to the file specified by
1319.Ar output .
1320The device remains in full service while this is occurring.
1321.It Xo
1322.Nm
1323.Cm wdc/resize
1324.Fl s Ar size | Fl g
1325.Ar ctl
1326.Xc
1327This vendor-specific command will get the current over provisioning size
1328or set it.
1329This command operates using power of 10 bytes, that is in terms of
1330gigabytes and not gibibytes.
1331The sizes that are used here will be different from those that the
1332operating system will report for the drive.
1333.Pp
1334The following options are supported:
1335.Bl -tag -width Fl
1336.It Fl g
1337Returns the current size of the device in gigabytes
1338.Pq powers of 10 .
1339.It Fl s Ar size
1340Sets the size of the device to
1341.Ar size
1342which is in gigabytes
1343.Pq powers of 10 .
1344This can be used to adjust the over provisioning ratio on the device.
1345The valid points are device-specific.
1346Please consult WDC datasheets for more information.
1347.Pp
1348When performing a resize
1349.Em all data and namespace will be erased !
1350All namespaces must be detached prior to issuing this.
1351.El
1352.It Xo
1353.Nm
1354.Op Fl dv
1355.Cm wdc/clear-assert
1356.Ar ctl
1357.Xc
1358This clears an internal assertion record from a WDC device.
1359Prior to running this any such internal assertion should be saved by using the
1360.Cm wdc/e6dump
1361command.
1362This command should only be used if instructed to do so as part of a
1363troubleshooting process.
1364.It Xo
1365.Nm
1366.Op Fl dv
1367.Cm wdc/inject-assert
1368.Ar ctl
1369.Xc
1370This injects a device assertion into a WDC NVMe device.
1371The behavior of doing so is device specific; however, all I/O will be
1372interrupted and the device may be retired.
1373Unless explicitly instructed as part of debugging a device or as part of
1374internal development, this command should not be used.
1375.El
1376.Sh EXIT STATUS
1377.Ex -std
1378.Sh EXAMPLES
1379.Bl -tag -width ""
1380.It Sy Example 1: List all NVMe controllers and namespaces
1381.Bd -literal
1382# nvmeadm list
1383nvme1: model: INTEL SSDPEDMD800G4, serial: CVFT4134001R800CGN, FW rev: 8DV10049, NVMe v1.0
1384  nvme1/1 (c1t1d0): Size = 763097 MB, Capacity = 763097 MB, Used = 763097 MB
1385nvme4: model: SAMSUNG MZVPV128HDGM-00000, serial: S1XVNYAGA00640, FW rev: BXW7300Q, NVMe v1.1
1386  nvme4/1 (c2t2d0): Size = 122104 MB, Capacity = 122104 MB, Used = 5127 MB
1387.Ed
1388.It Sy Example 2: Identify a namespace
1389.Bd -literal
1390# nvmeadm identify nvme4/1
1391nvme4/1: Identify Namespace
1392  Namespace Capabilities and Features
1393    Namespace Size:                         122104MB
1394    Namespace Capacity:                     122104MB
1395    Namespace Utilization:                  5127MB
1396    Namespace Features
1397      Thin Provisioning:                    unsupported
1398    Number of LBA Formats:                  1
1399    Formatted LBA Size
1400      LBA Format:                           1
1401      Extended Data LBA:                    no
1402    Metadata Capabilities
1403      Extended Data LBA:                    unsupported
1404      Separate Metadata:                    unsupported
1405    End-to-End Data Protection Capabilities
1406      Protection Information Type 1:        unsupported
1407      Protection Information Type 2:        unsupported
1408      Protection Information Type 3:        unsupported
1409      Protection Information first:         unsupported
1410      Protection Information last:          unsupported
1411    End-to-End Data Protection Settings
1412      Protection Information:               disabled
1413      Protection Information in Metadata:   last 8 bytes
1414    LBA Format 1
1415      Metadata Size:                        0 bytes
1416      LBA Data Size:                        512 bytes
1417      Relative Performance:                 Best
1418.Ed
1419.It Sy Example 3: Get SMART/Health information (verbose)
1420.Bd -literal
1421# nvmeadm -v get-logpage nvme4/1 health
1422nvme4/1: SMART/Health Information
1423  Critical Warnings
1424    Available Space:                        OK
1425    Temperature:                            OK
1426    Device Reliability:                     OK
1427    Media:                                  OK
1428    Volatile Memory Backup:                 OK
1429  Temperature:                              37C
1430  Available Spare Capacity:                 100%
1431  Available Spare Threshold:                10%
1432  Device Life Used:                         0%
1433  Data Read:                                0GB
1434  Data Written:                             64GB
1435  Read Commands:                            52907
1436  Write Commands:                           567874
1437  Controller Busy:                          1min
1438  Power Cycles:                             6
1439  Power On:                                 141h
1440  Unsafe Shutdowns:                         1
1441  Uncorrectable Media Errors:               0
1442  Errors Logged:                            1
1443.Ed
1444.It Sy Example 4: Get Asynchronous Event Configuration information
1445.Bd -literal
1446# nvmeadm get-features nvme0,nvme4 event,power
1447nvme0: Get Features
1448  Asynchronous Event Configuration
1449    Available Space below threshold:        disabled
1450    Temperature above threshold:            disabled
1451    Device Reliability compromised:         disabled
1452    Media read-only:                        disabled
1453  Power Management
1454    Power State:                            0
1455nvme4: Get Features
1456  Asynchronous Event Configuration
1457    Available Space below threshold:        disabled
1458    Temperature above threshold:            disabled
1459    Device Reliability compromised:         disabled
1460    Media read-only:                        disabled
1461    Volatile Memory Backup failed:          disabled
1462  Power Management
1463    Power State:                            0
1464.Ed
1465.It Sy Example 5: Load and activate firmware
1466.Bd -literal
1467# nvmeadm list-firmware nvme3
1468nvme3: Firmware Slot Information
1469  Active Firmware Slot:                     4
1470  Next Firmware Slot:                       4
1471  Firmware Revision for Slot 1:             KNGND110 (read-only)
1472  Firmware Revision for Slot 2:             KNGND110
1473  Firmware Revision for Slot 3:             KNGND110
1474  Firmware Revision for Slot 4:             KNGND112
1475  Firmware Revision for Slot 5:             KNGND110
1476
1477# nvmeadm -v load-firmware nvme3 KNGND113.bin
14781740544 bytes downloaded.
1479
1480# nvmeadm -v commit-firmware nvme3 5
1481Firmware committed to slot 5.
1482
1483# nvmeadm -v activate-firmware nvme3 5
1484Slot 5 activated: NVM subsystem reset required - power cycle your system.
1485
1486# nvmeadm list-firmware nvme3
1487nvme3: Firmware Slot Information
1488  Active Firmware Slot:                     4
1489  Next Firmware Slot:                       5
1490  Firmware Revision for Slot 1:             KNGND110 (read-only)
1491  Firmware Revision for Slot 2:             KNGND110
1492  Firmware Revision for Slot 3:             KNGND110
1493  Firmware Revision for Slot 4:             KNGND112
1494  Firmware Revision for Slot 5:             KNGND113
1495.Ed
1496.It Sy Example 6: Listing Log Pages
1497.Bd -literal
1498# nvmeadm list-logpages nvme8
1499DEVICE  NAME          SCOPE         FIELDS    DESC
1500nvme8   error         controller    rae       Error information
1501nvme8   health        controller,   rae       SMART / Health information
1502                      namespace
1503nvme8   firmware      nvm           --        Firmware Slot Information
1504nvme8   changens      controller    rae       changed namespaces
1505nvme8   wdc/eol       nvm           --        EOL
1506nvme8   wdc/devmgmt   controller,   --        Device Manageability
1507                      namespace
1508nvme8   wdc/pciesi    controller    lsp       PCIe Signal Integrity
1509nvme8   wdc/power     controller    --        Power Samples
1510nvme8   wdc/temp      controller    --        Temperature Samples
1511nvme8   wdc/fwact     controller    --        Firmware Activation
1512nvme8   wdc/ccds      controller    --        CCDS Build Information
1513# nvmeadm list-logpages -p -o name,impl nvme8 firmware
1514firmware:yes
1515.Ed
1516.El
1517.Sh INTERFACE STABILITY
1518The command line interface of
1519.Nm
1520is
1521.Sy Evolving .
1522The output of
1523.Nm
1524is
1525.Sy Not-an-Interface
1526and may change any time.
1527.Sh SEE ALSO
1528.Xr nvme 4D
1529.Pp
1530.Lk http://www.nvmexpress.org/specifications/ "NVMe specifications"
1531