|ZDB(8)||System Manager's Manual||ZDB(8)|
zdb — display ZFS
storage pool debugging and consistency information
zdb utility displays information about
a ZFS pool useful for debugging and performs some amount of consistency
checking. It is a not a general purpose tool and options (and facilities)
may change. This is not a fsck(8) utility.
The output of this command in general reflects the on-disk structure of a ZFS pool, and is inherently unstable. The precise output of most invocations is not documented, a knowledge of ZFS internals is assumed.
When operating on an imported and active pool it is possible, though unlikely, that zdb may interpret inconsistent pool data and behave erratically.
- Display statistics regarding the number, size (logical, physical and allocated) and deduplication of blocks.
- Verify the checksum of all metadata blocks while printing block statistics
If specified multiple times, verify the checksums of all blocks.
- Display information about the configuration. If specified with no other
options, instead display information about the cache file
(/etc/zfs/zpool.cache). To specify the cache file
to display, see
If specified multiple times, and a pool name is also specified display both the cached configuration and the on-disk configuration. If specified multiple times with
-ealso display the configuration that would be used were the pool to be imported.
- Display information about datasets. Specified once, displays basic dataset
information: ID, create transaction, size, and object count. See
-Nfor determining if [poolname[/dataset | objset ID]] is to use the specified [dataset | objset ID] as a string (dataset name) or a number (objset ID) when datasets have numeric names.
If specified multiple times provides greater and greater verbosity.
If object IDs or object ID ranges are specified, display information about those specific objects or ranges only.
An object ID range is specified in terms of a colon-separated tuple of the form ⟨start⟩:⟨end⟩[:⟨flags⟩]. The fields start and end are integer object identifiers that denote the upper and lower bounds of the range. An end value of -1 specifies a range with no upper bound. The flags field optionally specifies a set of flags, described below, that control which object types are dumped. By default, all object types are dumped. A minus sign (-) negates the effect of the flag that follows it and has no effect unless preceded by the A flag. For example, the range 0:-1:A-d will dump all object types except for directories.
- Display deduplication statistics, including the deduplication ratio (dedup), compression ratio (compress), inflation due to the zfs copies property (copies), and an overall effective ratio (dedup * compress / copies).
- Display a histogram of deduplication statistics, showing the allocated (physically present on disk) and referenced (logically referenced in the pool) block counts and sizes by reference count.
- Display the statistics independently for each deduplication table.
- Dump the contents of the deduplication tables describing duplicate blocks.
- Also dump the contents of the deduplication tables describing unique blocks.
- Decode and display block from an embedded block pointer specified by the word arguments.
- Display pool history similar to
history, but include internal changes, transaction, and dataset information.
- Display information about intent log (ZIL) entries relating to each dataset. If specified multiple times, display counts of each intent log transaction type.
- Examine the checkpointed state of the pool. Note, the on disk format of the pool is not reverted to the checkpointed state.
- Read the vdev labels and L2ARC header from the specified device.
-lwill return 0 if valid label was found, 1 if error occurred, and 2 if no valid labels were found. The presence of L2ARC header is indicated by a specific sequence (L2ARC_DEV_HDR_MAGIC). If there is an accounting error in the size or the number of L2ARC log blocks
-lwill return 1. Each unique configuration is displayed only once.
- In addition display label space usage stats. If a valid L2ARC header was found also display the properties of log blocks used for restoring L2ARC contents (persistent L2ARC).
- Display every configuration, unique or not. If a valid L2ARC header was
found also display the properties of log entries in log blocks used for
restoring L2ARC contents (persistent L2ARC).
-qoption is also specified, don't print the labels or the L2ARC header.
-uoption is also specified, also display the uberblocks on this device. Specify multiple times to increase verbosity.
- Disable leak detection and the loading of space maps. By default,
zdbverifies that all non-free blocks are referenced, which can be very expensive.
- Display the offset, spacemap, free space of each metaslab, all the log spacemaps and their obsolete entry statistics.
- Also display information about the on-disk free space histogram associated with each metaslab.
- Display the maximum contiguous free space, the in-core free space histogram, and the percentage of free space in each space map.
- Display every spacemap record.
- Display the offset, spacemap, and free space of each metaslab.
- Also display information about the maximum contiguous free space and the percentage of free space in each space map.
- Display every spacemap record.
- Same as
-dbut force zdb to interpret the [dataset | objset ID] in [poolname[/dataset | objset ID]] as a numeric objset ID.
- Look up the specified path inside of the
dataset and display its metadata and indirect
blocks. Specified path must be relative to the root
of dataset. This option can be combined with
-vfor increasing verbosity.
-rdataset path destination
- Copy the specified path inside of the
dataset to the specified destination. Specified
path must be relative to the root of
dataset. This option can be combined with
-vfor increasing verbosity.
- Read and display a block from the specified device. By default the block
is displayed as a hex dump, but see the description of the
r flag, below.
The block is specified in terms of a colon-separated tuple vdev (an integer vdev identifier) offset (the offset within the vdev) size (the physical size, or logical size / physical size) of the block to read and, optionally, flags (a set of flags, described below).
- b offset
- Print block pointer at hex offset
- Calculate and display checksums
- Decompress the block. Set environment variable
ZDB_NO_ZLEto skip zle when guessing.
- Byte swap the block
- Dump gang block header
- Dump indirect block
- Dump raw uninterpreted block data
- Verbose output for guessing compression algorithm
- Report statistics on
zdbI/O. Display operation counts, bandwidth, and error counts of I/O to the pool from
- Simulate the effects of deduplication, constructing a DDT and then display
that DDT as with
- Display the current uberblock.
- Do not abort should any assertion fail.
- Enable panic recovery, certain errors which would otherwise be fatal are demoted to warnings.
- Do not abort if asserts fail and also enable panic recovery.
- Operate on an exported pool, not present in
-pflag specifies the path under which devices are to be searched.
- All blocks accessed will be copied to files in the specified directory.
The blocks will be placed in sparse files whose name is the same as that
of the file or device read.
zdbcan be then run on the generated files. Note that the
-bbcflags are sufficient to access (and thus copy) all metadata on the pool.
- Attempt to make an unreadable pool readable by trying progressively older transactions.
- Dump the contents of the zfs_dbgmsg buffer before exiting
zdb. zfs_dbgmsg is a buffer used by ZFS to dump advanced debug information.
- Limit the number of outstanding checksum I/Os to the specified value. The
default value is 200. This option affects the performance of the
- Set the given global libzpool variable to the provided value. The value must be an unsigned 32-bit integer. Currently only little-endian systems are supported to avoid accidentally setting the high 32 bits of 64-bit variables.
- Print numbers in an unscaled form more amenable to parsing, e.g. 1000000 rather than 1M.
- Specify the highest transaction to use when searching for uberblocks. See
-loptions for a means to see the available uberblocks and their associated transaction numbers.
- Use a cache file other than /etc/zfs/zpool.cache.
- Enable verbosity. Specify multiple times for increased verbosity.
- Attempt verbatim import. This mimics the behavior of the kernel when
loading a pool from a cachefile. Only usable with
- Attempt "extreme" transaction rewind, that is attempt the same
-Fbut read transactions otherwise deemed too old.
- Attempt all possible combinations when reconstructing indirect split blocks. This flag disables the individual I/O deadman timer in order to allow as much time as required for the attempted reconstruction.
- Perform validation for livelists that are being deleted. Scans through the livelist and metaslabs, checking for duplicate entries and compares the two, checking for potential double frees. If it encounters issues, warnings will be printed, but the command will not necessarily fail.
Specifying a display option more than once enables verbosity for only that option, with more occurrences enabling more verbosity.
If no options are specified, all information about the named pool will be displayed at default verbosity.
- Example 1: Display the configuration of imported pool rpool
-Crpool MOS Configuration: version: 28 name: 'rpool' …
- Example 2: Display basic dataset information about rpool
-drpool Dataset mos [META], ID 0, cr_txg 4, 26.9M, 1051 objects Dataset rpool/swap [ZVOL], ID 59, cr_txg 356, 486M, 2 objects …
- Example 3: Display basic information about object 0 in rpool/export/home
-drpool/export/home 0 Dataset rpool/export/home [ZPL], ID 137, cr_txg 1546, 32K, 8 objects Object lvl iblk dblk dsize lsize %full type 0 7 16K 16K 15.0K 16K 25.00 DMU dnode
- Example 4: Display the predicted effect of enabling deduplication on rpool
-Srpool Simulated DDT histogram: bucket allocated referenced ______ ______________________________ ______________________________ refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE ------ ------ ----- ----- ----- ------ ----- ----- ----- 1 694K 27.1G 15.0G 15.0G 694K 27.1G 15.0G 15.0G 2 35.0K 1.33G 699M 699M 74.7K 2.79G 1.45G 1.45G … dedup = 1.11, compress = 1.80, copies = 1.00, dedup * compress / copies = 2.00
|October 7, 2020||OpenZFS|