xref: /illumos-gate/usr/src/man/man8/nvmeadm.8 (revision b70bf3ee79d81df3ccc36e553e0ff11049a2b51a)
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 2024 Oxide Computer Company
13.\" Copyright 2022 Tintri by DDN, Inc. All rights reserved.
14.\"
15.Dd January 12, 2024
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.Ar ctl[/ns] Ns [,...]
63.Ar logpage
64.Nm
65.Op Fl dv
66.Cm list-features
67.Op Fl a
68.Op Fl H
69.Op Fl o Ar field Ns [,...] Op Fl p
70.Ar ctl[/ns] Ns [,...]
71.Op Ar feature...
72.Nm
73.Op Fl dv
74.Cm get-features
75.Ar ctl[/ns] Ns [,...]
76.Op Ar feature-list
77.Nm
78.Op Fl dv
79.Cm format
80.Ar ctl[/ns]
81.Op Ar lba-format
82.Nm
83.Op Fl dv
84.Cm secure-erase
85.Op Fl c
86.Ar ctl[/ns]
87.Nm
88.Op Fl dv
89.Cm detach
90.Ar ctl[/ns]
91.Nm
92.Op Fl dv
93.Cm attach
94.Ar ctl[/ns]
95.Nm
96.Op Fl dv
97.Cm list-firmware
98.Ar ctl
99.Nm
100.Op Fl dv
101.Cm load-firmware
102.Ar ctl
103.Ar firmware-file
104.Op Ar offset
105.Nm
106.Op Fl dv
107.Cm commit-firmware
108.Ar ctl
109.Ar slot
110.Nm
111.Op Fl dv
112.Cm activate-firmware
113.Ar ctl
114.Ar slot
115.Nm
116.Op Fl dv
117.Cm wdc/e6dump
118.Fl o Ar output
119.Ar ctl
120.Nm
121.Op Fl dv
122.Cm wdc/resize
123.Fl s Ar size | Fl g
124.Ar ctl
125.Sh DESCRIPTION
126The
127.Nm
128utility can be used to enumerate the NVMe controllers and their
129namespaces, query hardware information from a NVMe controller or
130namespace, and to format or secure-erase a NVMe controller or
131namespace.
132.Pp
133The information returned by the hardware is printed by
134.Nm
135in a human-readable form were applicable.
136Generally all 0-based counts are normalized and values may be
137converted to human-readable units such as MB (megabytes), W (watts),
138or C (degrees Celsius).
139.Sh OPTIONS
140The following options are supported:
141.Bl -tag -width Ds
142.It Fl h
143Print a short help text for
144.Nm ,
145or for an optionally specified
146.Nm
147command.
148.It Fl d
149Enable debugging output.
150.It Fl v
151Enable verbose output.
152.El
153.Sh ARGUMENTS
154.Nm
155expects the following kinds of arguments:
156.Bl -tag -width "ctl[/ns]"
157.It Ar command
158Any command
159.Nm
160understands.
161See section
162.Sx COMMANDS .
163.It Ar ctl[/ns]
164Specifies a NVMe controller and optionally a namespace within that
165controller.
166The controller name consists of the driver name
167.Qq nvme
168followed by an instance number.
169A namespace is specified by appending a single
170.Qq /
171to the controller name, followed by either the namespace ID or the namespace
172EUI64 or NGUID as reported by the
173.Cm identify
174command.
175The namespace ID is a positive non-zero decimal number.
176For commands that don't change the device state multiple controllers
177and namespaces can be specified as a comma-separated list.
178.Pp
179The list of controllers and namespaces present in the system can be
180queried with the
181.Cm list
182command without any arguments.
183.It Ar logpage
184Specifies the log page name for the
185.Cm get-logpage
186command.
187.It Ar feature-list
188A comma-separated list of feature names for the
189.Cm get-features
190command.
191Feature names can be specified in upper or lower case.
192All features can be specified either by a short name listed below or by
193the full name that the specification uses.
194.It Ar lba-format
195A non-zero integer specifying the LBA format for the
196.Cm format
197command.
198The list of supported LBA formats on a namespace can be retrieved
199with the
200.Nm
201.Cm identify
202command.
203.It Ar firmware-file
204Specifies the name of a firmware file to be loaded into the controller
205using the
206.Cm load-firmware
207command.
208.It Ar offset
209Specifies the byte offset at which to load
210.Ar firmware-file
211within the controller's upload buffer.
212Vendors may require multiple images to be loaded at different offsets
213before a firmware set is committed to a
214.Ar slot .
215.It Ar scope
216Specifies the scope of a given type of thing to look at, such as a log
217page.
218Scopes can either be specified by their full name or a shortened form.
219For log pages, the following scopes are supported:
220.Bl -tag -width Ds
221.It Sy controller
222Indicates that the log is scoped to the controller.
223The short form is
224.Dq ctrl .
225.It Sy nvm
226Indicates that the log is scoped to the NVM subsystem.
227There is no short form.
228.It Sy namespace
229Indicates that the log is scoped to the namespace.
230The short form is
231.Dq ns .
232.El
233.Pp
234For more information on the differences between these, please see the
235NVMe specification.
236.It Ar slot
237Specifies the firmware slot into which a firmware set is committed
238using the
239.Cm commit-firmware
240command, and subsequently activated with the
241.Cm activate-firmware
242command.
243Slots and their contents can be printed using the
244.Nm
245.Cm list-firmware
246command.
247.El
248.Sh COMMANDS
249.Bl -tag -width ""
250.It Xo
251.Nm
252.Cm list
253.Oo
254.Fl c
255.Oc
256.Oo
257.Fl p o Ar field Ns [,...]
258.Oc
259.Op Ar ctl[/ns] Ns [,...]
260.Xc
261Lists the NVMe controllers and by default also their active
262namespaces, printing a 1-line summary of their basic properties for each.
263If a list of controllers and/or namespaces is given then the listing
264is limited to those devices.
265If no controllers or namespaces are given as arguments, then all controllers
266in the system and their respective active namespaces are listed.
267When using the
268.Fl v
269option
270to
271.Nm ,
272all possible namespaces of the controllers will be listed.
273.Pp
274The
275.Nm
276.Cm list
277command supports the following options:
278.Bl -tag -width Fl
279.It Fl c
280List controllers only and not their namespaces.
281.It Fl p
282Produce parsable output rather than human-readable output.
283This option requires that output fields be selected with the
284.Fl o
285option.
286.It Fl o Ar field Ns [,...]
287A comma-separated list of one or more output fields to be used.
288Fields are listed below and the name is case insensitive.
289.El
290.Pp
291The following fields can be specified when using the parsable form:
292.Bl -tag -width UNALLOCATED
293.It Sy MODEL
294The model number of the device, generally containing information about
295both the manufacturer and the product.
296.It Sy SERIAL
297The NVMe controller's serial number.
298.It Sy FWREV
299The controller's firmware revision.
300.It Sy VERSION
301The version of the NVMe specification the controller supports.
302.It Sy INSTANCE
303The name of the device node and instance of it.
304.El
305.Pp
306In addition, the following fields can be specified when listing namespaces, not
307using the
308.Fl c
309option:
310.Bl -tag -width UNALLOCATED
311.It Sy CAPACITY
312The amount of logical bytes that the namespace may actually have allocated at
313any time.
314This may be different than size due to the use of thin provisioning or due to
315administrative action.
316.It Sy SIZE
317The logical size in bytes of the namespace.
318.It Sy USED
319The number of bytes used in the namespace.
320.It Sy NAMESPACE
321The numerical value of the namespace which can be used as part of other
322.Nm
323operations.
324.It Sy DISK
325The name of the disk device that corresponds to the namespace, if any.
326.El
327.Pp
328When using the
329.Fl c
330option to list controllers, the following additional fields are supported:
331.Bl -tag -width UNALLOCATED
332.It Sy CAPACITY
333The total raw capacity of the NVMe controller in bytes.
334.It Sy UNALLOCATED
335The number of bytes not currently assigned to any namespace in the controller.
336.El
337.It Xo
338.Nm
339.Cm identify-controller
340.Op Fl C | c | Oo Fl a Oc Fl n
341.Ar ctl Ns [,...]
342.Xc
343Print detailed information about the specified controllers.
344For an explanation of the data printed by this command refer to the description
345of the
346.Qq IDENTIFY
347admin command in the NVMe specification.
348.Pp
349By default, a relevant subset of the
350.Qq IDENTIFY CONTROLLER
351data structure is printed.
352The full data structure is only printed when verbose output is requested.
353.Pp
354The following options can be used to print other
355.Qq IDENTIFY
356information:
357.Bl -tag -width Fl
358.It Fl C
359Print the Common Namespace Identification of the controller.
360.It Fl a
361Alter the output of the
362.Fl n
363option to print the list allocated namespace identifiers.
364Can only be specified together with the
365.Fl n
366option.
367.It Fl c
368Print the list of all unique controller identifiers in the NVMe subsystem the
369specified controller belongs to.
370.It Fl n
371Print the list of active namespace identifiers of the controller.
372.El
373.It Xo
374.Nm
375.Cm identify-namespace
376.Op Fl c | d
377.Ar ctl/ns Ns [,...]
378.Xc
379Print detailed information about the specified namespace.
380For an explanation of the data printed by this command refer to the description
381of the
382.Qq IDENTIFY
383admin command in the NVMe specification.
384.Pp
385By default, a relevant subset of the
386.Qq IDENTIFY NAMESPACE
387data structure is printed.
388The full data structure is only printed when verbose output is requested.
389.Pp
390The following options can be used to print other
391.Qq IDENTIFY
392information:
393.Bl -tag -width Fl
394.It Fl c
395Print the list of all unique controller identifiers in the NVMe subsystem the
396specified namespace belongs to and which are currently attached to this
397namespace.
398.It Fl d
399Print the list of namespace identification descriptors of the namespace.
400.El
401.It Xo
402.Nm
403.Cm identify
404.Op Fl C | c | d | Oo Fl a Oc Fl n
405.Ar ctl[/ns] Ns [,...]
406.Xc
407Short-hand for the
408.Cm identify-controller
409and
410.Cm identify-namespace
411commands, prints the same information about the specified controllers and/or
412namespaces, depending on whether a controller or a namespace was specified.
413.Pp
414For a description of the various optional flags refer to the above description
415of the
416.Cm identify-controller
417and
418.Cm identify-namespace
419commands.
420.It Xo
421.Nm
422.Op Fl dv
423.Cm list-logpages
424.Op Fl a
425.Op Fl H
426.Op Fl o Ar field Ns [,...] Op Fl p
427.Op Fl s Ar scope Ns [,...]
428.Ar ctl[/ns] Ns [,...]
429.Op Ar logpage...
430.Xc
431Prints the list of log pages and information about them specific to the
432given controller or namespace.
433This is intended as a discovery mechanism and will print information
434about mandatory, optional, and vendor-specific log pages as well as all
435the information that is useful for retrieving information about them.
436.Pp
437The
438.Nm
439.Cm list-logpages
440command supports the following options:
441.Bl -tag -width Fl
442.It Fl a
443Print all log pages.
444By default, only logs that are implemented are printed.
445.It Fl H
446Omit the output header columns.
447.It Fl o Ar field Ns [,...]
448A comma-separated list of one or more output fields to be used.
449Fields are listed below and the name is case insensitive.
450.It Fl p
451Produce parsable output rather than human-readable output.
452This option requires that output fields be selected with the
453.Fl o
454option.
455.It Fl s Ar scope Ns [,...]
456Print log pages that match the specified scope.
457If no
458.Ar scope
459arguments are specified, then the scope will be set to
460.Dq ctrl,nvm
461when the device is a controller and
462.Dq ns
463when the device refers to a namespace.
464.El
465.Pp
466The following fields are supported:
467.Bl -tag -width MINSIZE
468.It Sy DEVICE
469Prints the name of the controller or namespace.
470.It Sy NAME
471Prints the name of the log page.
472This is the name that can be used to get the log page with the
473.Cm get-logpage
474command.
475This is a shortened form from the NVMe or vendor-specific documentation.
476.It Sy DESC
477This is a description of the log page and generally corresponds to
478information from the specification the log page is drawn from.
479.It Sy SCOPE
480This is the set of scopes that the log page is applicable to.
481As described earlier in the manual, valid scopes include
482.Dq ctrl ,
483.Dq nvm ,
484and
485.Dq ns .
486This indicates whether a controller
487.Po
488.Dq ctrl
489and
490.Dq nvm
491.Pc
492or a namespace
493.Po
494.Dq ns
495.Pc
496will work for this log page when running the
497.Cm get-logpage
498command to get the log.
499.It Sy FIELDS
500This indicates the command fields that are accepted when retrieving the
501log page from the controller.
502The fields include:
503.Bl -tag -width lsp
504.It Sy lsp
505Indicates that a log specific parameter is accepted for this page.
506.It Sy lsi
507Indicates that a log specific identifier is accepted for this page.
508.It Sy rae
509Indicates that one can control whether or not an asynchronous event is
510retained when retrieving the log page.
511By default, asynchronous events are cleared when certain log pages are
512fetched such as the health log page.
513.El
514For more information on these fields, please see the NVMe specification.
515.It Sy CSI
516Indicates the log page's command set interface.
517.It Sy LID
518Indicates the log page's numeric ID.
519This when combined with the log page's CSI is the unique identifier that
520identifies the log page to the controller.
521.It Sy IMPL
522Indicates whether or not the system believes that the log page is
523implemented.
524.It Sy SIZE
525Indicates the size of the log page.
526Not all log pages have a fixed size and in such cases this field will
527not contain a value.
528.It Sy MINSIZE
529When a log page is known to have a variable size, this indicates the
530minimum amount of the log page to read to determine the full size of the
531log page.
532.It Sy SOURCES
533This is a comma separated list of values that indicates where
534information about this log page and its support came from primarily.
535These include the following:
536.Bl -tag -width identify-controller
537.It Dq spec
538This comes from the NVMe specification.
539Generally this refers to mandatory log pages that are not dependent on
540any information in the identify controller data structure.
541.It Dq identify-controller
542Information about this log page comes from the identify controller data
543structure.
544Many log pages are described by the standard but are optional and their
545support is indicated through that.
546.It Dq internal-db
547This indicates that information about this log page comes from our
548internal databases in libnvme.
549Most vendor-specific logs are described in datasheets whose information
550is encoded into the library and system and there is not always a way to
551discover that it is supported or not.
552.It Dq command
553This indicates that information about this log page came from another
554command that was issued to the controller which indicates what was
555implemented and present.
556.El
557.It Sy KIND
558This indicates the kind of log page that this is.
559Valid options are:
560.Bl -tag -width vendor-specific
561.It Dq mandatory
562Indicates that the NVMe specification considers this mandatory for all
563controllers of a given version.
564.It Dq optional
565Indicates that the NVMe specification considers this log page optional.
566Some items may be mandatory if a device implements an optional feature
567like namespace management, but they will still be considered optional as
568the underlying feature is.
569.It Dq vendor-specific
570Indicates that this log is a vendor-specific log page.
571These log pages are not part of the NVMe standard and are generally
572described in their own device's datasheets or a separate standard such
573as the
574.%T OCP Datacenter NVMe SSD Specification .
575.El
576.El
577.Pp
578The
579.Cm list-logpages
580command supports a series of operands which can be used to filter the
581list of log pages that information is printed out about.
582Each
583.Ar logpage
584operand is the name of a log page.
585Only matching log pages will be printed and if no log pages match a
586given operand argument or not log pages are printed at all
587.Pq which can happen due to a log being unsupported
588then the command will generate an error.
589.It Xo
590.Nm
591.Cm get-logpage
592.Ar ctl[/ns] Ns [,...]
593.Ar logpage
594.Xc
595Print the specified log page of the specified controllers and/or namespaces.
596Most log pages are only available on a per-controller basis.
597Known log pages are:
598.Bl -tag -width "firmware"
599.It error
600Error Information
601.It health
602SMART/Health Information.
603A controller may support this log page on a per-namespace basis.
604.It firmware
605Firmware Slot Information
606.It changens
607Changed Namespaces.
608.El
609.Pp
610The following vendor-specific log pages are supported.
611Not all devices from a vendor support every log page.
612Use the
613.Cm list-logpages
614command to determine which are supported for a given device and whether
615they operate on a controller or namespace.
616.Bl -tag -width "wdc/devmgm"
617.It wdc/eol
618Western Digital end-of-life.
619.It wdc/devmgmt
620Western Digital device manageability.
621.It wdc/pciesi
622Western Digital PCIe signal integrity.
623.It wdc/power
624Western Digital power samples.
625.It wdc/temp
626Western Digital temperature samples.
627.It wdc/fwact
628Western Digital firmware activation history.
629.It wdc/ccds
630Western Digital CCDS build information.
631.It wdc/cusmart
632Western Digital customer unique SMART data.
633.El
634.Pp
635For an explanation of the contents of the log pages refer to the
636description of the
637.Qq GET LOGPAGE
638admin command in the NVMe specification.
639.It Xo
640.Nm
641.Cm list-features
642.Op Fl a
643.Op Fl H
644.Op Fl o Ar field Ns [,...] Op Fl p
645.Ar ctl[/ns] Ns [,...]
646.Op Ar feature Ns [,...]
647.Xc
648Prints the list of features and information about them specific to the
649given controller or namespace.
650This is intended as a discovery mechanism and will print information
651about known mandatory, optional, and vendor-specific features as well as
652the information that is useful for retrieving information about them.
653.Pp
654The
655.Nm
656.Cm list-features
657command supports the following options:
658.Bl -tag -width Fl
659.It Fl a
660Print all features, regardless of whether or not the controller is known
661to implement them.
662By default unimplemented features are not printed, but implemented and
663unknown ones are.
664.It Fl H
665Omit the output header columns.
666.It Fl o Ar field Ns [,...]
667A comma-separated list of one or more output fields to be used.
668Fields are listed below and the name is case insensitive.
669.It Fl p
670Produce parsable output rather than human-readable output.
671This option requires that output fields be selected with the
672.Fl o
673option.
674.El
675.Pp
676The following fields are supported:
677.Bl -tag -width DATALEN
678.It Sy DEVICE
679Prints the name of the controller or namespace.
680.It Sy SHORT
681This is a shortened name for a feature which can be used to identify it.
682These short names are unique to illumos and not part of the NVMe
683specification.
684.It Sy SPEC
685This is the specification's name for a given feature.
686.It Sy FID
687This is the numeric ID that can be used to uniquely identify a feature.
688.It Sy SCOPE
689This is a comma separated list of values that identifies what scopes
690this feature covers.
691The supported scopes are
692.Dq controller ,
693which indicates that it impacts the entire controller and
694.Dq namespace ,
695which indicates that it impacts just a single namespace.
696.It Sy KIND
697This indicates the kind of feature that this is.
698Valid options are:
699.Bl -tag -width vendor-specific
700.It Dq mandatory
701Indicates that the NVMe specification considers this mandatory for all
702controllers of a given version.
703.It Dq optional
704Indicates that the NVMe specification considers this feature optional.
705Some items may be mandatory if a device implements an optional feature
706like namespace management, but they will still be considered optional as
707the underlying feature is.
708.It Dq vendor-specific
709Indicates that this log is a vendor-specific feature.
710These features are not part of the NVMe standard and are generally
711described in their own device's datasheets or a separate standard such
712as the
713.%T OCP Datacenter NVMe SSD Specification .
714.El
715.It Sy CSI
716The command set interface that the feature is specific to.
717Most features are not specific to a CSI.
718.It Sy FLAGS
719The flags are a series of comma separated strings which describe
720properties of the feature.
721The following flags are currently supported:
722.Bl -tag -width "get-bcastns"
723.It Dq get-bcastns
724Indicates that the broadcast namespace is supported when getting this
725feature.
726.It Dq set-bcastns
727Indicates that the broadcast namespace is supported when setting this
728feature.
729Using the broadcast namespace indicates that all namespace are impacted.
730.El
731.It Sy GET-IN
732A series of comma separated values indicating what is required to get
733this feature.
734The following values are supported:
735.Bl -tag -width cdw11
736.It cdw11
737Indicates that the feature requires an argument in the cdw11 field of
738the command.
739This is generally a selector of some kind.
740For example, for the temperature threshold feature, it selects which of
741several sensors may be referred to.
742.It data
743Indicates that a data buffer is required when getting this feature.
744Its size is indicated by the DATALEN field.
745.It nsid
746Indicates that a namespace ID is required when getting this feature.
747.El
748.It Sy SET-IN
749A series of comma separated values indicating what is required to get
750this feature.
751The following values are supported:
752.Bl -tag -width cdw11
753.It cdw11
754Indicates that the feature uses information in cdw11 to set the feature.
755.It cdw12
756Indicates that the feature uses information in cdw12 to set the feature.
757.It cdw13
758Indicates that the feature uses information in cdw13 to set the feature.
759.It cdw14
760Indicates that the feature uses information in cdw14 to set the feature.
761.It cdw15
762Indicates that the feature uses information in cdw15 to set the feature.
763.It data
764Indicates that the feature takes a data payload to set the feature.
765Its size is indicated by the DATALEN field.
766.It nsid
767Indicates that the feature requires a valid namespace identifier.
768.El
769.It Sy GET-OUT
770A series of comma separated values indicating what the controller will
771return information about this feature in.
772The following values are supported:
773.Bl -tag -width cdw0
774.It cdw0
775Indicates that the controller will give information about the feature in
776the command output 32-bit value.
777.It data
778Indicates that the controller will output information about the feature
779into the output buffer.
780.El
781.It Sy SET-OUT
782A series of comma separated values indicating what the controller will
783update following the successful completion of setting the feature.
784These values are the same as with the GET-OUT field.
785.It Sy DATALEN
786Indicates the length of data for the feature.
787.It Sy IMPL
788Indicates whether or not the feature is known to be implemented or not.
789The following values are possible:
790.Bl -tag -width unknown
791.It Dq unknown
792Indicates that it is unknown as to whether or not the feature is
793implemented.
794Some features are optional and there is no way to determine this short
795of issuing an attempt to get the feature itself.
796.It Dq yes
797Indicates that we know the feature is implemented by the controller.
798.It Dq no
799Indicates that we know the feature is not implemented by the controller.
800.El
801.El
802.Pp
803The
804.Cm list-features
805command supports a series of operands which can be used to filter the
806list of features that information is printed out about.
807Each
808.Ar feature
809operand is either the short name or the specification's name for a given
810feature.
811In addition, the numeric feature ID can also be used as a filter.
812If no features match a given operand or no features are printed at all
813then the command will generate an error.
814.It Xo
815.Nm
816.Cm get-features
817.Ar ctl[/ns] Ns [,...]
818.Op Ar feature-list
819.Xc
820Prints information about the specified features, or all features if
821none are given, of the specified controllers and/or namespaces.
822Feature names are case-insensitive, and they can be shortened as long
823as they remain unique.
824Some features also have alternative short names to which the same
825rules apply.
826The following features are supported:
827.Pp
828.TS
829tab(:);
830l l l.
831FULL NAME:SHORT NAME:CONTROLLER/NAMESPACE
832Arbitration:arb:controller
833Power Management:pm:controller
834LBA Range Type:range:namespace
835Temperature Threshold:temp:controller
836Error Recovery:errec:controller
837Volatile Write Cache:cache:controller
838Number of Queues:queues:controller
839Interrupt Coalescing:coalescing:controller
840Interrupt Vector Configuration:vector:controller
841Write Atomicity:atomicity:controller
842Asynchronous Event Configuration:event:controller
843Autonomous Power State Transition:apst:controller
844Software Progress Marker:progress:controller
845.TE
846.Pp
847For an explanation of the individual features refer to the description
848of the
849.Qq SET FEATURES
850admin command in the NVMe specification.
851.It Xo
852.Nm
853.Cm format
854.Ar ctl[/ns]
855.Op Ar lba-format
856.Xc
857Formats the specified namespace or all namespaces of the specified
858controller.
859This command implies a
860.Nm
861.Cm detach
862and subsequent
863.Nm
864.Cm attach
865of the specified namespace(s), which will cause a changed LBA format
866to be detected.
867If no LBA format is specified the LBA format currently used by the
868namespace will be used.
869When formatting all namespaces without specifying a LBA format the LBA
870format of namespace 1 will be used.
871A list of LBA formats supported by a namespace can be queried with the
872.Nm
873.Cm identify
874command.
875.Pp
876Note that not all devices support formatting individual or all
877namespaces, or support formatting at all.
878.Pp
879LBA formats using a non-zero metadata size are not supported by
880.Nm
881or
882.Xr nvme 4D .
883.Pp
884The list of supported LBA formats on a namespace can be retrieved
885with the
886.Nm
887.Cm identify
888command.
889.It Xo
890.Nm
891.Cm secure-erase
892.Op Fl c
893.Ar ctl[/ns]
894.Xc
895Erases the specified namespace or all namespaces of the controller.
896The flag
897.Fl c
898will cause a cryptographic erase instead of a normal erase.
899This command implies a
900.Nm
901.Cm detach
902and
903.Nm
904.Cm attach
905of the specified namespace(s).
906.Pp
907Note that not all devices support erasing individual or all
908namespaces, or support erasing at all.
909.It Xo
910.Nm
911.Cm detach
912.Ar ctl[/ns]
913.Xc
914Temporarily detaches the
915.Xr blkdev 4D
916instance from the specified namespace or all namespaces of the controller.
917This will prevent I/O access to the affected namespace(s).
918Detach will only succeed if the affected namespace(s) are not
919currently opened.
920The detached state will not persist across reboots or reloads of the
921.Xr nvme 4D
922driver.
923.Pp
924It is not an error to detach a namespace that is already detached, any such
925request will be silently ignored.
926.It Xo
927.Nm
928.Cm attach
929.Ar ctl[/ns]
930.Xc
931Attaches the
932.Xr blkdev 4D
933instance to the specified namespace or all namespaces of the controller.
934This will make I/O accesses to the namespace(s) possible again after a
935previous
936.Nm
937.Cm detach
938command.
939.Pp
940It is not an error to attach a namespace that is already attached, any such
941request will be silently ignored.
942.It Xo
943.Nm
944.Cm list-firmware
945.Ar ctl
946.Xc
947List currently active firmware slot, the next active firmware slot, and the
948current contents of all firmware slots of an NVMe controller.
949This is a synonym for the
950.Nm
951.Cm get-logpage
952.Ar ctl
953.Cm firmware
954command.
955.It Xo
956.Nm
957.Cm load-firmware
958.Ar ctl
959.Ar firmware-file
960.Op Ar offset
961.Xc
962Loads
963.Ar firmware-file
964into the controller's upload memory at
965.Ar offset ,
966the default is 0. A vendor may require multiple files to be loaded
967at different offsets before the firmware is committed to a
968.Ar slot .
969.It Xo
970.Nm
971.Cm commit-firmware
972.Ar ctl
973.Ar slot
974.Xc
975Commits firmware previously loaded by the
976.Cm load-firmware
977command to
978.Ar slot .
979.It Xo
980.Nm
981.Cm activate-firmware
982.Ar ctl
983.Ar slot
984.Xc
985Activates the firmware in slot
986.Ar slot .
987The firmware image in
988.Ar slot
989is activated at the next NVM controller reset.
990.It Xo
991.Nm
992.Cm wdc/e6dump
993.Fl o Ar output
994.Ar ctl
995.Xc
996This vendor-specific command performs a diagnostic dump of device data
997to the file specified by
998.Ar output .
999The device remains in full service while this is occurring.
1000.It Xo
1001.Nm
1002.Cm wdc/resize
1003.Fl s Ar size | Fl g
1004.Ar ctl
1005.Xc
1006This vendor-specific command will get the current over provisioning size
1007or set it.
1008This command operates using power of 10 bytes, that is in terms of
1009gigabytes and not gibibytes.
1010The sizes that are used here will be different from those that the
1011operating system will report for the drive.
1012.Pp
1013The following options are supported:
1014.Bl -tag -width Fl
1015.It Fl g
1016Returns the current size of the device in gigabytes
1017.Pq powers of 10 .
1018.It Fl s Ar size
1019Sets the size of the device to
1020.Ar size
1021which is in gigabytes
1022.Pq powers of 10 .
1023This can be used to adjust the over provisioning ratio on the device.
1024The valid points are device-specific.
1025Please consult WDC datasheets for more information.
1026.Pp
1027When performing a resize
1028.Em all data and namespace will be erased !
1029All namespaces must be detached prior to issuing this.
1030.El
1031.El
1032.Sh EXIT STATUS
1033.Ex -std
1034.Sh EXAMPLES
1035.Bl -tag -width ""
1036.It Sy Example 1: List all NVMe controllers and namespaces
1037.Bd -literal
1038# nvmeadm list
1039nvme1: model: INTEL SSDPEDMD800G4, serial: CVFT4134001R800CGN, FW rev: 8DV10049, NVMe v1.0
1040  nvme1/1 (c1t1d0): Size = 763097 MB, Capacity = 763097 MB, Used = 763097 MB
1041nvme4: model: SAMSUNG MZVPV128HDGM-00000, serial: S1XVNYAGA00640, FW rev: BXW7300Q, NVMe v1.1
1042  nvme4/1 (c2t2d0): Size = 122104 MB, Capacity = 122104 MB, Used = 5127 MB
1043.Ed
1044.It Sy Example 2: Identify a namespace
1045.Bd -literal
1046# nvmeadm identify nvme4/1
1047nvme4/1: Identify Namespace
1048  Namespace Capabilities and Features
1049    Namespace Size:                         122104MB
1050    Namespace Capacity:                     122104MB
1051    Namespace Utilization:                  5127MB
1052    Namespace Features
1053      Thin Provisioning:                    unsupported
1054    Number of LBA Formats:                  1
1055    Formatted LBA Size
1056      LBA Format:                           1
1057      Extended Data LBA:                    no
1058    Metadata Capabilities
1059      Extended Data LBA:                    unsupported
1060      Separate Metadata:                    unsupported
1061    End-to-End Data Protection Capabilities
1062      Protection Information Type 1:        unsupported
1063      Protection Information Type 2:        unsupported
1064      Protection Information Type 3:        unsupported
1065      Protection Information first:         unsupported
1066      Protection Information last:          unsupported
1067    End-to-End Data Protection Settings
1068      Protection Information:               disabled
1069      Protection Information in Metadata:   last 8 bytes
1070    LBA Format 1
1071      Metadata Size:                        0 bytes
1072      LBA Data Size:                        512 bytes
1073      Relative Performance:                 Best
1074.Ed
1075.It Sy Example 3: Get SMART/Health information (verbose)
1076.Bd -literal
1077# nvmeadm -v get-logpage nvme4/1 health
1078nvme4/1: SMART/Health Information
1079  Critical Warnings
1080    Available Space:                        OK
1081    Temperature:                            OK
1082    Device Reliability:                     OK
1083    Media:                                  OK
1084    Volatile Memory Backup:                 OK
1085  Temperature:                              37C
1086  Available Spare Capacity:                 100%
1087  Available Spare Threshold:                10%
1088  Device Life Used:                         0%
1089  Data Read:                                0GB
1090  Data Written:                             64GB
1091  Read Commands:                            52907
1092  Write Commands:                           567874
1093  Controller Busy:                          1min
1094  Power Cycles:                             6
1095  Power On:                                 141h
1096  Unsafe Shutdowns:                         1
1097  Uncorrectable Media Errors:               0
1098  Errors Logged:                            1
1099.Ed
1100.It Sy Example 4: Get Asynchronous Event Configuration information
1101.Bd -literal
1102# nvmeadm get-features nvme0,nvme4 event,power
1103nvme0: Get Features
1104  Asynchronous Event Configuration
1105    Available Space below threshold:        disabled
1106    Temperature above threshold:            disabled
1107    Device Reliability compromised:         disabled
1108    Media read-only:                        disabled
1109  Power Management
1110    Power State:                            0
1111nvme4: Get Features
1112  Asynchronous Event Configuration
1113    Available Space below threshold:        disabled
1114    Temperature above threshold:            disabled
1115    Device Reliability compromised:         disabled
1116    Media read-only:                        disabled
1117    Volatile Memory Backup failed:          disabled
1118  Power Management
1119    Power State:                            0
1120.Ed
1121.It Sy Example 5: Load and activate firmware
1122.Bd -literal
1123# nvmeadm list-firmware nvme3
1124nvme3: Firmware Slot Information
1125  Active Firmware Slot:                     4
1126  Next Firmware Slot:                       4
1127  Firmware Revision for Slot 1:             KNGND110 (read-only)
1128  Firmware Revision for Slot 2:             KNGND110
1129  Firmware Revision for Slot 3:             KNGND110
1130  Firmware Revision for Slot 4:             KNGND112
1131  Firmware Revision for Slot 5:             KNGND110
1132
1133# nvmeadm -v load-firmware nvme3 KNGND113.bin
11341740544 bytes downloaded.
1135
1136# nvmeadm -v commit-firmware nvme3 5
1137Firmware committed to slot 5.
1138
1139# nvmeadm -v activate-firmware nvme3 5
1140Slot 5 activated: NVM subsystem reset required - power cycle your system.
1141
1142# nvmeadm list-firmware nvme3
1143nvme3: Firmware Slot Information
1144  Active Firmware Slot:                     4
1145  Next Firmware Slot:                       5
1146  Firmware Revision for Slot 1:             KNGND110 (read-only)
1147  Firmware Revision for Slot 2:             KNGND110
1148  Firmware Revision for Slot 3:             KNGND110
1149  Firmware Revision for Slot 4:             KNGND112
1150  Firmware Revision for Slot 5:             KNGND113
1151.Ed
1152.It Sy Example 6: Listing Log Pages
1153.Bd -literal
1154# nvmeadm list-logpages nvme8
1155DEVICE  NAME          SCOPE         FIELDS    DESC
1156nvme8   error         controller    rae       Error information
1157nvme8   health        controller,   rae       SMART / Health information
1158                      namespace
1159nvme8   firmware      nvm           --        Firmware Slot Information
1160nvme8   changens      controller    rae       changed namespaces
1161nvme8   wdc/eol       nvm           --        EOL
1162nvme8   wdc/devmgmt   controller,   --        Device Manageability
1163                      namespace
1164nvme8   wdc/pciesi    controller    lsp       PCIe Signal Integrity
1165nvme8   wdc/power     controller    --        Power Samples
1166nvme8   wdc/temp      controller    --        Temperature Samples
1167nvme8   wdc/fwact     controller    --        Firmware Activation
1168nvme8   wdc/ccds      controller    --        CCDS Build Information
1169# nvmeadm list-logpages -p -o name,impl nvme8 firmware
1170firmware:yes
1171.Ed
1172.El
1173.Sh INTERFACE STABILITY
1174The command line interface of
1175.Nm
1176is
1177.Sy Evolving .
1178The output of
1179.Nm
1180is
1181.Sy Not-an-Interface
1182and may change any time.
1183.Sh SEE ALSO
1184.Xr nvme 4D
1185.Pp
1186.Lk http://www.nvmexpress.org/specifications/ "NVMe specifications"
1187