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 [-CumdibcsDvhLVXFPA] [-e [-p \fIpath\fR...]] [-t \fItxg\fR]
23 [-U \fIcache\fR] [-M \fIinflight I/Os\fR] [\fIpoolname\fR
27 \fBzdb\fR [-divPA] [-e [-p \fIpath\fR...]] [-U \fIcache\fR]
28 \fIdataset\fR [\fIobject\fR ...]
31 \fBzdb\fR -m [-LXFPA] [-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 maximum contiguous
198 free space and the percentage of free space in each space map. When specified
199 three times display every spacemap record.
205 \fB-R\fR \fIpoolname\fR \fIvdev\fR:\fIoffset\fR:\fIsize\fR[:\fIflags\fR]
209 Read and display a block from the specified device. By default the block is
210 displayed as a hex dump, but see the description of the \'r\' flag, below.
212 The block is specified in terms of a colon-separated tuple \fIvdev\fR (an
213 integer vdev identifier) \fIoffset\fR (the offset within the vdev) \fIsize\fR
214 (the size of the block to read) and, optionally, \fIflags\fR (a set of flags,
254 Dump gang block header
274 Dump raw uninterpreted block data
285 Report statistics on \fBzdb\fR\'s I/O. Display operation counts, bandwidth,
286 and error counts of I/O to the pool from \fBzdb\fR.
296 Simulate the effects of deduplication, constructing a DDT and then display
297 that DDT as with \fB-DD\fR.
307 Display the current uberblock.
320 Do not abort should any assertion fail.
330 Enable panic recovery, certain errors which would otherwise be fatal are
341 Do not abort if asserts fail and also enable panic recovery.
347 \fB-e\fR [-p \fIpath\fR]...
351 Operate on an exported pool, not present in \fB/etc/zfs/zpool.cache\fR. The
352 \fB-p\fR flag specifies the path under which devices are to be searched.
362 Attempt to make an unreadable pool readable by trying progressively older
369 \fB-M \fIinflight I/Os\fR \fR
373 Limit the number of outstanding checksum I/Os to the specified value. The
374 default value is 200. This option affects the performance of the \fB-c\fR
385 Print numbers in an unscaled form more amenable to parsing, eg. 1000000 rather
392 \fB-t\fR \fItransaction\fR
396 Specify the highest transaction to use when searching for uberblocks. See also
397 the \fB-u\fR and \fB-l\fR options for a means to see the available uberblocks
398 and their associated transaction numbers.
404 \fB-U\fR \fIcachefile\fR
408 Use a cache file other than \fB/etc/zfs/zpool.cache\fR.
418 Enable verbosity. Specify multiple times for increased verbosity.
428 Attempt \'extreme\' transaction rewind, that is attempt the same recovery as
429 \fB-F\fR but read transactions otherwise deemed too old.
439 Attempt a verbatim import. This mimics the behavior of the kernel when loading
440 a pool from a cachefile.
444 Specifying a display option more than once enables verbosity for only that
445 option, with more occurrences enabling more verbosity.
447 If no options are specified, all information about the named pool will be
448 displayed at default verbosity.
452 \fBExample 1 \fRDisplay the configuration of imported pool 'rpool'
467 \fBExample 2 \fRDisplay basic dataset information about 'rpool'
472 Dataset mos [META], ID 0, cr_txg 4, 26.9M, 1051 objects
473 Dataset rpool/swap [ZVOL], ID 59, cr_txg 356, 486M, 2 objects
480 \fBExample 3 \fRDisplay basic information about object 0
481 in 'rpool/export/home'
485 # zdb -d rpool/export/home 0
486 Dataset rpool/export/home [ZPL], ID 137, cr_txg 1546, 32K, 8 objects
488 Object lvl iblk dblk dsize lsize %full type
489 0 7 16K 16K 15.0K 16K 25.00 DMU dnode
495 \fBExample 4 \fRDisplay the predicted effect of enabling deduplication on 'rpool'
500 Simulated DDT histogram:
502 bucket allocated referenced
503 ______ ______________________________ ______________________________
504 refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE
505 ------ ------ ----- ----- ----- ------ ----- ----- -----
506 1 694K 27.1G 15.0G 15.0G 694K 27.1G 15.0G 15.0G
507 2 35.0K 1.33G 699M 699M 74.7K 2.79G 1.45G 1.45G
509 dedup = 1.11, compress = 1.80, copies = 1.00, dedup * compress / copies = 2.00