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 [-CumdibcsDvhLXFPA] [-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.
145 Display pool history similar to \fBzpool history\fR, but include internal
146 changes, transaction, and dataset information.
156 Display information about intent log (ZIL) entries relating to each
157 dataset. If specified multiple times, display counts of each intent log
164 \fB-l\fR \fIdevice\fR
168 Display the vdev labels from the specified device. If the \fB-u\fR option is
169 also specified, also display the uberblocks on this device.
179 Disable leak tracing and the loading of space maps. By default, \fBzdb\fR
180 verifies that all non-free blocks are referenced, which can be very expensive.
190 Display the offset, spacemap, and free space of each metaslab.
191 When specified twice, also display information about the maximum contiguous
192 free space and the percentage of free space in each space map. When specified
193 three times display every spacemap record.
199 \fB-R\fR \fIpoolname\fR \fIvdev\fR:\fIoffset\fR:\fIsize\fR[:\fIflags\fR]
203 Read and display a block from the specified device. By default the block is
204 displayed as a hex dump, but see the description of the \'r\' flag, below.
206 The block is specified in terms of a colon-separated tuple \fIvdev\fR (an
207 integer vdev identifier) \fIoffset\fR (the offset within the vdev) \fIsize\fR
208 (the size of the block to read) and, optionally, \fIflags\fR (a set of flags,
248 Dump gang block header
268 Dump raw uninterpreted block data
279 Report statistics on \fBzdb\fR\'s I/O. Display operation counts, bandwidth,
280 and error counts of I/O to the pool from \fBzdb\fR.
290 Simulate the effects of deduplication, constructing a DDT and then display
291 that DDT as with \fB-DD\fR.
301 Display the current uberblock.
314 Do not abort should any assertion fail.
324 Enable panic recovery, certain errors which would otherwise be fatal are
335 Do not abort if asserts fail and also enable panic recovery.
341 \fB-e\fR [-p \fIpath\fR]...
345 Operate on an exported pool, not present in \fB/etc/zfs/zpool.cache\fR. The
346 \fB-p\fR flag specifies the path under which devices are to be searched.
356 Attempt to make an unreadable pool readable by trying progressively older
363 \fB-M \fIinflight I/Os\fR \fR
367 Limit the number of outstanding checksum I/Os to the specified value. The
368 default value is 200. This option affects the performance of the \fB-c\fR
379 Print numbers in an unscaled form more amenable to parsing, eg. 1000000 rather
386 \fB-t\fR \fItransaction\fR
390 Specify the highest transaction to use when searching for uberblocks. See also
391 the \fB-u\fR and \fB-l\fR options for a means to see the available uberblocks
392 and their associated transaction numbers.
398 \fB-U\fR \fIcachefile\fR
402 Use a cache file other than \fB/etc/zfs/zpool.cache\fR.
412 Enable verbosity. Specify multiple times for increased verbosity.
422 Attempt \'extreme\' transaction rewind, that is attempt the same recovery as
423 \fB-F\fR but read transactions otherwise deemed too old.
427 Specifying a display option more than once enables verbosity for only that
428 option, with more occurrences enabling more verbosity.
430 If no options are specified, all information about the named pool will be
431 displayed at default verbosity.
435 \fBExample 1 \fRDisplay the configuration of imported pool 'rpool'
450 \fBExample 2 \fRDisplay basic dataset information about 'rpool'
455 Dataset mos [META], ID 0, cr_txg 4, 26.9M, 1051 objects
456 Dataset rpool/swap [ZVOL], ID 59, cr_txg 356, 486M, 2 objects
463 \fBExample 3 \fRDisplay basic information about object 0
464 in 'rpool/export/home'
468 # zdb -d rpool/export/home 0
469 Dataset rpool/export/home [ZPL], ID 137, cr_txg 1546, 32K, 8 objects
471 Object lvl iblk dblk dsize lsize %full type
472 0 7 16K 16K 15.0K 16K 25.00 DMU dnode
478 \fBExample 4 \fRDisplay the predicted effect of enabling deduplication on 'rpool'
483 Simulated DDT histogram:
485 bucket allocated referenced
486 ______ ______________________________ ______________________________
487 refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE
488 ------ ------ ----- ----- ----- ------ ----- ----- -----
489 1 694K 27.1G 15.0G 15.0G 694K 27.1G 15.0G 15.0G
490 2 35.0K 1.33G 699M 699M 74.7K 2.79G 1.45G 1.45G
492 dedup = 1.11, compress = 1.80, copies = 1.00, dedup * compress / copies = 2.00