8067 zdb should be able to dump literal embedded block pointer
[unleashed.git] / usr / src / man / man1m / zdb.1m
blobf341df4e202a5430a361c1bd5505041033f8ea1d
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 2012, Richard Lowe.
13 .\" Copyright (c) 2012, 2017 by Delphix. All rights reserved.
14 .\" Copyright 2017 Nexenta Systems, Inc.
15 .\"
16 .Dd April 14, 2017
17 .Dt ZDB 1M
18 .Os
19 .Sh NAME
20 .Nm zdb
21 .Nd display zpool debugging and consistency information
22 .Sh SYNOPSIS
23 .Nm
24 .Op Fl AbcdDFGhiLMPsvX
25 .Op Fl e Oo Fl V Oc Op Fl p Ar path ...
26 .Op Fl I Ar inflight I/Os
27 .Oo Fl o Ar var Ns = Ns Ar value Oc Ns ...
28 .Op Fl t Ar txg
29 .Op Fl U Ar cache
30 .Op Fl x Ar dumpdir
31 .Op Ar poolname Op Ar object ...
32 .Nm
33 .Op Fl AdiPv
34 .Op Fl e Oo Fl V Oc Op Fl p Ar path ...
35 .Op Fl U Ar cache
36 .Ar dataset Op Ar object ...
37 .Nm
38 .Fl C
39 .Op Fl A
40 .Op Fl U Ar cache
41 .Nm
42 .Fl E
43 .Op Fl A
44 .Ar word0 Ns : Ns Ar word1 Ns :...: Ns Ar word15
45 .Nm
46 .Fl l
47 .Op Fl Aqu
48 .Ar device
49 .Nm
50 .Fl m
51 .Op Fl AFLPX
52 .Op Fl e Oo Fl V Oc Op Fl p Ar path ...
53 .Op Fl t Ar txg
54 .Op Fl U Ar cache
55 .Ar poolname Op Ar vdev Op Ar metaslab ...
56 .Nm
57 .Fl O
58 .Ar dataset path
59 .Nm
60 .Fl R
61 .Op Fl A
62 .Op Fl e Oo Fl V Oc Op Fl p Ar path ...
63 .Op Fl U Ar cache
64 .Ar poolname vdev Ns : Ns Ar offset Ns : Ns Ar size Ns Op : Ns Ar flags
65 .Nm
66 .Fl S
67 .Op Fl AP
68 .Op Fl e Oo Fl V Oc Op Fl p Ar path ...
69 .Op Fl U Ar cache
70 .Ar poolname
71 .Sh DESCRIPTION
72 The
73 .Nm
74 utility displays information about a ZFS pool useful for debugging and performs
75 some amount of consistency checking.
76 It is a not a general purpose tool and options
77 .Pq and facilities
78 may change.
79 This is neither a
80 .Xr fsck 1M
81 nor an
82 .Xr fsdb 1M
83 utility.
84 .Pp
85 The output of this command in general reflects the on-disk structure of a ZFS
86 pool, and is inherently unstable.
87 The precise output of most invocations is not documented, a knowledge of ZFS
88 internals is assumed.
89 .Pp
90 If the
91 .Ar dataset
92 argument does not contain any
93 .Qq Sy /
95 .Qq Sy @
96 characters, it is interpreted as a pool name.
97 The root dataset can be specified as
98 .Ar pool Ns /
99 .Pq pool name followed by a slash .
101 When operating on an imported and active pool it is possible, though unlikely,
102 that zdb may interpret inconsistent pool data and behave erratically.
103 .Sh OPTIONS
104 Display options:
105 .Bl -tag -width Ds
106 .It Fl b
107 Display statistics regarding the number, size
108 .Pq logical, physical and allocated
109 and deduplication of blocks.
110 .It Fl c
111 Verify the checksum of all metadata blocks while printing block statistics
112 .Po see
113 .Fl b
114 .Pc .
116 If specified multiple times, verify the checksums of all blocks.
117 .It Fl C
118 Display information about the configuration.
119 If specified with no other options, instead display information about the cache
120 file
121 .Pq Pa /etc/zfs/zpool.cache .
122 To specify the cache file to display, see
123 .Fl U .
125 If specified multiple times, and a pool name is also specified display both the
126 cached configuration and the on-disk configuration.
127 If specified multiple times with
128 .Fl e
129 also display the configuration that would be used were the pool to be imported.
130 .It Fl d
131 Display information about datasets.
132 Specified once, displays basic dataset information: ID, create transaction,
133 size, and object count.
135 If specified multiple times provides greater and greater verbosity.
137 If object IDs are specified, display information about those specific objects
138 only.
139 .It Fl D
140 Display deduplication statistics, including the deduplication ratio
141 .Pq Sy dedup ,
142 compression ratio
143 .Pq Sy compress ,
144 inflation due to the zfs copies property
145 .Pq Sy copies ,
146 and an overall effective ratio
147 .Pq Sy dedup No * Sy compress No / Sy copies .
148 .It Fl DD
149 Display a histogram of deduplication statistics, showing the allocated
150 .Pq physically present on disk
151 and referenced
152 .Pq logically referenced in the pool
153 block counts and sizes by reference count.
154 .It Fl DDD
155 Display the statistics independently for each deduplication table.
156 .It Fl DDDD
157 Dump the contents of the deduplication tables describing duplicate blocks.
158 .It Fl DDDDD
159 Also dump the contents of the deduplication tables describing unique blocks.
160 .It Fl E Ar word0 Ns : Ns Ar word1 Ns :...: Ns Ar word15
161 Decode and display block from an embedded block pointer specified by the
162 .Ar word
163 arguments.
164 .It Fl h
165 Display pool history similar to
166 .Nm zpool Cm history ,
167 but include internal changes, transaction, and dataset information.
168 .It Fl i
169 Display information about intent log
170 .Pq ZIL
171 entries relating to each dataset.
172 If specified multiple times, display counts of each intent log transaction type.
173 .It Fl l Ar device
174 Read the vdev labels from the specified device.
175 .Nm Fl l
176 will return 0 if valid label was found, 1 if error occurred, and 2 if no valid
177 labels were found.
179 If the
180 .Fl q
181 option is also specified, don't print the labels.
183 If the
184 .Fl u
185 option is also specified, also display the uberblocks on this device.
186 .It Fl L
187 Disable leak tracing and the loading of space maps.
188 By default,
190 verifies that all non-free blocks are referenced, which can be very expensive.
191 .It Fl m
192 Display the offset, spacemap, and free space of each metaslab.
193 .It Fl mm
194 Also display information about the on-disk free space histogram associated with
195 each metaslab.
196 .It Fl mmm
197 Display the maximum contiguous free space, the in-core free space histogram, and
198 the percentage of free space in each space map.
199 .It Fl mmmm
200 Display every spacemap record.
201 .It Fl M
202 Display the offset, spacemap, and free space of each metaslab.
203 .It Fl MM
204 Also display information about the maximum contiguous free space and the
205 percentage of free space in each space map.
206 .It Fl MMM
207 Display every spacemap record.
208 .It Fl O Ar dataset path
209 Look up the specified
210 .Ar path
211 inside of the
212 .Ar dataset
213 and display its metadata and indirect blocks.
214 Specified
215 .Ar path
216 must be relative to the root of
217 .Ar dataset .
218 This option can be combined with
219 .Fl v
220 for increasing verbosity.
221 .It Fl R Ar poolname vdev Ns : Ns Ar offset Ns : Ns Ar size Ns Op : Ns Ar flags
222 Read and display a block from the specified device.
223 By default the block is displayed as a hex dump, but see the description of the
224 .Sy r
225 flag, below.
227 The block is specified in terms of a colon-separated tuple
228 .Ar vdev
229 .Pq an integer vdev identifier
230 .Ar offset
231 .Pq the offset within the vdev
232 .Ar size
233 .Pq the size of the block to read
234 and, optionally,
235 .Ar flags
236 .Pq a set of flags, described below .
238 .Bl -tag -compact -width "b offset"
239 .It Sy b Ar offset
240 Print block pointer
241 .It Sy d
242 Decompress the block
243 .It Sy e
244 Byte swap the block
245 .It Sy g
246 Dump gang block header
247 .It Sy i
248 Dump indirect block
249 .It Sy r
250 Dump raw uninterpreted block data
252 .It Fl s
253 Report statistics on
254 .Nm zdb
255 I/O.
256 Display operation counts, bandwidth, and error counts of I/O to the pool from
257 .Nm .
258 .It Fl S
259 Simulate the effects of deduplication, constructing a DDT and then display
260 that DDT as with
261 .Fl DD .
262 .It Fl u
263 Display the current uberblock.
266 Other options:
267 .Bl -tag -width Ds
268 .It Fl A
269 Do not abort should any assertion fail.
270 .It Fl AA
271 Enable panic recovery, certain errors which would otherwise be fatal are
272 demoted to warnings.
273 .It Fl AAA
274 Do not abort if asserts fail and also enable panic recovery.
275 .It Fl e Op Fl p Ar path ...
276 Operate on an exported pool, not present in
277 .Pa /etc/zfs/zpool.cache .
279 .Fl p
280 flag specifies the path under which devices are to be searched.
281 .It Fl x Ar dumpdir
282 All blocks accessed will be copied to files in the specified directory.
283 The blocks will be placed in sparse files whose name is the same as
284 that of the file or device read.
286 can be then run on the generated files.
287 Note that the
288 .Fl bbc
289 flags are sufficient to access
290 .Pq and thus copy
291 all metadata on the pool.
292 .It Fl F
293 Attempt to make an unreadable pool readable by trying progressively older
294 transactions.
295 .It Fl G
296 Dump the contents of the zfs_dbgmsg buffer before exiting
297 .Nm .
298 zfs_dbgmsg is a buffer used by ZFS to dump advanced debug information.
299 .It Fl I Ar inflight I/Os
300 Limit the number of outstanding checksum I/Os to the specified value.
301 The default value is 200.
302 This option affects the performance of the
303 .Fl c
304 option.
305 .It Fl o Ar var Ns = Ns Ar value ...
306 Set the given global libzpool variable to the provided value.
307 The value must be an unsigned 32-bit integer.
308 Currently only little-endian systems are supported to avoid accidentally setting
309 the high 32 bits of 64-bit variables.
310 .It Fl P
311 Print numbers in an unscaled form more amenable to parsing, eg. 1000000 rather
312 than 1M.
313 .It Fl t Ar transaction
314 Specify the highest transaction to use when searching for uberblocks.
315 See also the
316 .Fl u
318 .Fl l
319 options for a means to see the available uberblocks and their associated
320 transaction numbers.
321 .It Fl U Ar cachefile
322 Use a cache file other than
323 .Pa /etc/zfs/zpool.cache .
324 .It Fl v
325 Enable verbosity.
326 Specify multiple times for increased verbosity.
327 .It Fl V
328 Attempt verbatim import.
329 This mimics the behavior of the kernel when loading a pool from a cachefile.
330 Only usable with
331 .Fl e .
332 .It Fl X
333 Attempt
334 .Qq extreme
335 transaction rewind, that is attempt the same recovery as
336 .Fl F
337 but read transactions otherwise deemed too old.
340 Specifying a display option more than once enables verbosity for only that
341 option, with more occurrences enabling more verbosity.
343 If no options are specified, all information about the named pool will be
344 displayed at default verbosity.
345 .Sh EXAMPLES
346 .Bl -tag -width Ds
347 .It Xo
348 .Sy Example 1
349 Display the configuration of imported pool
350 .Pa rpool
352 .Bd -literal
353 # zdb -C rpool
355 MOS Configuration:
356         version: 28
357         name: 'rpool'
358  ...
360 .It Xo
361 .Sy Example 2
362 Display basic dataset information about
363 .Pa rpool
365 .Bd -literal
366 # zdb -d rpool
367 Dataset mos [META], ID 0, cr_txg 4, 26.9M, 1051 objects
368 Dataset rpool/swap [ZVOL], ID 59, cr_txg 356, 486M, 2 objects
369  ...
371 .It Xo
372 .Sy Example 3
373 Display basic information about object 0 in
374 .Pa rpool/export/home
376 .Bd -literal
377 # zdb -d rpool/export/home 0
378 Dataset rpool/export/home [ZPL], ID 137, cr_txg 1546, 32K, 8 objects
380     Object  lvl   iblk   dblk  dsize  lsize   %full  type
381          0    7    16K    16K  15.0K    16K   25.00  DMU dnode
383 .It Xo
384 .Sy Example 4
385 Display the predicted effect of enabling deduplication on
386 .Pa rpool
388 .Bd -literal
389 # zdb -S rpool
390 Simulated DDT histogram:
392 bucket              allocated                       referenced
393 ______   ______________________________   ______________________________
394 refcnt   blocks   LSIZE   PSIZE   DSIZE   blocks   LSIZE   PSIZE   DSIZE
395 ------   ------   -----   -----   -----   ------   -----   -----   -----
396      1     694K   27.1G   15.0G   15.0G     694K   27.1G   15.0G   15.0G
397      2    35.0K   1.33G    699M    699M    74.7K   2.79G   1.45G   1.45G
398  ...
399 dedup = 1.11, compress = 1.80, copies = 1.00, dedup * compress / copies = 2.00
402 .Sh SEE ALSO
403 .Xr zfs 1M ,
404 .Xr zpool 1M