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.
11 .\" Copyright 2012, Richard Lowe.
12 .\" Copyright (c) 2012, 2019 by Delphix. All rights reserved.
13 .\" Copyright 2017 Nexenta Systems, Inc.
14 .\" Copyright (c) 2017 Lawrence Livermore National Security, LLC.
15 .\" Copyright (c) 2017 Intel Corporation.
23 .Nd display ZFS storage pool debugging and consistency information
26 .Op Fl AbcdDFGhikLMNPsvXYy
27 .Op Fl e Oo Fl V Oc Oo Fl p Ar path Oc Ns …
28 .Op Fl I Ar inflight-I/O-ops
29 .Oo Fl o Ar var Ns = Ns Ar value Oc Ns …
33 .Op Ar poolname Ns Op / Ns Ar dataset Ns | Ns Ar objset-ID
34 .Op Ar object Ns | Ns Ar range Ns …
37 .Op Fl e Oo Fl V Oc Oo Fl p Ar path Oc Ns …
39 .Ar poolname Ns Op Ar / Ns Ar dataset Ns | Ns Ar objset-ID
40 .Op Ar object Ns | Ns Ar range Ns …
48 .Ar word0 : Ns Ar word1 Ns :…: Ns Ar word15
56 .Op Fl e Oo Fl V Oc Oo Fl p Ar path Oc Ns …
59 .Ar poolname Op Ar vdev Oo Ar metaslab Oc Ns …
65 .Ar dataset path destination
69 .Op Fl e Oo Fl V Oc Oo Fl p Ar path Oc Ns …
71 .Ar poolname vdev : Ns Ar offset : Ns Oo Ar lsize Ns / Oc Ns Ar psize Ns Op : Ns Ar flags
75 .Op Fl e Oo Fl V Oc Oo Fl p Ar path Oc Ns …
82 utility displays information about a ZFS pool useful for debugging and performs
83 some amount of consistency checking.
84 It is a not a general purpose tool and options
91 The output of this command in general reflects the on-disk structure of a ZFS
92 pool, and is inherently unstable.
93 The precise output of most invocations is not documented, a knowledge of ZFS
98 argument does not contain any
102 characters, it is interpreted as a pool name.
103 The root dataset can be specified as
106 When operating on an imported and active pool it is possible, though unlikely,
107 that zdb may interpret inconsistent pool data and behave erratically.
112 .It Fl b , -block-stats
113 Display statistics regarding the number, size
114 .Pq logical, physical and allocated
115 and deduplication of blocks.
117 Verify the checksum of all metadata blocks while printing block statistics
122 If specified multiple times, verify the checksums of all blocks.
124 Display information about the configuration.
125 If specified with no other options, instead display information about the cache
127 .Pq Pa /etc/zfs/zpool.cache .
128 To specify the cache file to display, see
131 If specified multiple times, and a pool name is also specified display both the
132 cached configuration and the on-disk configuration.
133 If specified multiple times with
135 also display the configuration that would be used were the pool to be imported.
137 Display information about datasets.
138 Specified once, displays basic dataset information: ID, create transaction,
139 size, and object count.
143 .Ar poolname Ns Op / Ns Ar dataset Ns | Ns Ar objset-ID
144 is to use the specified
145 .Ar dataset Ns | Ns Ar objset-ID
146 as a string (dataset name) or a number (objset ID) when
147 datasets have numeric names.
149 If specified multiple times provides greater and greater verbosity.
151 If object IDs or object ID ranges are specified, display information about
152 those specific objects or ranges only.
154 An object ID range is specified in terms of a colon-separated tuple of
156 .Ao start Ac : Ns Ao end Ac Ns Op : Ns Ao flags Ac .
161 are integer object identifiers that denote the upper and lower bounds
165 value of -1 specifies a range with no upper bound.
168 field optionally specifies a set of flags, described below, that control
169 which object types are dumped.
170 By default, all object types are dumped.
173 negates the effect of the flag that follows it and has no effect unless
177 For example, the range 0:-1:A-d will dump all object types except for directories.
179 .Bl -tag -compact -width Ds
181 Dump all objects (this is the default)
183 Dump ZFS directory objects
185 Dump ZFS plain file objects
187 Dump SPA space map objects
191 Negate the effect of next flag
193 .It Fl D , -dedup-stats
194 Display deduplication statistics, including the deduplication ratio
198 inflation due to the zfs copies property
200 and an overall effective ratio
201 .Pq Sy dedup No \(mu Sy compress No / Sy copies .
203 Display a histogram of deduplication statistics, showing the allocated
204 .Pq physically present on disk
206 .Pq logically referenced in the pool
207 block counts and sizes by reference count.
209 Display the statistics independently for each deduplication table.
211 Dump the contents of the deduplication tables describing duplicate blocks.
213 Also dump the contents of the deduplication tables describing unique blocks.
214 .It Fl E , -embedded-block-pointer Ns = Ns Ar word0 : Ns Ar word1 Ns :…: Ns Ar word15
215 Decode and display block from an embedded block pointer specified by the
219 Display pool history similar to
220 .Nm zpool Cm history ,
221 but include internal changes, transaction, and dataset information.
222 .It Fl i , -intent-logs
223 Display information about intent log
225 entries relating to each dataset.
226 If specified multiple times, display counts of each intent log transaction type.
227 .It Fl k , -checkpointed-state
228 Examine the checkpointed state of the pool.
229 Note, the on disk format of the pool is not reverted to the checkpointed state.
230 .It Fl l , -label Ns = Ns Ar device
231 Read the vdev labels and L2ARC header from the specified device.
233 will return 0 if valid label was found, 1 if error occurred, and 2 if no valid
235 The presence of L2ARC header is indicated by a specific
236 sequence (L2ARC_DEV_HDR_MAGIC).
237 If there is an accounting error in the size or the number of L2ARC log blocks
240 Each unique configuration is displayed only once.
242 In addition display label space usage stats.
243 If a valid L2ARC header was found
244 also display the properties of log blocks used for restoring L2ARC contents
247 Display every configuration, unique or not.
248 If a valid L2ARC header was found
249 also display the properties of log entries in log blocks used for restoring
250 L2ARC contents (persistent L2ARC).
254 option is also specified, don't print the labels or the L2ARC header.
258 option is also specified, also display the uberblocks on this device.
259 Specify multiple times to increase verbosity.
260 .It Fl L , -disable-leak-tracking
261 Disable leak detection and the loading of space maps.
264 verifies that all non-free blocks are referenced, which can be very expensive.
265 .It Fl m , -metaslabs
266 Display the offset, spacemap, free space of each metaslab, all the log
267 spacemaps and their obsolete entry statistics.
269 Also display information about the on-disk free space histogram associated with
272 Display the maximum contiguous free space, the in-core free space histogram, and
273 the percentage of free space in each space map.
275 Display every spacemap record.
276 .It Fl M , -metaslab-groups
277 Display all "normal" vdev metaslab group information - per-vdev metaslab count, fragmentation,
278 and free space histogram, as well as overall pool fragmentation and histogram.
280 "Special" vdevs are added to -M's normal output.
281 .It Fl O , -object-lookups Ns = Ns Ar dataset path
282 Also display information about the maximum contiguous free space and the
283 percentage of free space in each space map.
285 Display every spacemap record.
289 but force zdb to interpret the
290 .Op Ar dataset Ns | Ns Ar objset-ID
292 .Op Ar poolname Ns Op / Ns Ar dataset Ns | Ns Ar objset-ID
293 as a numeric objset ID.
294 .It Fl O Ar dataset path
295 Look up the specified
299 and display its metadata and indirect blocks.
302 must be relative to the root of
304 This option can be combined with
306 for increasing verbosity.
307 .It Fl r , -copy-object Ns = Ns Ar dataset path destination
312 to the specified destination.
315 must be relative to the root of
317 This option can be combined with
319 for increasing verbosity.
321 .Fl R , -read-block Ns = Ns Ar poolname vdev : Ns Ar offset : Ns Oo Ar lsize Ns / Oc Ns Ar psize Ns Op : Ns Ar flags
323 Read and display a block from the specified device.
324 By default the block is displayed as a hex dump, but see the description of the
328 The block is specified in terms of a colon-separated tuple
330 .Pq an integer vdev identifier
332 .Pq the offset within the vdev
334 .Pq the physical size, or logical size / physical size
335 of the block to read and, optionally,
337 .Pq a set of flags, described below .
339 .Bl -tag -compact -width "b offset"
341 Print block pointer at hex offset
343 Calculate and display checksums
345 Decompress the block.
346 Set environment variable
348 to skip zle when guessing.
352 Dump gang block header
356 Dump raw uninterpreted block data
358 Verbose output for guessing compression algorithm
364 Display operation counts, bandwidth, and error counts of I/O to the pool from
366 .It Fl S , -simulate-dedup
367 Simulate the effects of deduplication, constructing a DDT and then display
370 .It Fl u , -uberblock
371 Display the current uberblock.
376 .It Fl A , -ignore-assertions
377 Do not abort should any assertion fail.
379 Enable panic recovery, certain errors which would otherwise be fatal are
382 Do not abort if asserts fail and also enable panic recovery.
383 .It Fl e , -exported Ns = Ns Oo Fl p Ar path Oc Ns …
384 Operate on an exported pool, not present in
385 .Pa /etc/zfs/zpool.cache .
388 flag specifies the path under which devices are to be searched.
389 .It Fl x , -dump-blocks Ns = Ns Ar dumpdir
390 All blocks accessed will be copied to files in the specified directory.
391 The blocks will be placed in sparse files whose name is the same as
392 that of the file or device read.
394 can be then run on the generated files.
397 flags are sufficient to access
399 all metadata on the pool.
400 .It Fl F , -automatic-rewind
401 Attempt to make an unreadable pool readable by trying progressively older
403 .It Fl G , -dump-debug-msg
404 Dump the contents of the zfs_dbgmsg buffer before exiting
406 zfs_dbgmsg is a buffer used by ZFS to dump advanced debug information.
407 .It Fl I , -inflight Ns = Ns Ar inflight-I/O-ops
408 Limit the number of outstanding checksum I/O operations to the specified value.
409 The default value is 200.
410 This option affects the performance of the
413 .It Fl o , -option Ns = Ns Ar var Ns = Ns Ar value Ns …
414 Set the given global libzpool variable to the provided value.
415 The value must be an unsigned 32-bit integer.
416 Currently only little-endian systems are supported to avoid accidentally setting
417 the high 32 bits of 64-bit variables.
418 .It Fl P , -parseable
419 Print numbers in an unscaled form more amenable to parsing, e.g.\&
423 .It Fl t , -txg Ns = Ns Ar transaction
424 Specify the highest transaction to use when searching for uberblocks.
429 options for a means to see the available uberblocks and their associated
431 .It Fl U , -cachefile Ns = Ns Ar cachefile
432 Use a cache file other than
433 .Pa /etc/zfs/zpool.cache .
436 Specify multiple times for increased verbosity.
438 Attempt verbatim import.
439 This mimics the behavior of the kernel when loading a pool from a cachefile.
442 .It Fl X , -extreme-rewind
445 transaction rewind, that is attempt the same recovery as
447 but read transactions otherwise deemed too old.
448 .It Fl Y , -all-reconstruction
449 Attempt all possible combinations when reconstructing indirect split blocks.
450 This flag disables the individual I/O deadman timer in order to allow as
451 much time as required for the attempted reconstruction.
453 Perform validation for livelists that are being deleted.
454 Scans through the livelist and metaslabs, checking for duplicate entries
455 and compares the two, checking for potential double frees.
456 If it encounters issues, warnings will be printed, but the command will not
460 Specifying a display option more than once enables verbosity for only that
461 option, with more occurrences enabling more verbosity.
463 If no options are specified, all information about the named pool will be
464 displayed at default verbosity.
467 .Ss Example 1 : No Display the configuration of imported pool Ar rpool
469 .No # Nm zdb Fl C Ar rpool
476 .Ss Example 2 : No Display basic dataset information about Ar rpool
478 .No # Nm zdb Fl d Ar rpool
479 Dataset mos [META], ID 0, cr_txg 4, 26.9M, 1051 objects
480 Dataset rpool/swap [ZVOL], ID 59, cr_txg 356, 486M, 2 objects
484 .Ss Example 3 : No Display basic information about object 0 in Ar rpool/export/home
486 .No # Nm zdb Fl d Ar rpool/export/home 0
487 Dataset rpool/export/home [ZPL], ID 137, cr_txg 1546, 32K, 8 objects
489 Object lvl iblk dblk dsize lsize %full type
490 0 7 16K 16K 15.0K 16K 25.00 DMU dnode
493 .Ss Example 4 : No Display the predicted effect of enabling deduplication on Ar rpool
495 .No # Nm zdb Fl S Ar rpool
496 Simulated DDT histogram:
498 bucket allocated referenced
499 ______ ______________________________ ______________________________
500 refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE
501 ------ ------ ----- ----- ----- ------ ----- ----- -----
502 1 694K 27.1G 15.0G 15.0G 694K 27.1G 15.0G 15.0G
503 2 35.0K 1.33G 699M 699M 74.7K 2.79G 1.45G 1.45G
505 dedup = 1.11, compress = 1.80, copies = 1.00, dedup * compress / copies = 2.00