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
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.
13 .\" Copyright 2012, Richard Lowe.
14 .\" Copyright (c) 2012 by Delphix. All rights reserved.
16 .TH "ZDB" "8" "February 15, 2012" "" ""
19 \fBzdb\fR - Display zpool debugging and consistency information
22 \fBzdb\fR [-CumdibcsDvhLMXFPA] [-e [-p \fIpath\fR...]] [-t \fItxg\fR]
23 [-U \fIcache\fR] [-I \fIinflight I/Os\fR]
24 [\fIpoolname\fR [\fIobject\fR ...]]
27 \fBzdb\fR [-divPA] [-e [-p \fIpath\fR...]] [-U \fIcache\fR]
28 \fIdataset\fR [\fIobject\fR ...]
31 \fBzdb\fR -m [-MLXFPA] [-t \fItxg\fR] [-e [-p \fIpath\fR...]] [-U \fIcache\fR]
32 \fIpoolname\fR [\fIvdev\fR [\fImetaslab\fR ...]]
35 \fBzdb\fR -R [-A] [-e [-p \fIpath\fR...]] [-U \fIcache\fR] \fIpoolname\fR
36 \fIvdev\fR:\fIoffset\fR:\fIsize\fR[:\fIflags\fR]
39 \fBzdb\fR -S [-AP] [-e [-p \fIpath\fR...]] [-U \fIcache\fR] \fIpoolname\fR
42 \fBzdb\fR -l [-uA] \fIdevice\fR
45 \fBzdb\fR -C [-A] [-U \fIcache\fR]
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.
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.
59 When operating on an imported and active pool it is possible, though unlikely,
60 that zdb may interpret inconsistent pool data and behave erratically.
72 Display statistics regarding the number, size (logical, physical and
73 allocated) and deduplication of blocks.
83 Verify the checksum of all metadata blocks while printing block statistics
86 If specified multiple times, verify the checksums of all blocks.
96 Display information about the configuration. If specified with no other
97 options, instead display information about the cache file
98 (\fB/etc/zfs/zpool.cache\fR). To specify the cache file to display, see
101 If specified multiple times, and a pool name is also specified display both
102 the cached configuration and the on-disk configuration. If specified multiple
103 times with \fB-e\fR also display the configuration that would be used were the
114 Display information about datasets. Specified once, displays basic dataset
115 information: ID, create transaction, size, and object count.
117 If specified multiple times provides greater and greater verbosity.
119 If object IDs are specified, display information about those specific objects only.
129 Display deduplication statistics, including the deduplication ratio (dedup),
130 compression ratio (compress), inflation due to the zfs copies property
131 (copies), and an overall effective ratio (dedup * compress / copies).
133 If specified twice, display a histogram of deduplication statistics, showing
134 the allocated (physically present on disk) and referenced (logically
135 referenced in the pool) block counts and sizes by reference count.
137 If specified a third time, display the statistics independently for each deduplication table.
139 If specified a fourth time, dump the contents of the deduplication tables describing duplicate blocks.
141 If specified a fifth time, also dump the contents of the deduplication tables describing unique blocks.
151 Display pool history similar to \fBzpool history\fR, but include internal
152 changes, transaction, and dataset information.
162 Display information about intent log (ZIL) entries relating to each
163 dataset. If specified multiple times, display counts of each intent log
170 \fB-l\fR \fIdevice\fR
174 Display the vdev labels from the specified device. If the \fB-u\fR option is
175 also specified, also display the uberblocks on this device.
185 Disable leak tracing and the loading of space maps. By default, \fBzdb\fR
186 verifies that all non-free blocks are referenced, which can be very expensive.
196 Display the offset, spacemap, and free space of each metaslab.
197 When specified twice, also display information about the on-disk free
198 space histogram associated with each metaslab. When specified three time,
199 display the maximum contiguous free space, the in-core free space histogram,
200 and the percentage of free space in each space map. When specified
201 four times display every spacemap record.
211 Display the offset, spacemap, and free space of each metaslab.
212 When specified twice, also display information about the maximum contiguous
213 free space and the percentage of free space in each space map. When specified
214 three times display every spacemap record.
220 \fB-R\fR \fIpoolname\fR \fIvdev\fR:\fIoffset\fR:\fIsize\fR[:\fIflags\fR]
224 Read and display a block from the specified device. By default the block is
225 displayed as a hex dump, but see the description of the \'r\' flag, below.
227 The block is specified in terms of a colon-separated tuple \fIvdev\fR (an
228 integer vdev identifier) \fIoffset\fR (the offset within the vdev) \fIsize\fR
229 (the size of the block to read) and, optionally, \fIflags\fR (a set of flags,
269 Dump gang block header
289 Dump raw uninterpreted block data
300 Report statistics on \fBzdb\fR\'s I/O. Display operation counts, bandwidth,
301 and error counts of I/O to the pool from \fBzdb\fR.
311 Simulate the effects of deduplication, constructing a DDT and then display
312 that DDT as with \fB-DD\fR.
322 Display the current uberblock.
335 Do not abort should any assertion fail.
345 Enable panic recovery, certain errors which would otherwise be fatal are
356 Do not abort if asserts fail and also enable panic recovery.
362 \fB-e\fR [-p \fIpath\fR]...
366 Operate on an exported pool, not present in \fB/etc/zfs/zpool.cache\fR. The
367 \fB-p\fR flag specifies the path under which devices are to be searched.
377 Attempt to make an unreadable pool readable by trying progressively older
384 \fB-I \fIinflight I/Os\fR \fR
388 Limit the number of outstanding checksum I/Os to the specified value. The
389 default value is 200. This option affects the performance of the \fB-c\fR
400 Print numbers in an unscaled form more amenable to parsing, eg. 1000000 rather
407 \fB-t\fR \fItransaction\fR
411 Specify the highest transaction to use when searching for uberblocks. See also
412 the \fB-u\fR and \fB-l\fR options for a means to see the available uberblocks
413 and their associated transaction numbers.
419 \fB-U\fR \fIcachefile\fR
423 Use a cache file other than \fB/etc/zfs/zpool.cache\fR.
433 Enable verbosity. Specify multiple times for increased verbosity.
443 Attempt \'extreme\' transaction rewind, that is attempt the same recovery as
444 \fB-F\fR but read transactions otherwise deemed too old.
454 Attempt a verbatim import. This mimics the behavior of the kernel when loading
455 a pool from a cachefile.
459 Specifying a display option more than once enables verbosity for only that
460 option, with more occurrences enabling more verbosity.
462 If no options are specified, all information about the named pool will be
463 displayed at default verbosity.
467 \fBExample 1 \fRDisplay the configuration of imported pool 'rpool'
482 \fBExample 2 \fRDisplay basic dataset information about 'rpool'
487 Dataset mos [META], ID 0, cr_txg 4, 26.9M, 1051 objects
488 Dataset rpool/swap [ZVOL], ID 59, cr_txg 356, 486M, 2 objects
495 \fBExample 3 \fRDisplay basic information about object 0
496 in 'rpool/export/home'
500 # zdb -d rpool/export/home 0
501 Dataset rpool/export/home [ZPL], ID 137, cr_txg 1546, 32K, 8 objects
503 Object lvl iblk dblk dsize lsize %full type
504 0 7 16K 16K 15.0K 16K 25.00 DMU dnode
510 \fBExample 4 \fRDisplay the predicted effect of enabling deduplication on 'rpool'
515 Simulated DDT histogram:
517 bucket allocated referenced
518 ______ ______________________________ ______________________________
519 refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE
520 ------ ------ ----- ----- ----- ------ ----- ----- -----
521 1 694K 27.1G 15.0G 15.0G 694K 27.1G 15.0G 15.0G
522 2 35.0K 1.33G 699M 699M 74.7K 2.79G 1.45G 1.45G
524 dedup = 1.11, compress = 1.80, copies = 1.00, dedup * compress / copies = 2.00
529 .SH "ENVIRONMENT VARIABLES"
532 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.