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 AbcdDFGhikLMNPsTvXYy
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 …
34 .Op Ar poolname Ns Op / Ns Ar dataset Ns | Ns Ar objset-ID
35 .Op Ar object Ns | Ns Ar range Ns …
38 .Op Fl e Oo Fl V Oc Oo Fl p Ar path Oc Ns …
41 .Ar poolname Ns Op Ar / Ns Ar dataset Ns | Ns Ar objset-ID
42 .Op Ar object Ns | Ns Ar range Ns …
45 .Op Fl e Oo Fl V Oc Oo Fl p Ar path Oc Ns …
48 .Ar poolname Ns Ar / Ns Ar objset-ID
58 .Ar word0 : Ns Ar word1 Ns :…: Ns Ar word15
66 .Op Fl e Oo Fl V Oc Oo Fl p Ar path Oc Ns …
69 .Ar poolname Op Ar vdev Oo Ar metaslab Oc Ns …
77 .Ar dataset path destination
81 .Op Fl e Oo Fl V Oc Oo Fl p Ar path Oc Ns …
83 .Ar poolname vdev : Ns Ar offset : Ns Oo Ar lsize Ns / Oc Ns Ar psize Ns Op : Ns Ar flags
87 .Op Fl e Oo Fl V Oc Oo Fl p Ar path Oc Ns …
94 utility displays information about a ZFS pool useful for debugging and performs
95 some amount of consistency checking.
96 It is a not a general purpose tool and options
103 The output of this command in general reflects the on-disk structure of a ZFS
104 pool, and is inherently unstable.
105 The precise output of most invocations is not documented, a knowledge of ZFS
106 internals is assumed.
110 argument does not contain any
114 characters, it is interpreted as a pool name.
115 The root dataset can be specified as
121 tool; it accesses the block devices underneath the pools directly from
122 userspace and does not care if the pool is imported or datasets are mounted
123 (or even if the system understands ZFS at all).
124 When operating on an imported and active pool it is possible, though unlikely,
125 that zdb may interpret inconsistent pool data and behave erratically.
130 .It Fl b , -block-stats
131 Display statistics regarding the number, size
132 .Pq logical, physical and allocated
133 and deduplication of blocks.
135 Generate a backup stream, similar to
137 but for the numeric objset ID, and without opening the dataset.
138 This can be useful in recovery scenarios if dataset metadata has become
139 corrupted but the dataset itself is readable.
142 argument is a string of one or more of the letters
148 which correspond to the same flags in
151 Verify the checksum of all metadata blocks while printing block statistics
156 If specified multiple times, verify the checksums of all blocks.
158 Display information about the configuration.
159 If specified with no other options, instead display information about the cache
161 .Pq Pa /etc/zfs/zpool.cache .
162 To specify the cache file to display, see
165 If specified multiple times, and a pool name is also specified display both the
166 cached configuration and the on-disk configuration.
167 If specified multiple times with
169 also display the configuration that would be used were the pool to be imported.
171 Display information about datasets.
172 Specified once, displays basic dataset information: ID, create transaction,
173 size, and object count.
177 .Ar poolname Ns Op / Ns Ar dataset Ns | Ns Ar objset-ID
178 is to use the specified
179 .Ar dataset Ns | Ns Ar objset-ID
180 as a string (dataset name) or a number (objset ID) when
181 datasets have numeric names.
183 If specified multiple times provides greater and greater verbosity.
185 If object IDs or object ID ranges are specified, display information about
186 those specific objects or ranges only.
188 An object ID range is specified in terms of a colon-separated tuple of
190 .Ao start Ac : Ns Ao end Ac Ns Op : Ns Ao flags Ac .
195 are integer object identifiers that denote the upper and lower bounds
199 value of -1 specifies a range with no upper bound.
202 field optionally specifies a set of flags, described below, that control
203 which object types are dumped.
204 By default, all object types are dumped.
207 negates the effect of the flag that follows it and has no effect unless
211 For example, the range 0:-1:A-d will dump all object types except for
214 .Bl -tag -compact -width Ds
216 Dump all objects (this is the default)
218 Dump ZFS directory objects
220 Dump ZFS plain file objects
222 Dump SPA space map objects
226 Negate the effect of next flag
228 .It Fl D , -dedup-stats
229 Display deduplication statistics, including the deduplication ratio
233 inflation due to the zfs copies property
235 and an overall effective ratio
236 .Pq Sy dedup No \(mu Sy compress No / Sy copies .
238 Display a histogram of deduplication statistics, showing the allocated
239 .Pq physically present on disk
241 .Pq logically referenced in the pool
242 block counts and sizes by reference count.
244 Display the statistics independently for each deduplication table.
246 Dump the contents of the deduplication tables describing duplicate blocks.
248 Also dump the contents of the deduplication tables describing unique blocks.
249 .It Fl E , -embedded-block-pointer Ns = Ns Ar word0 : Ns Ar word1 Ns :…: Ns Ar word15
250 Decode and display block from an embedded block pointer specified by the
254 Display pool history similar to
255 .Nm zpool Cm history ,
256 but include internal changes, transaction, and dataset information.
257 .It Fl i , -intent-logs
258 Display information about intent log
260 entries relating to each dataset.
261 If specified multiple times, display counts of each intent log transaction type.
262 .It Fl k , -checkpointed-state
263 Examine the checkpointed state of the pool.
264 Note, the on disk format of the pool is not reverted to the checkpointed state.
265 .It Fl l , -label Ns = Ns Ar device
266 Read the vdev labels and L2ARC header from the specified device.
268 will return 0 if valid label was found, 1 if error occurred, and 2 if no valid
270 The presence of L2ARC header is indicated by a specific
271 sequence (L2ARC_DEV_HDR_MAGIC).
272 If there is an accounting error in the size or the number of L2ARC log blocks
275 Each unique configuration is displayed only once.
277 In addition display label space usage stats.
278 If a valid L2ARC header was found
279 also display the properties of log blocks used for restoring L2ARC contents
282 Display every configuration, unique or not.
283 If a valid L2ARC header was found
284 also display the properties of log entries in log blocks used for restoring
285 L2ARC contents (persistent L2ARC).
289 option is also specified, don't print the labels or the L2ARC header.
293 option is also specified, also display the uberblocks on this device.
294 Specify multiple times to increase verbosity.
295 .It Fl L , -disable-leak-tracking
296 Disable leak detection and the loading of space maps.
299 verifies that all non-free blocks are referenced, which can be very expensive.
300 .It Fl m , -metaslabs
301 Display the offset, spacemap, free space of each metaslab, all the log
302 spacemaps and their obsolete entry statistics.
304 Also display information about the on-disk free space histogram associated with
307 Display the maximum contiguous free space, the in-core free space histogram, and
308 the percentage of free space in each space map.
310 Display every spacemap record.
311 .It Fl M , -metaslab-groups
312 Display all "normal" vdev metaslab group information - per-vdev metaslab count,
314 and free space histogram, as well as overall pool fragmentation and histogram.
316 "Special" vdevs are added to -M's normal output.
317 Also display information about the maximum contiguous free space and the
318 percentage of free space in each space map.
320 Display every spacemap record.
324 but force zdb to interpret the
325 .Op Ar dataset Ns | Ns Ar objset-ID
327 .Op Ar poolname Ns Op / Ns Ar dataset Ns | Ns Ar objset-ID
328 as a numeric objset ID.
329 .It Fl O , -object-lookups Ns = Ns Ar dataset path
330 Look up the specified
334 and display its metadata and indirect blocks.
337 must be relative to the root of
339 This option can be combined with
341 for increasing verbosity.
342 .It Fl r , -copy-object Ns = Ns Ar dataset path destination
347 to the specified destination.
350 must be relative to the root of
352 This option can be combined with
354 for increasing verbosity.
356 .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
358 Read and display a block from the specified device.
359 By default the block is displayed as a hex dump, but see the description of the
363 The block is specified in terms of a colon-separated tuple
365 .Pq an integer vdev identifier
367 .Pq the offset within the vdev
369 .Pq the physical size, or logical size / physical size
370 of the block to read and, optionally,
372 .Pq a set of flags, described below .
374 .Bl -tag -compact -width "b offset"
376 Print block pointer at hex offset
378 Calculate and display checksums
380 Decompress the block.
381 Set environment variable
383 to skip zle when guessing.
387 Dump gang block header
391 Dump raw uninterpreted block data
393 Verbose output for guessing compression algorithm
399 Display operation counts, bandwidth, and error counts of I/O to the pool from
401 .It Fl S , -simulate-dedup
402 Simulate the effects of deduplication, constructing a DDT and then display
405 .It Fl T , -brt-stats
406 Display block reference table (BRT) statistics, including the size of uniques
407 blocks cloned, the space saving as a result of cloning, and the saving ratio.
409 Display the per-vdev BRT statistics, including total references.
411 Display histograms of per-vdev BRT refcounts.
413 Dump the contents of the block reference tables.
414 .It Fl u , -uberblock
415 Display the current uberblock.
420 .It Fl A , -ignore-assertions
421 Do not abort should any assertion fail.
423 Enable panic recovery, certain errors which would otherwise be fatal are
426 Do not abort if asserts fail and also enable panic recovery.
427 .It Fl e , -exported Ns = Ns Oo Fl p Ar path Oc Ns …
428 Operate on an exported pool, not present in
429 .Pa /etc/zfs/zpool.cache .
432 flag specifies the path under which devices are to be searched.
433 .It Fl x , -dump-blocks Ns = Ns Ar dumpdir
434 All blocks accessed will be copied to files in the specified directory.
435 The blocks will be placed in sparse files whose name is the same as
436 that of the file or device read.
438 can be then run on the generated files.
441 flags are sufficient to access
443 all metadata on the pool.
444 .It Fl F , -automatic-rewind
445 Attempt to make an unreadable pool readable by trying progressively older
447 .It Fl G , -dump-debug-msg
448 Dump the contents of the zfs_dbgmsg buffer before exiting
450 zfs_dbgmsg is a buffer used by ZFS to dump advanced debug information.
451 .It Fl I , -inflight Ns = Ns Ar inflight-I/O-ops
452 Limit the number of outstanding checksum I/O operations to the specified value.
453 The default value is 200.
454 This option affects the performance of the
457 .It Fl K , -key Ns = Ns Ar key
458 Decryption key needed to access an encrypted dataset.
461 to attempt to unlock the dataset using the encryption root, key format and other
462 encryption parameters on the given dataset.
464 can still inspect pool and dataset structures on encrypted datasets without
465 unlocking them, but will not be able to access file names and attributes and
466 object contents. \fBWARNING:\fP The raw decryption key and any decrypted data
467 will be in user memory while
470 Other user programs may be able to extract it by inspecting
473 Exercise extreme caution when using this option in shared or uncontrolled
475 .It Fl o , -option Ns = Ns Ar var Ns = Ns Ar value Ns …
476 Set the given global libzpool variable to the provided value.
477 The value must be an unsigned 32-bit integer.
478 Currently only little-endian systems are supported to avoid accidentally setting
479 the high 32 bits of 64-bit variables.
480 .It Fl P , -parseable
481 Print numbers in an unscaled form more amenable to parsing, e.g.\&
485 .It Fl t , -txg Ns = Ns Ar transaction
486 Specify the highest transaction to use when searching for uberblocks.
491 options for a means to see the available uberblocks and their associated
493 .It Fl U , -cachefile Ns = Ns Ar cachefile
494 Use a cache file other than
495 .Pa /etc/zfs/zpool.cache .
498 Specify multiple times for increased verbosity.
500 Attempt verbatim import.
501 This mimics the behavior of the kernel when loading a pool from a cachefile.
504 .It Fl X , -extreme-rewind
507 transaction rewind, that is attempt the same recovery as
509 but read transactions otherwise deemed too old.
510 .It Fl Y , -all-reconstruction
511 Attempt all possible combinations when reconstructing indirect split blocks.
512 This flag disables the individual I/O deadman timer in order to allow as
513 much time as required for the attempted reconstruction.
515 Perform validation for livelists that are being deleted.
516 Scans through the livelist and metaslabs, checking for duplicate entries
517 and compares the two, checking for potential double frees.
518 If it encounters issues, warnings will be printed, but the command will not
522 Specifying a display option more than once enables verbosity for only that
523 option, with more occurrences enabling more verbosity.
525 If no options are specified, all information about the named pool will be
526 displayed at default verbosity.
529 .Ss Example 1 : No Display the configuration of imported pool Ar rpool
531 .No # Nm zdb Fl C Ar rpool
538 .Ss Example 2 : No Display basic dataset information about Ar rpool
540 .No # Nm zdb Fl d Ar rpool
541 Dataset mos [META], ID 0, cr_txg 4, 26.9M, 1051 objects
542 Dataset rpool/swap [ZVOL], ID 59, cr_txg 356, 486M, 2 objects
546 .Ss Example 3 : No Display basic information about object 0 in Ar rpool/export/home
548 .No # Nm zdb Fl d Ar rpool/export/home 0
549 Dataset rpool/export/home [ZPL], ID 137, cr_txg 1546, 32K, 8 objects
551 Object lvl iblk dblk dsize lsize %full type
552 0 7 16K 16K 15.0K 16K 25.00 DMU dnode
555 .Ss Example 4 : No Display the predicted effect of enabling deduplication on Ar rpool
557 .No # Nm zdb Fl S Ar rpool
558 Simulated DDT histogram:
560 bucket allocated referenced
561 ______ ______________________________ ______________________________
562 refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE
563 ------ ------ ----- ----- ----- ------ ----- ----- -----
564 1 694K 27.1G 15.0G 15.0G 694K 27.1G 15.0G 15.0G
565 2 35.0K 1.33G 699M 699M 74.7K 2.79G 1.45G 1.45G
567 dedup = 1.11, compress = 1.80, copies = 1.00, dedup * compress / copies = 2.00