ZDB(8) | System Manager's Manual | ZDB(8) |
zdb
— display ZFS
storage pool debugging and consistency information
zdb |
[-AbcdDFGhikLMNPsTvXYy ]
[-e [-V ]
[-p path]…]
[-I inflight-I/O-ops]
[-o
var=value]…
[-t txg]
[-U cache]
[-x dumpdir]
[-K key]
[poolname[/dataset|objset-ID]]
[object|range…] |
zdb |
[-AdiPv ] [-e
[-V ] [-p
path]…] [-U
cache] [-K
key]
poolname[/dataset|objset-ID]
[object|range…] |
zdb |
-B [-e
[-V ] [-p
path]…] [-U
cache] [-K
key]
poolname/objset-ID
[backup-flags] |
zdb |
-C [-A ]
[-U cache]
[poolname] |
zdb |
-E [-A ]
word0:word1:…:word15 |
zdb |
-l [-Aqu ]
device |
zdb |
-m [-AFLPXY ]
[-e [-V ]
[-p path]…]
[-t txg]
[-U cache]
poolname [vdev
[metaslab]…] |
zdb |
-O [-K
key] dataset path |
zdb |
-r [-K
key] dataset path
destination |
zdb |
-R [-A ]
[-e [-V ]
[-p path]…]
[-U cache]
poolname
vdev:offset:[lsize/]psize[:flags] |
zdb |
-S [-AP ]
[-e [-V ]
[-p path]…]
[-U cache]
poolname |
The 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. It 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.
If the dataset argument does not contain any "/" or "@" characters, it is interpreted as a pool name. The root dataset can be specified as "pool/".
zdb
is an "offline" tool; it
accesses the block devices underneath the pools directly from userspace and
does not care if the pool is imported or datasets are mounted (or even if
the system understands ZFS at all). When operating on an imported and active
pool it is possible, though unlikely, that zdb may interpret inconsistent
pool data and behave erratically.
Display options:
-b
,
--block-stats
-B
,
--backup
zfs
send
, but for the numeric objset ID, and without
opening the dataset. This can be useful in recovery scenarios if dataset
metadata has become corrupted but the dataset itself is readable. The
optional flags argument is a string of one or more
of the letters e, L,
c, and
w, which
correspond to the same flags in
zfs-send(8).-c
,
--checksum
-b
).
If specified multiple times, verify the checksums of all blocks.
-C
,
--config
-U
.
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 -e
also display
the configuration that would be used were the pool to be imported.
-d
,
--datasets
-N
for 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.
-D
,
--dedup-stats
-DD
-DDD
-DDDD
-DDDDD
-E
,
--embedded-block-pointer
=word0:word1:…:word15-h
,
--history
zpool
history
, but include internal changes,
transaction, and dataset information.-i
,
--intent-logs
-k
,
--checkpointed-state
-l
,
--label
=devicezdb
-l
will 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 zdb
-l
will return 1. Each unique configuration is
displayed only once.-ll
device-lll
deviceIf the -q
option is also specified,
don't print the labels or the L2ARC header.
If the -u
option is also specified,
also display the uberblocks on this device. Specify multiple times to
increase verbosity.
-L
,
--disable-leak-tracking
zdb
verifies that all non-free blocks are
referenced, which can be very expensive.-m
,
--metaslabs
-mm
-mmm
-mmmm
-M
,
--metaslab-groups
-MM
-O
,
--object-lookups
=dataset
path-MMM
-N
-d
but force zdb to interpret the
[dataset|objset-ID] in
[poolname[/dataset|objset-ID]]
as a numeric objset ID.-O
dataset path-v
for increasing verbosity.-r
,
--copy-object
=dataset path
destination-v
for increasing verbosity.-R
,
--read-block
=poolname
vdev:offset:[lsize/]psize[:flags]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).
ZDB_NO_ZLE
to skip zle when guessing.-s
,
--io-stats
zdb
I/O. Display operation
counts, bandwidth, and error counts of I/O to the pool from
zdb
.-S
,
--simulate-dedup
-DD
.-T
,
--brt-stats
-TT
-TTT
-u
,
--uberblock
Other options:
-A
,
--ignore-assertions
-AA
-AAA
-e
,
--exported
=[-p
path]…-p
flag specifies the path under which devices are
to be searched.-x
,
--dump-blocks
=dumpdirzdb
can be then run on
the generated files. Note that the -bbc
flags are
sufficient to access (and thus copy) all metadata on the pool.-F
,
--automatic-rewind
-G
,
--dump-debug-msg
zdb
. zfs_dbgmsg is a buffer used by ZFS to dump
advanced debug information.-I
,
--inflight
=inflight-I/O-ops-c
option.-K
,
--key
=keyzdb
to attempt to unlock the dataset using the
encryption root, key format and other encryption parameters on the given
dataset. zdb
can still inspect pool and dataset
structures on encrypted datasets without unlocking them, but will not be
able to access file names and attributes and object contents.
WARNING: The raw decryption key and any decrypted data will be in
user memory while zdb
is running. Other user
programs may be able to extract it by inspecting
zdb
as it runs. Exercise extreme caution when
using this option in shared or uncontrolled environments.-o
,
--option
=var=value…-P
,
--parseable
-t
,
--txg
=transaction-u
and -l
options
for a means to see the available uberblocks and their associated
transaction numbers.-U
,
--cachefile
=cachefile-v
,
--verbose
-V
,
--verbatim
-e
.-X
,
--extreme-rewind
-F
but read transactions otherwise
deemed too old.-Y
,
--all-reconstruction
-y
,
--livelist
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.
#zdb
-C
rpool MOS Configuration: version: 28 name: 'rpool' …
#zdb
-d
rpool Dataset mos [META], ID 0, cr_txg 4, 26.9M, 1051 objects Dataset rpool/swap [ZVOL], ID 59, cr_txg 356, 486M, 2 objects …
#zdb
-d
rpool/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
#zdb
-S
rpool 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
November 18, 2023 | OpenZFS |