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, 2014 by Delphix. All rights reserved.
18 .\" Copyright 2016 Nexenta Systems, Inc.
19 .\" All Rights Reserved.
28 .Nd Display zpool debugging and consistency information
31 .Op Fl CmdibcsDvhLMXFPA
32 .Op Fl e Op Fl p Ar path...
35 .Op Fl I Ar inflight I/Os
42 .Op Fl e Op Fl p Ar path...
49 .Op Fl e Op Fl p Ar path...
54 .Op Fl e Op Fl p Ar path...
58 .Ar vdev Ns : Ns Ar offset Ns : Ns Ar size Ns Op Ns : Ns Ar flags
62 .Op Fl e Op Fl p Ar path...
77 utility displays information about a ZFS pool useful for debugging and
78 performs some amount of consistency checking.
79 It is a not a general purpose tool and options (and facilities) may change.
86 The output of this command in general reflects the on-disk structure of a ZFS
87 pool, and is inherently unstable.
88 The precise output of most invocations is not documented, a knowledge of ZFS
93 argument does not contain any
97 characters, it is interpreted as a pool name.
98 The root dataset can be specified as
100 (pool name followed by a slash).
102 When operating on an imported and active pool it is possible, though unlikely,
103 that zdb may interpret inconsistent pool data and behave erratically.
106 .Bl -tag -width indent
108 Display statistics regarding the number, size (logical, physical and
109 allocated) and deduplication of blocks.
111 Verify the checksum of all metadata blocks while printing block statistics
115 If specified multiple times, verify the checksums of all blocks.
117 Display information about the configuration. If specified with no other
118 options, instead display information about the cache file
119 .Po Pa /etc/zfs/zpool.cache Pc .
120 To specify the cache file to display, see
123 If specified multiple times, and a pool name is also specified display both
124 the cached configuration and the on-disk configuration.
125 If specified multiple times with
127 also display the configuration that would be used were the pool to be
130 Display information about datasets. Specified once, displays basic dataset
131 information: ID, create transaction, size, and object count.
133 If specified multiple times provides greater and greater verbosity.
135 If object IDs are specified, display information about those specific objects only.
137 Display deduplication statistics, including the deduplication ratio (dedup),
138 compression ratio (compress), inflation due to the zfs copies property
139 (copies), and an overall effective ratio (dedup * compress / copies).
141 If specified twice, display a histogram of deduplication statistics, showing
142 the allocated (physically present on disk) and referenced (logically
143 referenced in the pool) block counts and sizes by reference count.
145 If specified a third time, display the statistics independently for each deduplication table.
147 If specified a fourth time, dump the contents of the deduplication tables describing duplicate blocks.
149 If specified a fifth time, also dump the contents of the deduplication tables describing unique blocks.
151 Display pool history similar to
153 but include internal changes, transaction, and dataset information.
155 Display information about intent log (ZIL) entries relating to each
157 If specified multiple times, display counts of each intent log transaction
160 Read the vdev labels from the specified device.
161 Return 0 if a valid label was found, 1 if an error occurred, and 2 if no valid
165 option is also specified, also display the uberblocks on this device.
168 option is also specified, also display the uberblocks on this device.
170 Disable leak tracing and the loading of space maps.
173 verifies that all non-free blocks are referenced, which can be very expensive.
175 Display the offset, spacemap, and free space of each metaslab.
176 When specified twice, also display information about the on-disk free
177 space histogram associated with each metaslab. When specified three time,
178 display the maximum contiguous free space, the in-core free space histogram,
179 and the percentage of free space in each space map. When specified
180 four times display every spacemap record.
182 Display the offset, spacemap, and free space of each metaslab.
183 When specified twice, also display information about the maximum contiguous
184 free space and the percentage of free space in each space map.
185 When specified three times display every spacemap record.
188 .Ar vdev Ns : Ns Ar offset Ns : Ns Ar size Ns Op Ns : Ns Ar flags
190 Read and display a block from the specified device. By default the block is
191 displayed as a hex dump, but see the description of the
195 The block is specified in terms of a colon-separated tuple
197 (an integer vdev identifier)
199 (the offset within the vdev)
201 (the size of the block to read) and, optionally,
203 (a set of flags, described below).
204 .Bl -tag -width indent
212 Dump gang block header
216 Dump raw uninterpreted block data
222 Display operation counts, bandwidth, and error counts of I/O to the pool from
225 Simulate the effects of deduplication, constructing a DDT and then display
226 that DDT as with \fB-DD\fR.
228 Display the current uberblock.
232 .Bl -tag -width indent
234 Do not abort should any assertion fail.
236 Enable panic recovery, certain errors which would otherwise be fatal are
239 Do not abort if asserts fail and also enable panic recovery.
240 .It Fl e Op Fl p Ar path...
241 Operate on an exported pool, not present in
242 .Pa /etc/zfs/zpool.cache .
245 flag specifies the path under which devices are to be searched.
247 All blocks accessed will be copied to files in the specified directory.
248 The blocks will be placed in sparse files whose name is the same as
249 that of the file or device read. zdb can be then run on the generated files.
252 flags are sufficient to access (and thus copy)
253 all metadata on the pool.
255 Attempt to make an unreadable pool readable by trying progressively older
257 .It Fl I Ar inflight I/Os
258 Limit the number of outstanding checksum I/Os to the specified value.
259 The default value is 200. This option affects the performance of the
262 .It Fl o Ar var=value
263 Set the given global libzpool variable to the provided value. The value must be
264 an unsigned 32-bit integer. Currently only little-endian systems are supported
265 to avoid accidentally setting the high 32 bits of 64-bit variables.
267 Print numbers in an unscaled form more amenable to parsing, eg. 1000000 rather
269 .It Fl t Ar transaction
270 Specify the highest transaction to use when searching for uberblocks.
275 options for a means to see the available uberblocks and their associated
277 .It Fl U Ar cachefile
278 Use a cache file other than
279 .Pa /boot/zfs/zpool.cache .
282 Specify multiple times for increased verbosity.
286 transaction rewind, that is attempt the same recovery as
288 but read transactions otherwise deemed too old.
291 Specifying a display option more than once enables verbosity for only that
292 option, with more occurrences enabling more verbosity.
294 If no options are specified, all information about the named pool will be
295 displayed at default verbosity.
298 .It Sy Example 1 Display the configuration of imported pool 'rpool'
299 .Bd -literal -offset 2n
300 .Li # Ic zdb -C rpool
307 .It Sy Example 2 Display basic dataset information about 'rpool'
308 .Bd -literal -offset 2n
309 .Li # Ic zdb -d rpool
310 Dataset mos [META], ID 0, cr_txg 4, 26.9M, 1051 objects
311 Dataset rpool/swap [ZVOL], ID 59, cr_txg 356, 486M, 2 objects
314 .It Xo Sy Example 3 Display basic information about object 0 in
315 .Sy 'rpool/export/home'
317 .Bd -literal -offset 2n
318 .Li # Ic zdb -d rpool/export/home 0
319 Dataset rpool/export/home [ZPL], ID 137, cr_txg 1546, 32K, 8 objects
321 Object lvl iblk dblk dsize lsize %full type
322 0 7 16K 16K 15.0K 16K 25.00 DMU dnode
324 .It Xo Sy Example 4 Display the predicted effect of enabling deduplication on
327 .Bd -literal -offset 2n
328 .Li # Ic zdb -S rpool
329 Simulated DDT histogram:
331 bucket allocated referenced
332 ______ ______________________________ ______________________________
333 refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE
334 ------ ------ ----- ----- ----- ------ ----- ----- -----
335 1 694K 27.1G 15.0G 15.0G 694K 27.1G 15.0G 15.0G
336 2 35.0K 1.33G 699M 699M 74.7K 2.79G 1.45G 1.45G
338 dedup = 1.11, compress = 1.80, copies = 1.00, dedup * compress / copies = 2.00
345 This manual page is a
347 reimplementation of the
351 modified and customized for
353 and licensed under the
354 Common Development and Distribution License
359 implementation of this manual page was initially written by
360 .An Martin Matuska Aq mm@FreeBSD.org
362 .An Marcelo Araujo Aq araujo@FreeBSD.org .