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.
15 .TH "ZDB" "8" "February 15, 2012" "" ""
18 \fBzdb\fR - Display zpool debugging and consistency information
21 \fBzdb\fR [-CumdibcsDvhLXFPA] [-e [-p \fIpath\fR...]] [-t \fItxg\fR]
22 \fIpoolname\fR [\fIobject\fR ...]
25 \fBzdb\fR [-divPA] [-e [-p \fIpath\fR...]] \fIdataset\fR [\fIobject\fR ...]
28 \fBzdb\fR -m [-LXFPA] [-t \fItxg\fR] [-e [-p \fIpath\fR...]] \fIpoolname\fR
29 [\fIvdev\fR [\fImetaslab\fR ...]]
32 \fBzdb\fR -R [-A] [-e [-p \fIpath\fR...]] \fIpoolname\fR
33 \fIvdev\fR:\fIoffset\fR:\fIsize\fR[:\fIflags\fR]
36 \fBzdb\fR -S [-AP] [-e [-p \fIpath\fR...]] \fIpoolname\fR
39 \fBzdb\fR -l [-uA] \fIdevice\fR
42 \fBzdb\fR -C [-A] [-U \fIcache\fR]
45 The \fBzdb\fR utility displays information about a ZFS pool useful for
46 debugging and performs some amount of consistency checking. It is a not a
47 general purpose tool and options (and facilities) may change. This is neither
48 a fsck(8) nor an fsdb(8) utility.
51 The output of this command in general reflects the on-disk structure of a ZFS
52 pool, and is inherently unstable. The precise output of most invocations is
53 not documented, a knowledge of ZFS internals is assumed.
56 When operating on an imported and active pool it is possible, though unlikely,
57 that zdb may interpret inconsistent pool data and behave erratically.
69 Display statistics regarding the number, size (logical, physical and
70 allocated) and deduplication of blocks.
80 Verify the checksum of all metadata blocks while printing block statistics
83 If specified multiple times, verify the checksums of all blocks.
93 Display information about the configuration. If specified with no other
94 options, instead display information about the cache file
95 (\fB/etc/zfs/zpool.cache\fR). To specify the cache file to display, see
98 If specified multiple times, and a pool name is also specified display both
99 the cached configuration and the on-disk configuration. If specified multiple
100 times with \fB-e\fR also display the configuration that would be used were the
111 Display information about datasets. Specified once, displays basic dataset
112 information: ID, create transaction, size, and object count.
114 If specified multiple times provides greater and greater verbosity.
116 If object IDs are specified, display information about those specific objects only.
126 Display deduplication statistics, including the deduplication ratio (dedup),
127 compression ratio (compress), inflation due to the zfs copies property
128 (copies), and an overall effective ratio (dedup * compress / copies).
130 If specified twice, display a histogram of deduplication statistics, showing
131 the allocated (physically present on disk) and referenced (logically
132 referenced in the pool) block counts and sizes by reference count.
142 Display pool history similar to \fBzpool history\fR, but include internal
143 changes, transaction, and dataset information.
153 Display information about intent log (ZIL) entries relating to each
154 dataset. If specified multiple times, display counts of each intent log
161 \fB-l\fR \fIdevice\fR
165 Display the vdev labels from the specified device. If the \fB-u\fR option is
166 also specified, also display the uberblocks on this device.
176 Disable leak tracing and the loading of space maps. By default, \fBzdb\fR
177 verifies that all non-free blocks are referenced, which can be very expensive.
187 Display the offset, spacemap, and free space of each metaslab.
188 When specified twice, also display information about the maximum contiguous
189 free space and the percentage of free space in each space map. When specified
190 three times display every spacemap record.
196 \fB-R\fR \fIpoolname\fR \fIvdev\fR:\fIoffset\fR:\fIsize\fR[:\fIflags\fR]
200 Read and display a block from the specified device. By default the block is
201 displayed as a hex dump, but see the description of the \'r\' flag, below.
203 The block is specified in terms of a colon-separated tuple \fIvdev\fR (an
204 integer vdev identifier) \fIoffset\fR (the offset within the vdev) \fIsize\fR
205 (the size of the block to read) and, optionally, \fIflags\fR (a set of flags,
245 Dump gang block header
265 Dump raw uninterpreted block data
276 Report statistics on \fBzdb\fR\'s I/O. Display operation counts, bandwidth,
277 and error counts of I/O to the pool from \fBzdb\fR.
287 Simulate the effects of deduplication, constructing a DDT and then display
288 that DDT as with \fB-DD\fR.
298 Display the current uberblock.
311 Do not abort should any assertion fail.
321 Enable panic recovery, certain errors which would otherwise be fatal are
332 Do not abort if asserts fail and also enable panic recovery.
338 \fB-e\fR [-p \fIpath\fR]...
342 Operate on an exported pool, not present in \fB/etc/zfs/zpool.cache\fR. The
343 \fB-p\fR flag specifies the path under which devices are to be searched.
353 Attempt to make an unreadable pool readable by trying progressively older
364 Print numbers in an unscaled form more amenable to parsing, eg. 1000000 rather
371 \fB-t\fR \fItransaction\fR
375 Specify the highest transaction to use when searching for uberblocks. See also
376 the \fB-u\fR and \fB-l\fR options for a means to see the available uberblocks
377 and their associated transaction numbers.
383 \fB-U\fR \fIcachefile\fR
387 Use a cache file other than \fB/etc/zfs/zpool.cache\fR. This option is only
398 Enable verbosity. Specify multiple times for increased verbosity.
408 Attempt \'extreme\' transaction rewind, that is attempt the same recovery as
409 \fB-F\fR but read transactions otherwise deemed too old.
413 Specifying a display option more than once enables verbosity for only that
414 option, with more occurrences enabling more verbosity.
416 If no options are specified, all information about the named pool will be
417 displayed at default verbosity.
421 \fBExample 1 \fRDisplay the configuration of imported pool 'rpool'
436 \fBExample 2 \fRDisplay basic dataset information about 'rpool'
441 Dataset mos [META], ID 0, cr_txg 4, 26.9M, 1051 objects
442 Dataset rpool/swap [ZVOL], ID 59, cr_txg 356, 486M, 2 objects
449 \fBExample 3 \fRDisplay basic information about object 0
450 in 'rpool/export/home'
454 # zdb -d rpool/export/home 0
455 Dataset rpool/export/home [ZPL], ID 137, cr_txg 1546, 32K, 8 objects
457 Object lvl iblk dblk dsize lsize %full type
458 0 7 16K 16K 15.0K 16K 25.00 DMU dnode
464 \fBExample 4 \fRDisplay the predicted effect of enabling deduplication on 'rpool'
469 Simulated DDT histogram:
471 bucket allocated referenced
472 ______ ______________________________ ______________________________
473 refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE
474 ------ ------ ----- ----- ----- ------ ----- ----- -----
475 1 694K 27.1G 15.0G 15.0G 694K 27.1G 15.0G 15.0G
476 2 35.0K 1.33G 699M 699M 74.7K 2.79G 1.45G 1.45G
478 dedup = 1.11, compress = 1.80, copies = 1.00, dedup * compress / copies = 2.00