2 .\" Copyright (c) 2012, Martin Matuska <mm@FreeBSD.org>.
3 .\" All Rights Reserved.
5 .\" This file and its contents are supplied under the terms of the
6 .\" Common Development and Distribution License ("CDDL"), version 1.0.
7 .\" You may only use this file in accordance with the terms of version
10 .\" A full copy of the text of the CDDL should have accompanied this
11 .\" source. A copy of the CDDL is also available via the Internet at
12 .\" http://www.illumos.org/license/CDDL.
15 .\" Copyright 2012, Richard Lowe.
16 .\" Copyright (c) 2012, Marcelo Araujo <araujo@FreeBSD.org>.
17 .\" Copyright (c) 2012 by Delphix. All rights reserved.
18 .\" All Rights Reserved.
27 .Nd Display zpool debugging and consistency information
30 .Op Fl CumdibcsDvhLXFPA
31 .Op Fl e Op Fl p Ar path...
34 .Op Fl M Ar inflight I/Os
39 .Op Fl e Op Fl p Ar path...
46 .Op Fl e Op Fl p Ar path...
51 .Op Fl e Op Fl p Ar path...
55 .Ar vdev Ns : Ns Ar offset Ns : Ns Ar size Ns Op Ns : Ns Ar flags
59 .Op Fl e Op Fl p Ar path...
74 utility displays information about a ZFS pool useful for debugging and
75 performs some amount of consistency checking.
76 It is a not a general purpose tool and options (and facilities) may change.
83 The output of this command in general reflects the on-disk structure of a ZFS
84 pool, and is inherently unstable.
85 The precise output of most invocations is not documented, a knowledge of ZFS
90 argument does not contain any
94 characters, it is interpreted as a pool name.
95 The root dataset can be specified as
97 (pool name followed by a slash).
99 When operating on an imported and active pool it is possible, though unlikely,
100 that zdb may interpret inconsistent pool data and behave erratically.
103 .Bl -tag -width indent
105 Display statistics regarding the number, size (logical, physical and
106 allocated) and deduplication of blocks.
108 Verify the checksum of all metadata blocks while printing block statistics
112 If specified multiple times, verify the checksums of all blocks.
114 Display information about the configuration. If specified with no other
115 options, instead display information about the cache file
116 .Po Pa /etc/zfs/zpool.cache Pc .
117 To specify the cache file to display, see
120 If specified multiple times, and a pool name is also specified display both
121 the cached configuration and the on-disk configuration.
122 If specified multiple times with
124 also display the configuration that would be used were the pool to be
127 Display information about datasets. Specified once, displays basic dataset
128 information: ID, create transaction, size, and object count.
130 If specified multiple times provides greater and greater verbosity.
132 If object IDs are specified, display information about those specific objects only.
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).
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.
142 If specified a third time, display the statistics independently for each deduplication table.
144 If specified a fourth time, dump the contents of the deduplication tables describing duplicate blocks.
146 If specified a fifth time, also dump the contents of the deduplication tables describing unique blocks.
148 Display pool history similar to
150 but include internal changes, transaction, and dataset information.
152 Display information about intent log (ZIL) entries relating to each
154 If specified multiple times, display counts of each intent log transaction
157 Display the vdev labels from the specified device.
160 option is also specified, also display the uberblocks on this device.
162 Disable leak tracing and the loading of space maps.
165 verifies that all non-free blocks are referenced, which can be very expensive.
167 Display the offset, spacemap, and free space of each metaslab.
168 When specified twice, also display information about the maximum contiguous
169 free space and the percentage of free space in each space map.
170 When specified three times display every spacemap record.
173 .Ar vdev Ns : Ns Ar offset Ns : Ns Ar size Ns Op Ns : Ns Ar flags
175 Read and display a block from the specified device. By default the block is
176 displayed as a hex dump, but see the description of the
180 The block is specified in terms of a colon-separated tuple
182 (an integer vdev identifier)
184 (the offset within the vdev)
186 (the size of the block to read) and, optionally,
188 (a set of flags, described below).
189 .Bl -tag -width indent
197 Dump gang block header
201 Dump raw uninterpreted block data
207 Display operation counts, bandwidth, and error counts of I/O to the pool from
210 Simulate the effects of deduplication, constructing a DDT and then display
211 that DDT as with \fB-DD\fR.
213 Display the current uberblock.
217 .Bl -tag -width indent
219 Do not abort should any assertion fail.
221 Enable panic recovery, certain errors which would otherwise be fatal are
224 Do not abort if asserts fail and also enable panic recovery.
225 .It Fl e Op Fl p Ar path...
226 Operate on an exported pool, not present in
227 .Pa /etc/zfs/zpool.cache .
230 flag specifies the path under which devices are to be searched.
232 Attempt to make an unreadable pool readable by trying progressively older
234 .It Fl M Ar inflight I/Os
235 Limit the number of outstanding checksum I/Os to the specified value.
236 The default value is 200. This option affects the performance of the
240 Print numbers in an unscaled form more amenable to parsing, eg. 1000000 rather
242 .It Fl t Ar transaction
243 Specify the highest transaction to use when searching for uberblocks.
248 options for a means to see the available uberblocks and their associated
250 .It Fl U Ar cachefile
251 Use a cache file other than
252 .Pa /boot/zfs/zpool.cache .
255 Specify multiple times for increased verbosity.
259 transaction rewind, that is attempt the same recovery as
261 but read transactions otherwise deemed too old.
264 Specifying a display option more than once enables verbosity for only that
265 option, with more occurrences enabling more verbosity.
267 If no options are specified, all information about the named pool will be
268 displayed at default verbosity.
271 .It Sy Example 1 Display the configuration of imported pool 'rpool'
272 .Bd -literal -offset 2n
273 .Li # Ic zdb -C rpool
280 .It Sy Example 2 Display basic dataset information about 'rpool'
281 .Bd -literal -offset 2n
282 .Li # Ic zdb -d rpool
283 Dataset mos [META], ID 0, cr_txg 4, 26.9M, 1051 objects
284 Dataset rpool/swap [ZVOL], ID 59, cr_txg 356, 486M, 2 objects
287 .It Xo Sy Example 3 Display basic information about object 0 in
288 .Sy 'rpool/export/home'
290 .Bd -literal -offset 2n
291 .Li # Ic zdb -d rpool/export/home 0
292 Dataset rpool/export/home [ZPL], ID 137, cr_txg 1546, 32K, 8 objects
294 Object lvl iblk dblk dsize lsize %full type
295 0 7 16K 16K 15.0K 16K 25.00 DMU dnode
297 .It Xo Sy Example 4 Display the predicted effect of enabling deduplication on
300 .Bd -literal -offset 2n
301 .Li # Ic zdb -S rpool
302 Simulated DDT histogram:
304 bucket allocated referenced
305 ______ ______________________________ ______________________________
306 refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE
307 ------ ------ ----- ----- ----- ------ ----- ----- -----
308 1 694K 27.1G 15.0G 15.0G 694K 27.1G 15.0G 15.0G
309 2 35.0K 1.33G 699M 699M 74.7K 2.79G 1.45G 1.45G
311 dedup = 1.11, compress = 1.80, copies = 1.00, dedup * compress / copies = 2.00
318 This manual page is a
320 reimplementation of the
324 modified and customized for
326 and licensed under the
327 Common Development and Distribution License
332 implementation of this manual page was initially written by
333 .An Martin Matuska Aq mm@FreeBSD.org
335 .An Marcelo Araujo Aq araujo@FreeBSD.org .