2012-02-04 09:44:53 +04:00
'\" t
. \"
. \" This file and its contents are supplied under the terms of the
. \" Common Development and Distribution License ("CDDL"), version 1.0.
. \" You may only use this file in accordance with the terms of version
. \" 1.0 of the CDDL.
. \"
. \" A full copy of the text of the CDDL should have accompanied this
. \" source. A copy of the CDDL is also available via the Internet at
. \" http://www.illumos.org/license/CDDL.
. \"
. \"
. \" Copyright 2012, Richard Lowe.
2017-01-28 23:16:43 +03:00
. \" Copyright (c) 2012, 2016 by Delphix. All rights reserved.
2012-02-04 09:44:53 +04:00
. \"
2017-01-28 23:16:43 +03:00
.TH "ZDB" "8" "Feb 4, 2016" "" ""
2012-02-04 09:44:53 +04:00
.SH "NAME"
\fB zdb\fR - Display zpool debugging and consistency information
.SH "SYNOPSIS"
2017-01-28 23:16:43 +03:00
\fB zdb\fR [-CumdibcsDvhLMXFPAG] [-e [-p \fI path\fR ...]] [-t \fI txg\fR ]
2016-01-01 16:42:58 +03:00
[-U \fI cache\fR ] [-I \fI inflight I/Os\fR ] [-x \fI dumpdir\fR ]
2014-07-20 00:19:24 +04:00
[\fI poolname\fR [\fI object\fR ...]]
2012-02-04 09:44:53 +04:00
.P
2013-05-03 03:36:32 +04:00
\fB zdb\fR [-divPA] [-e [-p \fI path\fR ...]] [-U \fI cache\fR ]
\fI dataset\fR [\fI object\fR ...]
2012-02-04 09:44:53 +04:00
.P
2014-07-20 00:19:24 +04:00
\fB zdb\fR -m [-MLXFPA] [-t \fI txg\fR ] [-e [-p \fI path\fR ...]] [-U \fI cache\fR ]
2013-05-03 03:36:32 +04:00
\fI poolname\fR [\fI vdev\fR [\fI metaslab\fR ...]]
2012-02-04 09:44:53 +04:00
.P
2013-05-03 03:36:32 +04:00
\fB zdb\fR -R [-A] [-e [-p \fI path\fR ...]] [-U \fI cache\fR ] \fI poolname\fR
2012-02-04 09:44:53 +04:00
\fI vdev\fR :\fI offset\fR :\fI size\fR [:\fI flags\fR ]
.P
2013-05-03 03:36:32 +04:00
\fB zdb\fR -S [-AP] [-e [-p \fI path\fR ...]] [-U \fI cache\fR ] \fI poolname\fR
2012-02-04 09:44:53 +04:00
.P
\fB zdb\fR -l [-uA] \fI device\fR
.P
\fB zdb\fR -C [-A] [-U \fI cache\fR ]
.SH "DESCRIPTION"
The \fB zdb\fR 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 neither
a fsck(8) nor an fsdb(8) utility.
.P
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.
2015-05-14 20:45:56 +03:00
.P
If the \fI dataset\fR argument does not contain any \fB /\fR or \fB @\fR
characters, it is interpreted as a pool name. The root dataset can be
specified as \fI pool\fB /\fR (pool name followed by a slash).
2012-02-04 09:44:53 +04:00
.P
When operating on an imported and active pool it is possible, though unlikely,
that zdb may interpret inconsistent pool data and behave erratically.
.SH "OPTIONS"
Display options:
2009-12-12 03:15:33 +03:00
.sp
2012-02-04 09:44:53 +04:00
.ne 2
.na
\fB -b\fR
.ad
.sp .6
.RS 4 n
Display statistics regarding the number, size (logical, physical and
allocated) and deduplication of blocks.
.RE
2009-12-12 03:15:33 +03:00
.sp
2012-02-04 09:44:53 +04:00
.ne 2
.na
\fB -c\fR
.ad
.sp .6
.RS 4 n
Verify the checksum of all metadata blocks while printing block statistics
(see \fB -b\fR ).
2009-12-12 03:15:33 +03:00
.sp
2012-02-04 09:44:53 +04:00
If specified multiple times, verify the checksums of all blocks.
.RE
2009-12-12 03:15:33 +03:00
.sp
2012-02-04 09:44:53 +04:00
.ne 2
.na
\fB -C\fR
.ad
.sp .6
.RS 4 n
Display information about the configuration. If specified with no other
options, instead display information about the cache file
(\fB /etc/zfs/zpool.cache\fR ). To specify the cache file to display, see
\fB -U\fR .
.P
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 \fB -e\fR also display the configuration that would be used were the
pool to be imported.
.RE
.sp
.ne 2
.na
\fB -d\fR
.ad
.sp .6
.RS 4 n
Display information about datasets. Specified once, displays basic dataset
information: ID, create transaction, size, and object count.
.sp
If specified multiple times provides greater and greater verbosity.
.sp
If object IDs are specified, display information about those specific objects only.
.RE
2009-12-12 03:15:33 +03:00
.sp
.ne 2
.na
2012-02-04 09:44:53 +04:00
\fB -D\fR
2009-12-12 03:15:33 +03:00
.ad
2012-02-04 09:44:53 +04:00
.sp .6
.RS 4 n
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).
.sp
If specified twice, 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.
2013-10-13 20:36:15 +04:00
.sp
If specified a third time, display the statistics independently for each deduplication table.
.sp
If specified a fourth time, dump the contents of the deduplication tables describing duplicate blocks.
.sp
If specified a fifth time, also dump the contents of the deduplication tables describing unique blocks.
2009-12-12 03:15:33 +03:00
.RE
.sp
.ne 2
.na
2012-02-04 09:44:53 +04:00
\fB -h\fR
2009-12-12 03:15:33 +03:00
.ad
2012-02-04 09:44:53 +04:00
.sp .6
.RS 4 n
Display pool history similar to \fB zpool history\fR , but include internal
changes, transaction, and dataset information.
2009-12-12 03:15:33 +03:00
.RE
.sp
.ne 2
.na
2012-02-04 09:44:53 +04:00
\fB -i\fR
2009-12-12 03:15:33 +03:00
.ad
2012-02-04 09:44:53 +04:00
.sp .6
.RS 4 n
Display information about intent log (ZIL) entries relating to each
dataset. If specified multiple times, display counts of each intent log
transaction type.
2009-12-12 03:15:33 +03:00
.RE
.sp
2012-02-04 09:44:53 +04:00
.ne 2
.na
\fB -l\fR \fI device\fR
.ad
.sp .6
.RS 4 n
Display the vdev labels from the specified device. If the \fB -u\fR option is
also specified, also display the uberblocks on this device.
.RE
.sp
.ne 2
.na
\fB -L\fR
.ad
.sp .6
.RS 4 n
Disable leak tracing and the loading of space maps. By default, \fB zdb\fR
verifies that all non-free blocks are referenced, which can be very expensive.
.RE
.sp
.ne 2
.na
\fB -m\fR
.ad
.sp .6
.RS 4 n
Display the offset, spacemap, and free space of each metaslab.
2014-07-20 00:19:24 +04:00
When specified twice, also display information about the on-disk free
space histogram associated with each metaslab. When specified three time,
display the maximum contiguous free space, the in-core free space histogram,
and the percentage of free space in each space map. When specified
four times display every spacemap record.
.RE
.sp
.ne 2
.na
\fB -M\fR
.ad
.sp .6
.RS 4 n
Display the offset, spacemap, and free space of each metaslab.
2012-02-04 09:44:53 +04:00
When specified twice, also display information about the maximum contiguous
free space and the percentage of free space in each space map. When specified
three times display every spacemap record.
.RE
.sp
.ne 2
.na
\fB -R\fR \fI poolname\fR \fI vdev\fR :\fI offset\fR :\fI size\fR [:\fI flags\fR ]
.ad
.sp .6
.RS 4 n
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.
.sp
The block is specified in terms of a colon-separated tuple \fI vdev\fR (an
integer vdev identifier) \fI offset\fR (the offset within the vdev) \fI size\fR
(the size of the block to read) and, optionally, \fI flags\fR (a set of flags,
described below).
.sp
.ne 2
.na
\fB b\fR \fI offset\fR
.ad
.sp .6
.RS 4 n
Print block pointer
.RE
.sp
.ne 2
.na
\fB d\fR
.ad
.sp .6
.RS 4 n
Decompress the block
.RE
.sp
.ne 2
.na
\fB e\fR
.ad
.sp .6
.RS 4 n
Byte swap the block
.RE
.sp
.ne 2
.na
\fB g\fR
.ad
.sp .6
.RS 4 n
Dump gang block header
.RE
.sp
.ne 2
.na
\fB i\fR
.ad
.sp .6
.RS 4 n
Dump indirect block
.RE
.sp
.ne 2
.na
\fB r\fR
.ad
.sp .6
.RS 4 n
Dump raw uninterpreted block data
.RE
.RE
.sp
.ne 2
.na
\fB -s\fR
.ad
.sp .6
.RS 4 n
Report statistics on \fB zdb\fR \' s I/O. Display operation counts, bandwidth,
and error counts of I/O to the pool from \fB zdb\fR .
.RE
.sp
.ne 2
.na
\fB -S\fR
.ad
.sp .6
.RS 4 n
Simulate the effects of deduplication, constructing a DDT and then display
that DDT as with \fB -DD\fR .
.RE
.sp
.ne 2
.na
\fB -u\fR
.ad
.sp .6
.RS 4 n
Display the current uberblock.
.RE
.P
Other options:
.sp
.ne 2
.na
\fB -A\fR
.ad
.sp .6
.RS 4 n
Do not abort should any assertion fail.
.RE
.sp
.ne 2
.na
\fB -AA\fR
.ad
.sp .6
.RS 4 n
Enable panic recovery, certain errors which would otherwise be fatal are
demoted to warnings.
.RE
.sp
.ne 2
.na
\fB -AAA\fR
.ad
.sp .6
.RS 4 n
Do not abort if asserts fail and also enable panic recovery.
.RE
.sp
.ne 2
.na
\fB -e\fR [-p \fI path\fR ]...
.ad
.sp .6
.RS 4 n
Operate on an exported pool, not present in \fB /etc/zfs/zpool.cache\fR . The
\fB -p\fR flag specifies the path under which devices are to be searched.
.RE
2016-01-01 16:42:58 +03:00
.sp
.ne 2
.na
\fB -x\fR \fI dumpdir\fR
.ad
.sp .6
.RS 4 n
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. zdb can be then run on the generated files.
Note that the \fB -bbc\fR flags are sufficient to access (and thus copy)
all metadata on the pool.
.RE
2012-02-04 09:44:53 +04:00
.sp
.ne 2
.na
\fB -F\fR
.ad
.sp .6
.RS 4 n
Attempt to make an unreadable pool readable by trying progressively older
transactions.
.RE
2017-01-28 23:16:43 +03:00
.sp
.ne 2
.na
\fB -G\fR
.ad
.sp .6
.RS 4 n
Dump the contents of the zfs_dbgmsg buffer before exiting zdb. zfs_dbgmsg is
a buffer used by ZFS to dump advanced debug information.
.RE
2013-05-03 03:36:32 +04:00
.sp
.ne 2
.na
2014-07-20 00:19:24 +04:00
\fB -I \fI inflight I/Os\fR \fR
2013-05-03 03:36:32 +04:00
.ad
.sp .6
.RS 4 n
Limit the number of outstanding checksum I/Os to the specified value. The
default value is 200. This option affects the performance of the \fB -c\fR
option.
.RE
2012-02-04 09:44:53 +04:00
.sp
.ne 2
.na
\fB -P\fR
.ad
.sp .6
.RS 4 n
Print numbers in an unscaled form more amenable to parsing, eg. 1000000 rather
than 1M.
.RE
.sp
.ne 2
.na
\fB -t\fR \fI transaction\fR
.ad
.sp .6
.RS 4 n
Specify the highest transaction to use when searching for uberblocks. See also
the \fB -u\fR and \fB -l\fR options for a means to see the available uberblocks
and their associated transaction numbers.
.RE
.sp
.ne 2
.na
\fB -U\fR \fI cachefile\fR
.ad
.sp .6
.RS 4 n
2013-05-03 03:36:32 +04:00
Use a cache file other than \fB /etc/zfs/zpool.cache\fR .
2012-02-04 09:44:53 +04:00
.RE
.sp
.ne 2
.na
\fB -v\fR
.ad
.sp .6
.RS 4 n
Enable verbosity. Specify multiple times for increased verbosity.
.RE
.sp
.ne 2
.na
\fB -X\fR
.ad
.sp .6
.RS 4 n
Attempt \' extreme\' transaction rewind, that is attempt the same recovery as
\fB -F\fR but read transactions otherwise deemed too old.
.RE
2014-06-08 22:10:14 +04:00
.sp
.ne 2
.na
\fB -V\fR
.ad
.sp .6
.RS 4 n
Attempt a verbatim import. This mimics the behavior of the kernel when loading
a pool from a cachefile.
.RE
2012-02-04 09:44:53 +04:00
.P
Specifying a display option more than once enables verbosity for only that
option, with more occurrences enabling more verbosity.
.P
If no options are specified, all information about the named pool will be
displayed at default verbosity.
.SH "EXAMPLES"
2009-12-12 03:15:33 +03:00
.LP
2012-02-04 09:44:53 +04:00
\fB Example 1 \fR Display the configuration of imported pool 'rpool'
.sp
.in +2
.nf
# zdb -C rpool
MOS Configuration:
version: 28
name: 'rpool'
...
.fi
.in -2
.sp
.LP
\fB Example 2 \fR Display basic dataset information about 'rpool'
.sp
.in +2
.nf
# 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
...
.fi
.in -2
.sp
.LP
2013-02-22 23:28:28 +04:00
\fB Example 3 \fR Display basic information about object 0
in 'rpool/export/home'
2012-02-04 09:44:53 +04:00
.sp
.in +2
.nf
# 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
.fi
.in -2
.sp
.LP
\fB Example 4 \fR Display the predicted effect of enabling deduplication on 'rpool'
.sp
.in +2
.nf
# zdb -S rpool
Simulated DDT histogram:
2015-12-17 04:45:15 +03:00
bucket allocated referenced
2012-02-04 09:44:53 +04:00
______ ______________________________ ______________________________
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
.fi
.in -2
.sp
2014-09-12 17:44:04 +04:00
.SH "ENVIRONMENT VARIABLES"
.TP
.B "SPA_CONFIG_PATH"
Override the default \fB spa_config_path\fR (\fI /etc/zfs/zpool.cache\fR ) setting. If \fB -U\fR flag is specified it will override this environment variable settings once again.
2012-02-04 09:44:53 +04:00
.SH "SEE ALSO"
zfs(8), zpool(8)