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.
12 .\" Copyright 2012, Richard Lowe.
13 .\" Copyright (c) 2012, 2017 by Delphix. All rights reserved.
14 .\" Copyright 2017 Nexenta Systems, Inc.
15 .\" Copyright (c) 2017 Lawrence Livermore National Security, LLC.
16 .\" Copyright (c) 2017 Intel Corporation.
23 .Nd display zpool debugging and consistency information
26 .Op Fl AbcdDFGhikLMPsvX
27 .Op Fl e Oo Fl V Oc Op Fl p Ar path ...
28 .Op Fl I Ar inflight I/Os
29 .Oo Fl o Ar var Ns = Ns Ar value Oc Ns ...
33 .Op Ar poolname Op Ar object ...
36 .Op Fl e Oo Fl V Oc Op Fl p Ar path ...
38 .Ar dataset Op Ar object ...
46 .Ar word0 Ns \&: Ns Ar word1 Ns :...: Ns Ar word15
54 .Op Fl e Oo Fl V Oc Op Fl p Ar path ...
57 .Ar poolname Op Ar vdev Op Ar metaslab ...
64 .Op Fl e Oo Fl V Oc Op Fl p Ar path ...
66 .Ar poolname vdev Ns \&: Ns Ar offset Ns \&: Ns Ar size Ns Op : Ns Ar flags
70 .Op Fl e Oo Fl V Oc Op Fl p Ar path ...
76 utility displays information about a ZFS pool useful for debugging and performs
77 some amount of consistency checking.
78 It is a not a general purpose tool and options
87 The output of this command in general reflects the on-disk structure of a ZFS
88 pool, and is inherently unstable.
89 The precise output of most invocations is not documented, a knowledge of ZFS
94 argument does not contain any
98 characters, it is interpreted as a pool name.
99 The root dataset can be specified as
101 .Pq pool name followed by a slash .
103 When operating on an imported and active pool it is possible, though unlikely,
104 that zdb may interpret inconsistent pool data and behave erratically.
109 Display statistics regarding the number, size
110 .Pq logical, physical and allocated
111 and deduplication of blocks.
113 Verify the checksum of all metadata blocks while printing block statistics
118 If specified multiple times, verify the checksums of all blocks.
120 Display information about the configuration.
121 If specified with no other options, instead display information about the cache
123 .Pq Pa /etc/zfs/zpool.cache .
124 To specify the cache file to display, see
127 If specified multiple times, and a pool name is also specified display both the
128 cached configuration and the on-disk configuration.
129 If specified multiple times with
131 also display the configuration that would be used were the pool to be imported.
133 Display information about datasets.
134 Specified once, displays basic dataset information: ID, create transaction,
135 size, and object count.
137 If specified multiple times provides greater and greater verbosity.
139 If object IDs are specified, display information about those specific objects
142 Display deduplication statistics, including the deduplication ratio
146 inflation due to the zfs copies property
148 and an overall effective ratio
149 .Pq Sy dedup No * Sy compress No / Sy copies .
151 Display a histogram of deduplication statistics, showing the allocated
152 .Pq physically present on disk
154 .Pq logically referenced in the pool
155 block counts and sizes by reference count.
157 Display the statistics independently for each deduplication table.
159 Dump the contents of the deduplication tables describing duplicate blocks.
161 Also dump the contents of the deduplication tables describing unique blocks.
162 .It Fl E Ar word0 Ns \&: Ns Ar word1 Ns :...: Ns Ar word15
163 Decode and display block from an embedded block pointer specified by the
167 Display pool history similar to
168 .Nm zpool Cm history ,
169 but include internal changes, transaction, and dataset information.
171 Display information about intent log
173 entries relating to each dataset.
174 If specified multiple times, display counts of each intent log transaction type.
176 Examine the checkpointed state of the pool.
177 Note, the on disk format of the pool is not reverted to the checkpointed state.
179 Read the vdev labels from the specified device.
181 will return 0 if valid label was found, 1 if error occurred, and 2 if no valid
182 labels were found. Each unique configuration is displayed only once.
184 In addition display label space usage stats.
186 Display every configuration, unique or not.
190 option is also specified, don't print the labels.
194 option is also specified, also display the uberblocks on this device. Specify
195 multiple times to increase verbosity.
197 Disable leak tracing and the loading of space maps.
200 verifies that all non-free blocks are referenced, which can be very expensive.
202 Display the offset, spacemap, and free space of each metaslab.
204 Also display information about the on-disk free space histogram associated with
207 Display the maximum contiguous free space, the in-core free space histogram, and
208 the percentage of free space in each space map.
210 Display every spacemap record.
212 Display the offset, spacemap, and free space of each metaslab.
214 Also display information about the maximum contiguous free space and the
215 percentage of free space in each space map.
217 Display every spacemap record.
218 .It Fl O Ar dataset path
219 Look up the specified
223 and display its metadata and indirect blocks.
226 must be relative to the root of
228 This option can be combined with
230 for increasing verbosity.
232 .Fl R Ar poolname vdev Ns \&: Ns Ar offset Ns \&: Ns Ar size Ns Op : Ns Ar flags
234 Read and display a block from the specified device.
235 By default the block is displayed as a hex dump, but see the description of the
239 The block is specified in terms of a colon-separated tuple
241 .Pq an integer vdev identifier
243 .Pq the offset within the vdev
245 .Pq the size of the block to read
248 .Pq a set of flags, described below .
250 .Bl -tag -compact -width "b offset"
254 Decompress the block. Set environment variable
256 to skip zle when guessing.
260 Dump gang block header
264 Dump raw uninterpreted block data
270 Display operation counts, bandwidth, and error counts of I/O to the pool from
273 Simulate the effects of deduplication, constructing a DDT and then display
277 Display the current uberblock.
283 Do not abort should any assertion fail.
285 Enable panic recovery, certain errors which would otherwise be fatal are
288 Do not abort if asserts fail and also enable panic recovery.
289 .It Fl e Op Fl p Ar path ...
290 Operate on an exported pool, not present in
291 .Pa /etc/zfs/zpool.cache .
294 flag specifies the path under which devices are to be searched.
296 All blocks accessed will be copied to files in the specified directory.
297 The blocks will be placed in sparse files whose name is the same as
298 that of the file or device read.
300 can be then run on the generated files.
303 flags are sufficient to access
305 all metadata on the pool.
307 Attempt to make an unreadable pool readable by trying progressively older
310 Dump the contents of the zfs_dbgmsg buffer before exiting
312 zfs_dbgmsg is a buffer used by ZFS to dump advanced debug information.
313 .It Fl I Ar inflight I/Os
314 Limit the number of outstanding checksum I/Os to the specified value.
315 The default value is 200.
316 This option affects the performance of the
319 .It Fl o Ar var Ns = Ns Ar value ...
320 Set the given global libzpool variable to the provided value.
321 The value must be an unsigned 32-bit integer.
322 Currently only little-endian systems are supported to avoid accidentally setting
323 the high 32 bits of 64-bit variables.
325 Print numbers in an unscaled form more amenable to parsing, eg. 1000000 rather
327 .It Fl t Ar transaction
328 Specify the highest transaction to use when searching for uberblocks.
333 options for a means to see the available uberblocks and their associated
335 .It Fl U Ar cachefile
336 Use a cache file other than
337 .Pa /etc/zfs/zpool.cache .
340 Specify multiple times for increased verbosity.
342 Attempt verbatim import.
343 This mimics the behavior of the kernel when loading a pool from a cachefile.
349 transaction rewind, that is attempt the same recovery as
351 but read transactions otherwise deemed too old.
354 Specifying a display option more than once enables verbosity for only that
355 option, with more occurrences enabling more verbosity.
357 If no options are specified, all information about the named pool will be
358 displayed at default verbosity.
363 Display the configuration of imported pool
376 Display basic dataset information about
381 Dataset mos [META], ID 0, cr_txg 4, 26.9M, 1051 objects
382 Dataset rpool/swap [ZVOL], ID 59, cr_txg 356, 486M, 2 objects
387 Display basic information about object 0 in
388 .Pa rpool/export/home
391 # zdb -d rpool/export/home 0
392 Dataset rpool/export/home [ZPL], ID 137, cr_txg 1546, 32K, 8 objects
394 Object lvl iblk dblk dsize lsize %full type
395 0 7 16K 16K 15.0K 16K 25.00 DMU dnode
399 Display the predicted effect of enabling deduplication on
404 Simulated DDT histogram:
406 bucket allocated referenced
407 ______ ______________________________ ______________________________
408 refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE
409 ------ ------ ----- ----- ----- ------ ----- ----- -----
410 1 694K 27.1G 15.0G 15.0G 694K 27.1G 15.0G 15.0G
411 2 35.0K 1.33G 699M 699M 74.7K 2.79G 1.45G 1.45G
413 dedup = 1.11, compress = 1.80, copies = 1.00, dedup * compress / copies = 2.00