]> granicus.if.org Git - zfs/blob - man/man8/zdb.8
Illumos 4891 - want zdb option to dump all metadata
[zfs] / man / man8 / zdb.8
1 '\" t
2 .\"
3 .\" This file and its contents are supplied under the terms of the
4 .\" Common Development and Distribution License ("CDDL"), version 1.0.
5 .\" You may only use this file in accordance with the terms of version
6 .\" 1.0 of the CDDL.
7 .\"
8 .\" A full copy of the text of the CDDL should have accompanied this
9 .\" source.  A copy of the CDDL is also available via the Internet at
10 .\" http://www.illumos.org/license/CDDL.
11 .\"
12 .\"
13 .\" Copyright 2012, Richard Lowe.
14 .\" Copyright (c) 2012, 2014 by Delphix. All rights reserved.
15 .\"
16 .TH "ZDB" "8" "February 15, 2012" "" ""
17
18 .SH "NAME"
19 \fBzdb\fR - Display zpool debugging and consistency information
20
21 .SH "SYNOPSIS"
22 \fBzdb\fR [-CumdibcsDvhLMXFPA] [-e [-p \fIpath\fR...]] [-t \fItxg\fR]
23     [-U \fIcache\fR] [-I \fIinflight I/Os\fR] [-x \fIdumpdir\fR]
24     [\fIpoolname\fR [\fIobject\fR ...]]
25
26 .P
27 \fBzdb\fR [-divPA] [-e [-p \fIpath\fR...]] [-U \fIcache\fR]
28     \fIdataset\fR [\fIobject\fR ...]
29
30 .P
31 \fBzdb\fR -m [-MLXFPA] [-t \fItxg\fR] [-e [-p \fIpath\fR...]] [-U \fIcache\fR]
32     \fIpoolname\fR [\fIvdev\fR [\fImetaslab\fR ...]]
33
34 .P
35 \fBzdb\fR -R [-A] [-e [-p \fIpath\fR...]] [-U \fIcache\fR] \fIpoolname\fR
36     \fIvdev\fR:\fIoffset\fR:\fIsize\fR[:\fIflags\fR]
37
38 .P
39 \fBzdb\fR -S [-AP] [-e [-p \fIpath\fR...]] [-U \fIcache\fR] \fIpoolname\fR
40
41 .P
42 \fBzdb\fR -l [-uA] \fIdevice\fR
43
44 .P
45 \fBzdb\fR -C [-A] [-U \fIcache\fR]
46
47 .SH "DESCRIPTION"
48 The \fBzdb\fR utility displays information about a ZFS pool useful for
49 debugging and performs some amount of consistency checking. It is a not a
50 general purpose tool and options (and facilities) may change. This is neither
51 a fsck(8) nor an fsdb(8) utility.
52
53 .P
54 The output of this command in general reflects the on-disk structure of a ZFS
55 pool, and is inherently unstable. The precise output of most invocations is
56 not documented, a knowledge of ZFS internals is assumed.
57
58 .P
59 If the \fIdataset\fR argument does not contain any \fB/\fR or \fB@\fR
60 characters, it is interpreted as a pool name.  The root dataset can be
61 specified as \fIpool\fB/\fR (pool name followed by a slash).
62
63 .P
64 When operating on an imported and active pool it is possible, though unlikely,
65 that zdb may interpret inconsistent pool data and behave erratically.
66
67 .SH "OPTIONS"
68 Display options:
69
70 .sp
71 .ne 2
72 .na
73 \fB-b\fR
74 .ad
75 .sp .6
76 .RS 4n
77 Display statistics regarding the number, size (logical, physical and
78 allocated) and deduplication of blocks.
79 .RE
80
81 .sp
82 .ne 2
83 .na
84 \fB-c\fR
85 .ad
86 .sp .6
87 .RS 4n
88 Verify the checksum of all metadata blocks while printing block statistics
89 (see \fB-b\fR).
90 .sp
91 If specified multiple times, verify the checksums of all blocks.
92 .RE
93
94 .sp
95 .ne 2
96 .na
97 \fB-C\fR
98 .ad
99 .sp .6
100 .RS 4n
101 Display information about the configuration. If specified with no other
102 options, instead display information about the cache file
103 (\fB/etc/zfs/zpool.cache\fR). To specify the cache file to display, see
104 \fB-U\fR.
105 .P
106 If specified multiple times, and a pool name is also specified display both
107 the cached configuration and the on-disk configuration.  If specified multiple
108 times with \fB-e\fR also display the configuration that would be used were the
109 pool to be imported.
110 .RE
111
112 .sp
113 .ne 2
114 .na
115 \fB-d\fR
116 .ad
117 .sp .6
118 .RS 4n
119 Display information about datasets. Specified once, displays basic dataset
120 information: ID, create transaction, size, and object count.
121 .sp
122 If specified multiple times provides greater and greater verbosity.
123 .sp
124 If object IDs are specified, display information about those specific objects only.
125 .RE
126
127 .sp
128 .ne 2
129 .na
130 \fB-D\fR
131 .ad
132 .sp .6
133 .RS 4n
134 Display deduplication statistics, including the deduplication ratio (dedup),
135 compression ratio (compress), inflation due to the zfs copies property
136 (copies), and an overall effective ratio (dedup * compress / copies).
137 .sp
138 If specified twice, display a histogram of deduplication statistics, showing
139 the allocated (physically present on disk) and referenced (logically
140 referenced in the pool) block counts and sizes by reference count.
141 .sp
142 If specified a third time, display the statistics independently for each deduplication table.
143 .sp
144 If specified a fourth time, dump the contents of the deduplication tables describing duplicate blocks.
145 .sp
146 If specified a fifth time, also dump the contents of the deduplication tables describing unique blocks.
147 .RE
148
149 .sp
150 .ne 2
151 .na
152 \fB-h\fR
153 .ad
154 .sp .6
155 .RS 4n
156 Display pool history similar to \fBzpool history\fR, but include internal
157 changes, transaction, and dataset information.
158 .RE
159
160 .sp
161 .ne 2
162 .na
163 \fB-i\fR
164 .ad
165 .sp .6
166 .RS 4n
167 Display information about intent log (ZIL) entries relating to each
168 dataset. If specified multiple times, display counts of each intent log
169 transaction type.
170 .RE
171
172 .sp
173 .ne 2
174 .na
175 \fB-l\fR \fIdevice\fR
176 .ad
177 .sp .6
178 .RS 4n
179 Display the vdev labels from the specified device. If the \fB-u\fR option is
180 also specified, also display the uberblocks on this device.
181 .RE
182
183 .sp
184 .ne 2
185 .na
186 \fB-L\fR
187 .ad
188 .sp .6
189 .RS 4n
190 Disable leak tracing and the loading of space maps.  By default, \fBzdb\fR
191 verifies that all non-free blocks are referenced, which can be very expensive.
192 .RE
193
194 .sp
195 .ne 2
196 .na
197 \fB-m\fR
198 .ad
199 .sp .6
200 .RS 4n
201 Display the offset, spacemap, and free space of each metaslab.
202 When specified twice, also display information about the on-disk free
203 space histogram associated with each metaslab. When specified three time,
204 display the maximum contiguous free space, the in-core free space histogram,
205 and the percentage of free space in each space map.  When specified
206 four times display every spacemap record.
207 .RE
208
209 .sp
210 .ne 2
211 .na
212 \fB-M\fR
213 .ad
214 .sp .6
215 .RS 4n
216 Display the offset, spacemap, and free space of each metaslab.
217 When specified twice, also display information about the maximum contiguous
218 free space and the percentage of free space in each space map.  When specified
219 three times display every spacemap record.
220 .RE
221
222 .sp
223 .ne 2
224 .na
225 \fB-R\fR \fIpoolname\fR \fIvdev\fR:\fIoffset\fR:\fIsize\fR[:\fIflags\fR]
226 .ad
227 .sp .6
228 .RS 4n
229 Read and display a block from the specified device. By default the block is
230 displayed as a hex dump, but see the description of the \'r\' flag, below.
231 .sp
232 The block is specified in terms of a colon-separated tuple \fIvdev\fR (an
233 integer vdev identifier) \fIoffset\fR (the offset within the vdev) \fIsize\fR
234 (the size of the block to read) and, optionally, \fIflags\fR (a set of flags,
235 described below).
236
237 .sp
238 .ne 2
239 .na
240 \fBb\fR \fIoffset\fR
241 .ad
242 .sp .6
243 .RS 4n
244 Print block pointer
245 .RE
246
247 .sp
248 .ne 2
249 .na
250 \fBd\fR
251 .ad
252 .sp .6
253 .RS 4n
254 Decompress the block
255 .RE
256
257 .sp
258 .ne 2
259 .na
260 \fBe\fR
261 .ad
262 .sp .6
263 .RS 4n
264 Byte swap the block
265 .RE
266
267 .sp
268 .ne 2
269 .na
270 \fBg\fR
271 .ad
272 .sp .6
273 .RS 4n
274 Dump gang block header
275 .RE
276
277 .sp
278 .ne 2
279 .na
280 \fBi\fR
281 .ad
282 .sp .6
283 .RS 4n
284 Dump indirect block
285 .RE
286
287 .sp
288 .ne 2
289 .na
290 \fBr\fR
291 .ad
292 .sp .6
293 .RS 4n
294 Dump raw uninterpreted block data
295 .RE
296 .RE
297
298 .sp
299 .ne 2
300 .na
301 \fB-s\fR
302 .ad
303 .sp .6
304 .RS 4n
305 Report statistics on \fBzdb\fR\'s I/O. Display operation counts, bandwidth,
306 and error counts of I/O to the pool from \fBzdb\fR.
307 .RE
308
309 .sp
310 .ne 2
311 .na
312 \fB-S\fR
313 .ad
314 .sp .6
315 .RS 4n
316 Simulate the effects of deduplication, constructing a DDT and then display
317 that DDT as with \fB-DD\fR.
318 .RE
319
320 .sp
321 .ne 2
322 .na
323 \fB-u\fR
324 .ad
325 .sp .6
326 .RS 4n
327 Display the current uberblock.
328 .RE
329
330 .P
331 Other options:
332
333 .sp
334 .ne 2
335 .na
336 \fB-A\fR
337 .ad
338 .sp .6
339 .RS 4n
340 Do not abort should any assertion fail.
341 .RE
342
343 .sp
344 .ne 2
345 .na
346 \fB-AA\fR
347 .ad
348 .sp .6
349 .RS 4n
350 Enable panic recovery, certain errors which would otherwise be fatal are
351 demoted to warnings.
352 .RE
353
354 .sp
355 .ne 2
356 .na
357 \fB-AAA\fR
358 .ad
359 .sp .6
360 .RS 4n
361 Do not abort if asserts fail and also enable panic recovery.
362 .RE
363
364 .sp
365 .ne 2
366 .na
367 \fB-e\fR [-p \fIpath\fR]...
368 .ad
369 .sp .6
370 .RS 4n
371 Operate on an exported pool, not present in \fB/etc/zfs/zpool.cache\fR. The
372 \fB-p\fR flag specifies the path under which devices are to be searched.
373 .RE
374
375 .sp
376 .ne 2
377 .na
378 \fB-x\fR \fIdumpdir\fR
379 .ad
380 .sp .6
381 .RS 4n
382 All blocks accessed will be copied to files in the specified directory.
383 The blocks will be placed in sparse files whose name is the same as
384 that of the file or device read.  zdb can be then run on the generated files.
385 Note that the \fB-bbc\fR flags are sufficient to access (and thus copy)
386 all metadata on the pool.
387 .RE
388
389 .sp
390 .ne 2
391 .na
392 \fB-F\fR
393 .ad
394 .sp .6
395 .RS 4n
396 Attempt to make an unreadable pool readable by trying progressively older
397 transactions.
398 .RE
399
400 .sp
401 .ne 2
402 .na
403 \fB-I \fIinflight I/Os\fR \fR
404 .ad
405 .sp .6
406 .RS 4n
407 Limit the number of outstanding checksum I/Os to the specified value. The
408 default value is 200. This option affects the performance of the \fB-c\fR
409 option.
410 .RE
411
412 .sp
413 .ne 2
414 .na
415 \fB-P\fR
416 .ad
417 .sp .6
418 .RS 4n
419 Print numbers in an unscaled form more amenable to parsing, eg. 1000000 rather
420 than 1M.
421 .RE
422
423 .sp
424 .ne 2
425 .na
426 \fB-t\fR \fItransaction\fR
427 .ad
428 .sp .6
429 .RS 4n
430 Specify the highest transaction to use when searching for uberblocks. See also
431 the \fB-u\fR and \fB-l\fR options for a means to see the available uberblocks
432 and their associated transaction numbers.
433 .RE
434
435 .sp
436 .ne 2
437 .na
438 \fB-U\fR \fIcachefile\fR
439 .ad
440 .sp .6
441 .RS 4n
442 Use a cache file other than \fB/etc/zfs/zpool.cache\fR.
443 .RE
444
445 .sp
446 .ne 2
447 .na
448 \fB-v\fR
449 .ad
450 .sp .6
451 .RS 4n
452 Enable verbosity. Specify multiple times for increased verbosity.
453 .RE
454
455 .sp
456 .ne 2
457 .na
458 \fB-X\fR
459 .ad
460 .sp .6
461 .RS 4n
462 Attempt \'extreme\' transaction rewind, that is attempt the same recovery as
463 \fB-F\fR but read transactions otherwise deemed too old.
464 .RE
465
466 .sp
467 .ne 2
468 .na
469 \fB-V\fR
470 .ad
471 .sp .6
472 .RS 4n
473 Attempt a verbatim import. This mimics the behavior of the kernel when loading
474 a pool from a cachefile.
475 .RE
476
477 .P
478 Specifying a display option more than once enables verbosity for only that
479 option, with more occurrences enabling more verbosity.
480 .P
481 If no options are specified, all information about the named pool will be
482 displayed at default verbosity.
483
484 .SH "EXAMPLES"
485 .LP
486 \fBExample 1 \fRDisplay the configuration of imported pool 'rpool'
487 .sp
488 .in +2
489 .nf
490 # zdb -C rpool
491
492 MOS Configuration:
493         version: 28
494         name: 'rpool'
495  ...
496 .fi
497 .in -2
498 .sp
499
500 .LP
501 \fBExample 2 \fRDisplay basic dataset information about 'rpool'
502 .sp
503 .in +2
504 .nf
505 # zdb -d rpool
506 Dataset mos [META], ID 0, cr_txg 4, 26.9M, 1051 objects
507 Dataset rpool/swap [ZVOL], ID 59, cr_txg 356, 486M, 2 objects
508  ...
509 .fi
510 .in -2
511 .sp
512
513 .LP
514 \fBExample 3 \fRDisplay basic information about object 0
515 in 'rpool/export/home'
516 .sp
517 .in +2
518 .nf
519 # zdb -d rpool/export/home 0
520 Dataset rpool/export/home [ZPL], ID 137, cr_txg 1546, 32K, 8 objects
521
522     Object  lvl   iblk   dblk  dsize  lsize   %full  type
523          0    7    16K    16K  15.0K    16K   25.00  DMU dnode
524 .fi
525 .in -2
526 .sp
527
528 .LP
529 \fBExample 4 \fRDisplay the predicted effect of enabling deduplication on 'rpool'
530 .sp
531 .in +2
532 .nf
533 # zdb -S rpool
534 Simulated DDT histogram:
535
536 bucket              allocated                       referenced
537 ______   ______________________________   ______________________________
538 refcnt   blocks   LSIZE   PSIZE   DSIZE   blocks   LSIZE   PSIZE   DSIZE
539 ------   ------   -----   -----   -----   ------   -----   -----   -----
540      1     694K   27.1G   15.0G   15.0G     694K   27.1G   15.0G   15.0G
541      2    35.0K   1.33G    699M    699M    74.7K   2.79G   1.45G   1.45G
542  ...
543 dedup = 1.11, compress = 1.80, copies = 1.00, dedup * compress / copies = 2.00
544 .fi
545 .in -2
546 .sp
547
548 .SH "ENVIRONMENT VARIABLES"
549 .TP
550 .B "SPA_CONFIG_PATH"
551 Override the default \fBspa_config_path\fR (\fI/etc/zfs/zpool.cache\fR) setting. If \fB-U\fR flag is specified it will override this environment variable settings once again.
552
553 .SH "SEE ALSO"
554 zfs(8), zpool(8)