aboutsummaryrefslogtreecommitdiff
path: root/sbin/nvmecontrol/nvmecontrol.8
blob: 9967ed809cdde75a1420d59a10a35ad6880d858a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
.\"
.\" Copyright (c) 2012 Intel Corporation
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions, and the following disclaimer,
.\"    without modification.
.\" 2. Redistributions in binary form must reproduce at minimum a disclaimer
.\"    substantially similar to the "NO WARRANTY" disclaimer below
.\"    ("Disclaimer") and any redistribution must be conditioned upon
.\"    including a substantially similar Disclaimer requirement for further
.\"    binary redistribution.
.\"
.\" NO WARRANTY
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
.\" HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGES.
.\"
.\" nvmecontrol man page.
.\"
.\" Author: Jim Harris <jimharris@FreeBSD.org>
.\"
.\" $FreeBSD$
.\"
.Dd February 24, 2017
.Dt NVMECONTROL 8
.Os
.Sh NAME
.Nm nvmecontrol
.Nd NVM Express control utility
.Sh SYNOPSIS
.Nm
.Ic devlist
.Nm
.Ic identify
.Op Fl v
.Op Fl x
.Aq device id
.Nm
.Ic perftest
.Aq Fl n Ar num_threads
.Aq Fl o Ar read|write
.Op Fl p
.Aq Fl s Ar size_in_bytes
.Aq Fl t Ar time_in_sec
.Aq namespace id
.Nm
.Ic reset
.Aq controller id
.Nm
.Ic logpage
.Aq Fl p Ar page_id
.Op Fl x
.Op Fl v Ar vendor-string
.Op Fl b
.Aq device id
.Aq namespace id
.Nm
.Ic firmware
.Op Fl s Ar slot
.Op Fl f Ar path_to_firmware
.Op Fl a
.Aq device id
.Nm
.Ic power
.Op Fl l
.Op Fl p power_state
.Op Fl w workload_hint
.Nm
.Ic wdc cap-diag
.Op Fl o path_template
.Aq device id
.Nm
.Ic wdc drive-log
.Op Fl o path_template
.Aq device id
.Nm
.Ic wdc get-crash-dump
.Op Fl o path_template
.Aq device id
.\" .Nm
.\" .Ic wdc purge
.\" .Aq device id
.\" .Nm
.\" .Ic wdc purge-monitor
.\" .Aq device id
.Sh DESCRIPTION
NVM Express (NVMe) is a storage protocol standard, for SSDs and other
high-speed storage devices over PCI Express.
.Pp
.Ss logpage
The logpage command knows how to print log pages of various types.
It also knows about vendor specific log pages from hgst/wdc and intel.
Page 0xc1 for hgst/wdc contains the advanced smart information about
the drive.
Page 0xc1 is read latency stats for intel.
Page 0xc2 is write latency stats for intel.
Page 0xc5 is temperature stats for intel.
Page 0xca is advanced smart information for intel.
.Pp
Specifying
.Fl p
.Ic help
will list all valid vendors and pages.
.Fl x
will print the page as hex.
.Fl b
will print the binary data for the page.
.Ss wdc
The various wdc command retrieve log data from the wdc/hgst drives.
The
.Fl o
flag specifies a path template to use to output the files.
Each file takes the path template (which defaults to nothing), appends
the drive's serial number and the type of dump it is followed
by .bin.
These logs must be sent to the vendor for analysis.
This tool only provides a way to extract them.
.Sh EXAMPLES
.Dl nvmecontrol devlist
.Pp
Display a list of NVMe controllers and namespaces along with their device nodes.
.Pp
.Dl nvmecontrol identify nvme0
.Pp
Display a human-readable summary of the nvme0 IDENTIFY_CONTROLLER data.
.Pp
.Dl nvmecontrol identify -x -v nvme0ns1
.Pp
Display an hexadecimal dump of the nvme0 IDENTIFY_NAMESPACE data for namespace
1.
.Pp
.Dl nvmecontrol perftest -n 32 -o read -s 512 -t 30 nvme0ns1
.Pp
Run a performance test on nvme0ns1 using 32 kernel threads for 30 seconds.
Each thread will issue a single 512 byte read command.
Results are printed to stdout when 30 seconds expires.
.Pp
.Dl nvmecontrol reset nvme0
.Pp
Perform a controller-level reset of the nvme0 controller.
.Pp
.Dl nvmecontrol logpage -p 1 nvme0
.Pp
Display a human-readable summary of the nvme0 controller's Error Information Log.
Log pages defined by the NVMe specification include Error Information Log (ID=1),
SMART/Health Information Log (ID=2), and Firmware Slot Log (ID=3).
.Pp
.Dl nvmecontrol logpage -p 0xc1 -v wdc nvme0
.Pp
Display a human-readable summary of the nvme0's wdc-specific advanced
SMART data.
.Pp
.Dl nvmecontrol logpage -p 1 -x nvme0
.Pp
Display a hexadecimal dump of the nvme0 controller's Error Information Log.
.Pp
.Dl nvmecontrol logpage -p 0xcb -b nvme0 > /tmp/page-cb.bin
.Pp
Print the contents of vendor specific page 0xcb as binary data on
standard out.
Redirect it to a temporary file.
.Pp
.Dl nvmecontrol firmware -s 2 -f /tmp/nvme_firmware nvme0
.Pp
Download the firmware image contained in "/tmp/nvme_firmware" to slot 2 of the
nvme0 controller, but do not activate the image.
.Pp
.Dl nvmecontrol firmware -s 4 -a nvme0
.Pp
Activate the firmware in slot 4 of the nvme0 controller on the next reset.
.Pp
.Dl nvmecontrol firmware -s 7 -f /tmp/nvme_firmware -a nvme0
.Pp
Download the firmware image contained in "/tmp/nvme_firmware" to slot 7 of the
nvme0 controller and activate it on the next reset.
.Pp
.Dl nvmecontrol power -l nvme0
.Pp
List all the current power modes.
.Pp
.Dl nvmecontrol power -p 3 nvme0
.Pp
Set the current power mode.
.Pp
.Dl nvmecontrol power nvme0
.Pp
Get the current power mode.
.Sh HISTORY
The
.Nm
utility appeared in
.Fx 9.2 .
.Sh AUTHORS
.An -nosplit
.Nm
was developed by Intel and originally written by
.An Jim Harris Aq Mt jimharris@FreeBSD.org .
.Pp
This man page was written by
.An Jim Harris Aq Mt jimharris@FreeBSD.org .