1NVME-ADMIN-PASSTHR(1) NVMe Manual NVME-ADMIN-PASSTHR(1)
2
3
4
6 nvme-admin-passthru - Submit an arbitrary admin command, return results
7
9 nvme-admin-passthru <device> [--opcode=<opcode> | -o <opcode>]
10 [--flags=<flags> | -f <flags>] [-rsvd=<rsvd> | -R <rsvd>]
11 [--namespace-id=<nsid> | -n <nsid>] [--cdw2=<cdw2> | -2 <cdw2>]
12 [--cdw3=<cdw3> | -3 <cdw3>] [--cdw10=<cdw10> | -4 <cdw4>]
13 [--cdw11=<cdw11> | -5 <cdw5>] [--cdw12=<cdw12> | -6 <cdw6>]
14 [--cdw13=<cdw13> | -7 <cdw7>] [--cdw14=<cdw14> | -8 <cdw8>]
15 [--cdw15=<cdw15> | -9 <cdw9>]
16 [--data-len=<data-len> | -l <data-len>]
17 [--metadata-len=<len> | -m <len>]
18 [--input-file=<file> | -i <file>]
19 [--read | -r ] [--write | -w]
20 [--timeout=<to> | -t <to>]
21 [--show-command | -s]
22 [--dry-run | -d]
23 [--raw-binary | -b]
24 [--prefill=<prefill> | -p <prefill>]
25 [--latency | -T]
26
28 Submits an arbitrary NVMe admin command and returns the applicable
29 results. This may be the simply the commands result and status, or may
30 also include a buffer if the command returns one. This command does no
31 interpretation of the opcodes or options.
32
33 The <device> parameter is mandatory and may be either the NVMe
34 character device (ex: /dev/nvme0), or a namespace block device (ex:
35 /dev/nvme0n1).
36
37 On success, the returned structure (if applicable) may be returned in
38 one of several ways depending on the option flags; the structure may
39 printed by the program as a hex dump, or may be returned as a raw
40 buffer printed to stdout for another program to parse.
41
43 -o <opcode>, --opcode=<opcode>
44 The NVMe opcode to send to the device in the command
45
46 -f <flags>, --flags=<flags>
47 The NVMe command flags to send to the device in the command
48
49 -R <rsvd>, --rsvd=<rsvd>
50 The value for the reserved field in the command.
51
52 -n <nsid>, --namespace-id=<nsid>
53 The value for the ns-id in the command.
54
55 -[2-9] <cdw>, --cdw[2-3,10-15]=<cdw>
56 Specifies the command dword value for that specified entry in the
57 command
58
59 -r, --read, -w, --write
60 Used for the data-direction for the command and required for
61 commands sending/receiving data. Don’t use both read and write at
62 the same time.
63
64 -i <file>, --input-file=<file>
65 If the command is a data-out (write) command, use this file to fill
66 the buffer sent to the device. If no file is given, assumed to use
67 STDIN.
68
69 -l <data-len>, --data-len=<data-len>
70 The data length for the buffer used for this command.
71
72 -m <data-len>, --metadata-len=<data-len>
73 The metadata length for the buffer used for this command.
74
75 -s, --show-cmd
76 Print out the command to be sent.
77
78 -d, --dry-run
79 Do not actually send the command. If want to use --dry-run option,
80 --show-cmd option must be set. Otherwise --dry-run option will be
81 ignored.
82
83 -b, --raw-binary
84 Print the raw returned buffer to stdout if the command returns a
85 structure.
86
87 -p, --prefill
88 Prefill the buffer with a predetermined byte value. Defaults to 0.
89 This may be useful if the data you are writing is shorter than the
90 required buffer, and you need to pad it with a known value. It may
91 also be useful if you need to confirm if a device is overwriting a
92 buffer for a data-in command.
93
94 -T, --latency
95 Print out the latency the IOCTL took (in us).
96
98 • The following will run the admin command with opcode=6 and cdw10=1,
99 which corresponds to an identify controller command. This example
100 requires the data-len param be 4096, which is the size of the
101 returned structure. The -r option is used because it is a data-in
102 command
103
104 # nvme admin-passthru /dev/nvme0 --opcode=06 --data-len=4096 --cdw10=1 -r
105
106 • Or if you want to save that structure to a file:
107
108 # nvme admin-passthru /dev/nvme0 --opcode=06 --data-len=4096 --cdw10=1 -r -b > id_ns.raw
109
111 Part of the nvme-user suite
112
113
114
115NVMe 09/29/2023 NVME-ADMIN-PASSTHR(1)