2 .\" This file and its contents are supplied under the terms of the
3 .\" Common Development and Distribution License ("CDDL"), version 1.0.
4 .\" You may only use this file in accordance with the terms of version
7 .\" A full copy of the text of the CDDL should have accompanied this
8 .\" source. A copy of the CDDL is also available via the Internet at
9 .\" http://www.illumos.org/license/CDDL.
12 .\" Copyright 2012, Richard Lowe.
13 .\" Copyright (c) 2012, 2019 by Delphix. All rights reserved.
14 .\" Copyright 2017 Nexenta Systems, Inc.
15 .\" Copyright (c) 2017 Lawrence Livermore National Security, LLC.
16 .\" Copyright (c) 2017 Intel Corporation.
23 .Nd display zpool debugging and consistency information
26 .Op Fl AbcdDFGhikLMPsvXYy
27 .Op Fl e Oo Fl V Oc Op Fl p Ar path ...
28 .Op Fl I Ar inflight I/Os
29 .Oo Fl o Ar var Ns = Ns Ar value Oc Ns ...
33 .Op Ar poolname[/dataset | objset ID]
34 .Op Ar object | range ...
37 .Op Fl e Oo Fl V Oc Op Fl p Ar path ...
39 .Ar poolname[/dataset | objset ID] Op Ar object | range ...
47 .Ar word0 Ns \&: Ns Ar word1 Ns :...: Ns Ar word15
55 .Op Fl e Oo Fl V Oc Op Fl p Ar path ...
58 .Ar poolname Op Ar vdev Op Ar metaslab ...
65 .Op Fl e Oo Fl V Oc Op Fl p Ar path ...
67 .Ar poolname vdev Ns \&: Ns Ar offset Ns \&: Ns Ar [<lsize>/]<psize> Ns Op : Ns Ar flags
71 .Op Fl e Oo Fl V Oc Op Fl p Ar path ...
77 utility displays information about a ZFS pool useful for debugging and performs
78 some amount of consistency checking.
79 It is a not a general purpose tool and options
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 .Pq 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.
108 Display statistics regarding the number, size
109 .Pq logical, physical and allocated
110 and deduplication of blocks.
112 Verify the checksum of all metadata blocks while printing block statistics
117 If specified multiple times, verify the checksums of all blocks.
119 Display information about the configuration.
120 If specified with no other options, instead display information about the cache
122 .Pq Pa /etc/zfs/zpool.cache .
123 To specify the cache file to display, see
126 If specified multiple times, and a pool name is also specified display both the
127 cached configuration and the on-disk configuration.
128 If specified multiple times with
130 also display the configuration that would be used were the pool to be imported.
132 Display information about datasets.
133 Specified once, displays basic dataset information: ID, create transaction,
134 size, and object count.
136 If specified multiple times provides greater and greater verbosity.
138 If object IDs or object ID ranges are specified, display information about
139 those specific objects or ranges only.
141 An object ID range is specified in terms of a colon-separated tuple of
143 .Ao start Ac Ns : Ns Ao end Ac Ns Op Ns : Ns Ao flags Ac Ns .
148 are integer object identifiers that denote the upper and lower bounds
151 value of -1 specifies a range with no upper bound. The
153 field optionally specifies a set of flags, described below, that control
154 which object types are dumped. By default, all object types are dumped. A minus
157 negates the effect of the flag that follows it and has no effect unless
160 flag. For example, the range 0:-1:A-d will dump all object types except
165 Dump all objects (this is the default)
167 Dump ZFS directory objects
169 Dump ZFS plain file objects
171 Dump SPA space map objects
175 Negate the effect of next flag
178 Display deduplication statistics, including the deduplication ratio
182 inflation due to the zfs copies property
184 and an overall effective ratio
185 .Pq Sy dedup No * Sy compress No / Sy copies .
187 Display a histogram of deduplication statistics, showing the allocated
188 .Pq physically present on disk
190 .Pq logically referenced in the pool
191 block counts and sizes by reference count.
193 Display the statistics independently for each deduplication table.
195 Dump the contents of the deduplication tables describing duplicate blocks.
197 Also dump the contents of the deduplication tables describing unique blocks.
198 .It Fl E Ar word0 Ns \&: Ns Ar word1 Ns :...: Ns Ar word15
199 Decode and display block from an embedded block pointer specified by the
203 Display pool history similar to
204 .Nm zpool Cm history ,
205 but include internal changes, transaction, and dataset information.
207 Display information about intent log
209 entries relating to each dataset.
210 If specified multiple times, display counts of each intent log transaction type.
212 Examine the checkpointed state of the pool.
213 Note, the on disk format of the pool is not reverted to the checkpointed state.
215 Read the vdev labels and L2ARC header from the specified device.
217 will return 0 if valid label was found, 1 if error occurred, and 2 if no valid
218 labels were found. The presence of L2ARC header is indicated by a specific
219 sequence (L2ARC_DEV_HDR_MAGIC). If there is an accounting error in the size
220 or the number of L2ARC log blocks
222 will return 1. Each unique configuration is displayed only
225 In addition display label space usage stats. If a valid L2ARC header was found
226 also display the properties of log blocks used for restoring L2ARC contents
229 Display every configuration, unique or not. If a valid L2ARC header was found
230 also display the properties of log entries in log blocks used for restoring
231 L2ARC contents (persistent L2ARC).
235 option is also specified, don't print the labels or the L2ARC header.
239 option is also specified, also display the uberblocks on this device. Specify
240 multiple times to increase verbosity.
242 Disable leak detection and the loading of space maps.
245 verifies that all non-free blocks are referenced, which can be very expensive.
247 Display the offset, spacemap, free space of each metaslab, all the log
248 spacemaps and their obsolete entry statistics.
250 Also display information about the on-disk free space histogram associated with
253 Display the maximum contiguous free space, the in-core free space histogram, and
254 the percentage of free space in each space map.
256 Display every spacemap record.
258 Display the offset, spacemap, and free space of each metaslab.
260 Also display information about the maximum contiguous free space and the
261 percentage of free space in each space map.
263 Display every spacemap record.
264 .It Fl O Ar dataset path
265 Look up the specified
269 and display its metadata and indirect blocks.
272 must be relative to the root of
274 This option can be combined with
276 for increasing verbosity.
278 .Fl R Ar poolname vdev Ns \&: Ns Ar offset Ns \&: Ns Ar [<lsize>/]<psize> Ns Op : Ns Ar flags
280 Read and display a block from the specified device.
281 By default the block is displayed as a hex dump, but see the description of the
285 The block is specified in terms of a colon-separated tuple
287 .Pq an integer vdev identifier
289 .Pq the offset within the vdev
291 .Pq the physical size, or logical size / physical size
292 of the block to read and, optionally,
294 .Pq a set of flags, described below .
296 .Bl -tag -compact -width "b offset"
298 Print block pointer at hex offset
300 Calculate and display checksums
302 Decompress the block. Set environment variable
304 to skip zle when guessing.
308 Dump gang block header
312 Dump raw uninterpreted block data
314 Verbose output for guessing compression algorithm
320 Display operation counts, bandwidth, and error counts of I/O to the pool from
323 Simulate the effects of deduplication, constructing a DDT and then display
327 Display the current uberblock.
333 Do not abort should any assertion fail.
335 Enable panic recovery, certain errors which would otherwise be fatal are
338 Do not abort if asserts fail and also enable panic recovery.
339 .It Fl e Op Fl p Ar path ...
340 Operate on an exported pool, not present in
341 .Pa /etc/zfs/zpool.cache .
344 flag specifies the path under which devices are to be searched.
346 All blocks accessed will be copied to files in the specified directory.
347 The blocks will be placed in sparse files whose name is the same as
348 that of the file or device read.
350 can be then run on the generated files.
353 flags are sufficient to access
355 all metadata on the pool.
357 Attempt to make an unreadable pool readable by trying progressively older
360 Dump the contents of the zfs_dbgmsg buffer before exiting
362 zfs_dbgmsg is a buffer used by ZFS to dump advanced debug information.
363 .It Fl I Ar inflight I/Os
364 Limit the number of outstanding checksum I/Os to the specified value.
365 The default value is 200.
366 This option affects the performance of the
369 .It Fl o Ar var Ns = Ns Ar value ...
370 Set the given global libzpool variable to the provided value.
371 The value must be an unsigned 32-bit integer.
372 Currently only little-endian systems are supported to avoid accidentally setting
373 the high 32 bits of 64-bit variables.
375 Print numbers in an unscaled form more amenable to parsing, eg. 1000000 rather
377 .It Fl t Ar transaction
378 Specify the highest transaction to use when searching for uberblocks.
383 options for a means to see the available uberblocks and their associated
385 .It Fl U Ar cachefile
386 Use a cache file other than
387 .Pa /etc/zfs/zpool.cache .
390 Specify multiple times for increased verbosity.
392 Attempt verbatim import.
393 This mimics the behavior of the kernel when loading a pool from a cachefile.
399 transaction rewind, that is attempt the same recovery as
401 but read transactions otherwise deemed too old.
403 Attempt all possible combinations when reconstructing indirect split blocks.
404 This flag disables the individual I/O deadman timer in order to allow as
405 much time as required for the attempted reconstruction.
407 Perform validation for livelists that are being deleted.
408 Scans through the livelist and metaslabs, checking for duplicate entries
409 and compares the two, checking for potential double frees.
410 If it encounters issues, warnings will be printed, but the command will not
414 Specifying a display option more than once enables verbosity for only that
415 option, with more occurrences enabling more verbosity.
417 If no options are specified, all information about the named pool will be
418 displayed at default verbosity.
423 Display the configuration of imported pool
436 Display basic dataset information about
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
447 Display basic information about object 0 in
448 .Pa rpool/export/home
451 # zdb -d rpool/export/home 0
452 Dataset rpool/export/home [ZPL], ID 137, cr_txg 1546, 32K, 8 objects
454 Object lvl iblk dblk dsize lsize %full type
455 0 7 16K 16K 15.0K 16K 25.00 DMU dnode
459 Display the predicted effect of enabling deduplication on
464 Simulated DDT histogram:
466 bucket allocated referenced
467 ______ ______________________________ ______________________________
468 refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE
469 ------ ------ ----- ----- ----- ------ ----- ----- -----
470 1 694K 27.1G 15.0G 15.0G 694K 27.1G 15.0G 15.0G
471 2 35.0K 1.33G 699M 699M 74.7K 2.79G 1.45G 1.45G
473 dedup = 1.11, compress = 1.80, copies = 1.00, dedup * compress / copies = 2.00