xref: /freebsd/sys/contrib/openzfs/man/man8/zdb.8 (revision 61145dc2b94f12f6a47344fb9aac702321880e43)
1*61145dc2SMartin Matuska.\" SPDX-License-Identifier: CDDL-1.0
2eda14cbcSMatt Macy.\"
3eda14cbcSMatt Macy.\" This file and its contents are supplied under the terms of the
4eda14cbcSMatt Macy.\" Common Development and Distribution License ("CDDL"), version 1.0.
5eda14cbcSMatt Macy.\" You may only use this file in accordance with the terms of version
6eda14cbcSMatt Macy.\" 1.0 of the CDDL.
7eda14cbcSMatt Macy.\"
8eda14cbcSMatt Macy.\" A full copy of the text of the CDDL should have accompanied this
9eda14cbcSMatt Macy.\" source.  A copy of the CDDL is also available via the Internet at
10eda14cbcSMatt Macy.\" http://www.illumos.org/license/CDDL.
11eda14cbcSMatt Macy.\"
12eda14cbcSMatt Macy.\" Copyright 2012, Richard Lowe.
13eda14cbcSMatt Macy.\" Copyright (c) 2012, 2019 by Delphix. All rights reserved.
14eda14cbcSMatt Macy.\" Copyright 2017 Nexenta Systems, Inc.
15eda14cbcSMatt Macy.\" Copyright (c) 2017 Lawrence Livermore National Security, LLC.
16eda14cbcSMatt Macy.\" Copyright (c) 2017 Intel Corporation.
17eda14cbcSMatt Macy.\"
185c65a0a9SMartin Matuska.Dd October 27, 2024
1916038816SMartin Matuska.Dt ZDB 8
20eda14cbcSMatt Macy.Os
2116038816SMartin Matuska.
22eda14cbcSMatt Macy.Sh NAME
23eda14cbcSMatt Macy.Nm zdb
2416038816SMartin Matuska.Nd display ZFS storage pool debugging and consistency information
25eda14cbcSMatt Macy.Sh SYNOPSIS
26eda14cbcSMatt Macy.Nm
272276e539SMartin Matuska.Op Fl AbcdDFGhikLMNPsTvXYy
2816038816SMartin Matuska.Op Fl e Oo Fl V Oc Oo Fl p Ar path Oc Ns …
29c03c5b1cSMartin Matuska.Op Fl I Ar inflight-I/O-ops
3016038816SMartin Matuska.Oo Fl o Ar var Ns = Ns Ar value Oc Ns …
31eda14cbcSMatt Macy.Op Fl t Ar txg
32eda14cbcSMatt Macy.Op Fl U Ar cache
33eda14cbcSMatt Macy.Op Fl x Ar dumpdir
342a58b312SMartin Matuska.Op Fl K Ar key
35c03c5b1cSMartin Matuska.Op Ar poolname Ns Op / Ns Ar dataset Ns | Ns Ar objset-ID
3616038816SMartin Matuska.Op Ar object Ns | Ns Ar range Ns …
37eda14cbcSMatt Macy.Nm
38eda14cbcSMatt Macy.Op Fl AdiPv
3916038816SMartin Matuska.Op Fl e Oo Fl V Oc Oo Fl p Ar path Oc Ns …
40eda14cbcSMatt Macy.Op Fl U Ar cache
412a58b312SMartin Matuska.Op Fl K Ar key
42c03c5b1cSMartin Matuska.Ar poolname Ns Op Ar / Ns Ar dataset Ns | Ns Ar objset-ID
4316038816SMartin Matuska.Op Ar object Ns | Ns Ar range Ns …
44eda14cbcSMatt Macy.Nm
454e8d558cSMartin Matuska.Fl B
464e8d558cSMartin Matuska.Op Fl e Oo Fl V Oc Oo Fl p Ar path Oc Ns …
474e8d558cSMartin Matuska.Op Fl U Ar cache
484e8d558cSMartin Matuska.Op Fl K Ar key
494e8d558cSMartin Matuska.Ar poolname Ns Ar / Ns Ar objset-ID
504e8d558cSMartin Matuska.Op Ar backup-flags
514e8d558cSMartin Matuska.Nm
52eda14cbcSMatt Macy.Fl C
53eda14cbcSMatt Macy.Op Fl A
54eda14cbcSMatt Macy.Op Fl U Ar cache
550a97523dSMartin Matuska.Op Ar poolname
56eda14cbcSMatt Macy.Nm
57eda14cbcSMatt Macy.Fl E
58eda14cbcSMatt Macy.Op Fl A
5916038816SMartin Matuska.Ar word0 : Ns Ar word1 Ns :…: Ns Ar word15
60eda14cbcSMatt Macy.Nm
61eda14cbcSMatt Macy.Fl l
62eda14cbcSMatt Macy.Op Fl Aqu
63eda14cbcSMatt Macy.Ar device
64eda14cbcSMatt Macy.Nm
65eda14cbcSMatt Macy.Fl m
66eda14cbcSMatt Macy.Op Fl AFLPXY
6716038816SMartin Matuska.Op Fl e Oo Fl V Oc Oo Fl p Ar path Oc Ns …
68eda14cbcSMatt Macy.Op Fl t Ar txg
69eda14cbcSMatt Macy.Op Fl U Ar cache
7016038816SMartin Matuska.Ar poolname Op Ar vdev Oo Ar metaslab Oc Ns …
71eda14cbcSMatt Macy.Nm
72eda14cbcSMatt Macy.Fl O
732a58b312SMartin Matuska.Op Fl K Ar key
74eda14cbcSMatt Macy.Ar dataset path
75eda14cbcSMatt Macy.Nm
76184c1b94SMartin Matuska.Fl r
772a58b312SMartin Matuska.Op Fl K Ar key
78184c1b94SMartin Matuska.Ar dataset path destination
79184c1b94SMartin Matuska.Nm
80eda14cbcSMatt Macy.Fl R
81eda14cbcSMatt Macy.Op Fl A
8216038816SMartin Matuska.Op Fl e Oo Fl V Oc Oo Fl p Ar path Oc Ns …
83eda14cbcSMatt Macy.Op Fl U Ar cache
8416038816SMartin Matuska.Ar poolname vdev : Ns Ar offset : Ns Oo Ar lsize Ns / Oc Ns Ar psize Ns Op : Ns Ar flags
85eda14cbcSMatt Macy.Nm
86eda14cbcSMatt Macy.Fl S
87eda14cbcSMatt Macy.Op Fl AP
8816038816SMartin Matuska.Op Fl e Oo Fl V Oc Oo Fl p Ar path Oc Ns …
89eda14cbcSMatt Macy.Op Fl U Ar cache
90eda14cbcSMatt Macy.Ar poolname
9116038816SMartin Matuska.
92eda14cbcSMatt Macy.Sh DESCRIPTION
93eda14cbcSMatt MacyThe
94eda14cbcSMatt Macy.Nm
95eda14cbcSMatt Macyutility displays information about a ZFS pool useful for debugging and performs
96eda14cbcSMatt Macysome amount of consistency checking.
97eda14cbcSMatt MacyIt is a not a general purpose tool and options
98eda14cbcSMatt Macy.Pq and facilities
99eda14cbcSMatt Macymay change.
100c03c5b1cSMartin MatuskaIt is not a
101eda14cbcSMatt Macy.Xr fsck 8
102eda14cbcSMatt Macyutility.
103eda14cbcSMatt Macy.Pp
104eda14cbcSMatt MacyThe output of this command in general reflects the on-disk structure of a ZFS
105eda14cbcSMatt Macypool, and is inherently unstable.
106eda14cbcSMatt MacyThe precise output of most invocations is not documented, a knowledge of ZFS
107eda14cbcSMatt Macyinternals is assumed.
108eda14cbcSMatt Macy.Pp
109eda14cbcSMatt MacyIf the
110eda14cbcSMatt Macy.Ar dataset
111eda14cbcSMatt Macyargument does not contain any
112eda14cbcSMatt Macy.Qq Sy /
113eda14cbcSMatt Macyor
114eda14cbcSMatt Macy.Qq Sy @
115eda14cbcSMatt Macycharacters, it is interpreted as a pool name.
116eda14cbcSMatt MacyThe root dataset can be specified as
11716038816SMartin Matuska.Qq Ar pool Ns / .
118eda14cbcSMatt Macy.Pp
1192a58b312SMartin Matuska.Nm
1202a58b312SMartin Matuskais an
1212a58b312SMartin Matuska.Qq offline
1222a58b312SMartin Matuskatool; it accesses the block devices underneath the pools directly from
1232a58b312SMartin Matuskauserspace and does not care if the pool is imported or datasets are mounted
1242a58b312SMartin Matuska(or even if the system understands ZFS at all).
125eda14cbcSMatt MacyWhen operating on an imported and active pool it is possible, though unlikely,
126eda14cbcSMatt Macythat zdb may interpret inconsistent pool data and behave erratically.
12716038816SMartin Matuska.
128eda14cbcSMatt Macy.Sh OPTIONS
129eda14cbcSMatt MacyDisplay options:
130eda14cbcSMatt Macy.Bl -tag -width Ds
131e92ffd9bSMartin Matuska.It Fl b , -block-stats
132eda14cbcSMatt MacyDisplay statistics regarding the number, size
133eda14cbcSMatt Macy.Pq logical, physical and allocated
134eda14cbcSMatt Macyand deduplication of blocks.
1354e8d558cSMartin Matuska.It Fl B , -backup
1364e8d558cSMartin MatuskaGenerate a backup stream, similar to
1374e8d558cSMartin Matuska.Nm zfs Cm send ,
1384e8d558cSMartin Matuskabut for the numeric objset ID, and without opening the dataset.
1394e8d558cSMartin MatuskaThis can be useful in recovery scenarios if dataset metadata has become
1404e8d558cSMartin Matuskacorrupted but the dataset itself is readable.
1414e8d558cSMartin MatuskaThe optional
1424e8d558cSMartin Matuska.Ar flags
1434e8d558cSMartin Matuskaargument is a string of one or more of the letters
1444e8d558cSMartin Matuska.Sy e ,
1454e8d558cSMartin Matuska.Sy L ,
1464e8d558cSMartin Matuska.Sy c ,
1474e8d558cSMartin Matuskaand
1484e8d558cSMartin Matuska.Sy w ,
1494e8d558cSMartin Matuskawhich correspond to the same flags in
1504e8d558cSMartin Matuska.Xr zfs-send 8 .
151e92ffd9bSMartin Matuska.It Fl c , -checksum
152eda14cbcSMatt MacyVerify the checksum of all metadata blocks while printing block statistics
153eda14cbcSMatt Macy.Po see
154eda14cbcSMatt Macy.Fl b
155eda14cbcSMatt Macy.Pc .
156eda14cbcSMatt Macy.Pp
157eda14cbcSMatt MacyIf specified multiple times, verify the checksums of all blocks.
158e92ffd9bSMartin Matuska.It Fl C , -config
159eda14cbcSMatt MacyDisplay information about the configuration.
160eda14cbcSMatt MacyIf specified with no other options, instead display information about the cache
161eda14cbcSMatt Macyfile
162eda14cbcSMatt Macy.Pq Pa /etc/zfs/zpool.cache .
163eda14cbcSMatt MacyTo specify the cache file to display, see
164eda14cbcSMatt Macy.Fl U .
165eda14cbcSMatt Macy.Pp
166eda14cbcSMatt MacyIf specified multiple times, and a pool name is also specified display both the
167eda14cbcSMatt Macycached configuration and the on-disk configuration.
168eda14cbcSMatt MacyIf specified multiple times with
169eda14cbcSMatt Macy.Fl e
170eda14cbcSMatt Macyalso display the configuration that would be used were the pool to be imported.
171e92ffd9bSMartin Matuska.It Fl d , -datasets
172eda14cbcSMatt MacyDisplay information about datasets.
173eda14cbcSMatt MacySpecified once, displays basic dataset information: ID, create transaction,
174eda14cbcSMatt Macysize, and object count.
175e92ffd9bSMartin MatuskaSee
176e92ffd9bSMartin Matuska.Fl N
177e92ffd9bSMartin Matuskafor determining if
178c03c5b1cSMartin Matuska.Ar poolname Ns Op / Ns Ar dataset Ns | Ns Ar objset-ID
179e92ffd9bSMartin Matuskais to use the specified
180c03c5b1cSMartin Matuska.Ar dataset Ns | Ns Ar objset-ID
181e92ffd9bSMartin Matuskaas a string (dataset name) or a number (objset ID) when
182e92ffd9bSMartin Matuskadatasets have numeric names.
183eda14cbcSMatt Macy.Pp
184eda14cbcSMatt MacyIf specified multiple times provides greater and greater verbosity.
185eda14cbcSMatt Macy.Pp
186eda14cbcSMatt MacyIf object IDs or object ID ranges are specified, display information about
187eda14cbcSMatt Macythose specific objects or ranges only.
188eda14cbcSMatt Macy.Pp
189eda14cbcSMatt MacyAn object ID range is specified in terms of a colon-separated tuple of
190eda14cbcSMatt Macythe form
19116038816SMartin Matuska.Ao start Ac : Ns Ao end Ac Ns Op : Ns Ao flags Ac .
192eda14cbcSMatt MacyThe fields
193eda14cbcSMatt Macy.Ar start
194eda14cbcSMatt Macyand
195eda14cbcSMatt Macy.Ar end
196eda14cbcSMatt Macyare integer object identifiers that denote the upper and lower bounds
19716038816SMartin Matuskaof the range.
19816038816SMartin MatuskaAn
199eda14cbcSMatt Macy.Ar end
20016038816SMartin Matuskavalue of -1 specifies a range with no upper bound.
20116038816SMartin MatuskaThe
202eda14cbcSMatt Macy.Ar flags
203eda14cbcSMatt Macyfield optionally specifies a set of flags, described below, that control
20416038816SMartin Matuskawhich object types are dumped.
20516038816SMartin MatuskaBy default, all object types are dumped.
20616038816SMartin MatuskaA minus sign
207eda14cbcSMatt Macy.Pq -
208eda14cbcSMatt Macynegates the effect of the flag that follows it and has no effect unless
209eda14cbcSMatt Macypreceded by the
210eda14cbcSMatt Macy.Ar A
21116038816SMartin Matuskaflag.
212bb2d13b6SMartin MatuskaFor example, the range 0:-1:A-d will dump all object types except for
213bb2d13b6SMartin Matuskadirectories.
214eda14cbcSMatt Macy.Pp
21516038816SMartin Matuska.Bl -tag -compact -width Ds
216eda14cbcSMatt Macy.It Sy A
217eda14cbcSMatt MacyDump all objects (this is the default)
218eda14cbcSMatt Macy.It Sy d
219eda14cbcSMatt MacyDump ZFS directory objects
220eda14cbcSMatt Macy.It Sy f
221eda14cbcSMatt MacyDump ZFS plain file objects
222eda14cbcSMatt Macy.It Sy m
223eda14cbcSMatt MacyDump SPA space map objects
224eda14cbcSMatt Macy.It Sy z
225eda14cbcSMatt MacyDump ZAP objects
226eda14cbcSMatt Macy.It Sy -
227eda14cbcSMatt MacyNegate the effect of next flag
228eda14cbcSMatt Macy.El
229e92ffd9bSMartin Matuska.It Fl D , -dedup-stats
230eda14cbcSMatt MacyDisplay deduplication statistics, including the deduplication ratio
231eda14cbcSMatt Macy.Pq Sy dedup ,
232eda14cbcSMatt Macycompression ratio
233eda14cbcSMatt Macy.Pq Sy compress ,
234eda14cbcSMatt Macyinflation due to the zfs copies property
235eda14cbcSMatt Macy.Pq Sy copies ,
236eda14cbcSMatt Macyand an overall effective ratio
237c03c5b1cSMartin Matuska.Pq Sy dedup No \(mu Sy compress No / Sy copies .
238eda14cbcSMatt Macy.It Fl DD
239eda14cbcSMatt MacyDisplay a histogram of deduplication statistics, showing the allocated
240eda14cbcSMatt Macy.Pq physically present on disk
241eda14cbcSMatt Macyand referenced
242eda14cbcSMatt Macy.Pq logically referenced in the pool
243eda14cbcSMatt Macyblock counts and sizes by reference count.
244eda14cbcSMatt Macy.It Fl DDD
245eda14cbcSMatt MacyDisplay the statistics independently for each deduplication table.
246eda14cbcSMatt Macy.It Fl DDDD
247eda14cbcSMatt MacyDump the contents of the deduplication tables describing duplicate blocks.
248eda14cbcSMatt Macy.It Fl DDDDD
249eda14cbcSMatt MacyAlso dump the contents of the deduplication tables describing unique blocks.
250e92ffd9bSMartin Matuska.It Fl E , -embedded-block-pointer Ns = Ns Ar word0 : Ns Ar word1 Ns :…: Ns Ar word15
251eda14cbcSMatt MacyDecode and display block from an embedded block pointer specified by the
252eda14cbcSMatt Macy.Ar word
253eda14cbcSMatt Macyarguments.
254e92ffd9bSMartin Matuska.It Fl h , -history
255eda14cbcSMatt MacyDisplay pool history similar to
256eda14cbcSMatt Macy.Nm zpool Cm history ,
257eda14cbcSMatt Macybut include internal changes, transaction, and dataset information.
258e92ffd9bSMartin Matuska.It Fl i , -intent-logs
259eda14cbcSMatt MacyDisplay information about intent log
260eda14cbcSMatt Macy.Pq ZIL
261eda14cbcSMatt Macyentries relating to each dataset.
262eda14cbcSMatt MacyIf specified multiple times, display counts of each intent log transaction type.
263e92ffd9bSMartin Matuska.It Fl k , -checkpointed-state
264eda14cbcSMatt MacyExamine the checkpointed state of the pool.
265eda14cbcSMatt MacyNote, the on disk format of the pool is not reverted to the checkpointed state.
266e92ffd9bSMartin Matuska.It Fl l , -label Ns = Ns Ar device
267eda14cbcSMatt MacyRead the vdev labels and L2ARC header from the specified device.
268eda14cbcSMatt Macy.Nm Fl l
269eda14cbcSMatt Macywill return 0 if valid label was found, 1 if error occurred, and 2 if no valid
27016038816SMartin Matuskalabels were found.
27116038816SMartin MatuskaThe presence of L2ARC header is indicated by a specific
27216038816SMartin Matuskasequence (L2ARC_DEV_HDR_MAGIC).
27316038816SMartin MatuskaIf there is an accounting error in the size or the number of L2ARC log blocks
274eda14cbcSMatt Macy.Nm Fl l
27516038816SMartin Matuskawill return 1.
27616038816SMartin MatuskaEach unique configuration is displayed only once.
277eda14cbcSMatt Macy.It Fl ll Ar device
27816038816SMartin MatuskaIn addition display label space usage stats.
27916038816SMartin MatuskaIf a valid L2ARC header was found
280eda14cbcSMatt Macyalso display the properties of log blocks used for restoring L2ARC contents
281eda14cbcSMatt Macy(persistent L2ARC).
282eda14cbcSMatt Macy.It Fl lll Ar device
28316038816SMartin MatuskaDisplay every configuration, unique or not.
28416038816SMartin MatuskaIf a valid L2ARC header was found
285eda14cbcSMatt Macyalso display the properties of log entries in log blocks used for restoring
286eda14cbcSMatt MacyL2ARC contents (persistent L2ARC).
287eda14cbcSMatt Macy.Pp
288eda14cbcSMatt MacyIf the
289eda14cbcSMatt Macy.Fl q
290eda14cbcSMatt Macyoption is also specified, don't print the labels or the L2ARC header.
291eda14cbcSMatt Macy.Pp
292eda14cbcSMatt MacyIf the
293eda14cbcSMatt Macy.Fl u
29416038816SMartin Matuskaoption is also specified, also display the uberblocks on this device.
29516038816SMartin MatuskaSpecify multiple times to increase verbosity.
296e92ffd9bSMartin Matuska.It Fl L , -disable-leak-tracking
297eda14cbcSMatt MacyDisable leak detection and the loading of space maps.
298eda14cbcSMatt MacyBy default,
299eda14cbcSMatt Macy.Nm
300eda14cbcSMatt Macyverifies that all non-free blocks are referenced, which can be very expensive.
301e92ffd9bSMartin Matuska.It Fl m , -metaslabs
302eda14cbcSMatt MacyDisplay the offset, spacemap, free space of each metaslab, all the log
303eda14cbcSMatt Macyspacemaps and their obsolete entry statistics.
304eda14cbcSMatt Macy.It Fl mm
305eda14cbcSMatt MacyAlso display information about the on-disk free space histogram associated with
306eda14cbcSMatt Macyeach metaslab.
307eda14cbcSMatt Macy.It Fl mmm
308eda14cbcSMatt MacyDisplay the maximum contiguous free space, the in-core free space histogram, and
309eda14cbcSMatt Macythe percentage of free space in each space map.
310eda14cbcSMatt Macy.It Fl mmmm
311eda14cbcSMatt MacyDisplay every spacemap record.
312e92ffd9bSMartin Matuska.It Fl M , -metaslab-groups
313bb2d13b6SMartin MatuskaDisplay all "normal" vdev metaslab group information - per-vdev metaslab count,
314bb2d13b6SMartin Matuskafragmentation,
315681ce946SMartin Matuskaand free space histogram, as well as overall pool fragmentation and histogram.
316eda14cbcSMatt Macy.It Fl MM
317681ce946SMartin Matuska"Special" vdevs are added to -M's normal output.
318e92ffd9bSMartin MatuskaAlso display information about the maximum contiguous free space and the
319e92ffd9bSMartin Matuskapercentage of free space in each space map.
320e92ffd9bSMartin Matuska.It Fl MMM
321e92ffd9bSMartin MatuskaDisplay every spacemap record.
322e92ffd9bSMartin Matuska.It Fl N
323e92ffd9bSMartin MatuskaSame as
324e92ffd9bSMartin Matuska.Fl d
325e92ffd9bSMartin Matuskabut force zdb to interpret the
326c03c5b1cSMartin Matuska.Op Ar dataset Ns | Ns Ar objset-ID
327e92ffd9bSMartin Matuskain
328c03c5b1cSMartin Matuska.Op Ar poolname Ns Op / Ns Ar dataset Ns | Ns Ar objset-ID
329e92ffd9bSMartin Matuskaas a numeric objset ID.
33075e1fea6SMartin Matuska.It Fl O , -object-lookups Ns = Ns Ar dataset path
331eda14cbcSMatt MacyLook up the specified
332eda14cbcSMatt Macy.Ar path
333eda14cbcSMatt Macyinside of the
334eda14cbcSMatt Macy.Ar dataset
335eda14cbcSMatt Macyand display its metadata and indirect blocks.
336eda14cbcSMatt MacySpecified
337eda14cbcSMatt Macy.Ar path
338eda14cbcSMatt Macymust be relative to the root of
339eda14cbcSMatt Macy.Ar dataset .
340eda14cbcSMatt MacyThis option can be combined with
341eda14cbcSMatt Macy.Fl v
342eda14cbcSMatt Macyfor increasing verbosity.
343e92ffd9bSMartin Matuska.It Fl r , -copy-object Ns = Ns Ar dataset path destination
344184c1b94SMartin MatuskaCopy the specified
345184c1b94SMartin Matuska.Ar path
346184c1b94SMartin Matuskainside of the
347184c1b94SMartin Matuska.Ar dataset
348184c1b94SMartin Matuskato the specified destination.
349184c1b94SMartin MatuskaSpecified
350184c1b94SMartin Matuska.Ar path
351184c1b94SMartin Matuskamust be relative to the root of
352184c1b94SMartin Matuska.Ar dataset .
353184c1b94SMartin MatuskaThis option can be combined with
354184c1b94SMartin Matuska.Fl v
355184c1b94SMartin Matuskafor increasing verbosity.
356eda14cbcSMatt Macy.It Xo
357e92ffd9bSMartin Matuska.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
358eda14cbcSMatt Macy.Xc
359eda14cbcSMatt MacyRead and display a block from the specified device.
360eda14cbcSMatt MacyBy default the block is displayed as a hex dump, but see the description of the
361eda14cbcSMatt Macy.Sy r
362eda14cbcSMatt Macyflag, below.
363eda14cbcSMatt Macy.Pp
364eda14cbcSMatt MacyThe block is specified in terms of a colon-separated tuple
365eda14cbcSMatt Macy.Ar vdev
366eda14cbcSMatt Macy.Pq an integer vdev identifier
367eda14cbcSMatt Macy.Ar offset
368eda14cbcSMatt Macy.Pq the offset within the vdev
369eda14cbcSMatt Macy.Ar size
370eda14cbcSMatt Macy.Pq the physical size, or logical size / physical size
371eda14cbcSMatt Macyof the block to read and, optionally,
372eda14cbcSMatt Macy.Ar flags
373eda14cbcSMatt Macy.Pq a set of flags, described below .
374eda14cbcSMatt Macy.Pp
375eda14cbcSMatt Macy.Bl -tag -compact -width "b offset"
376eda14cbcSMatt Macy.It Sy b Ar offset
377eda14cbcSMatt MacyPrint block pointer at hex offset
378eda14cbcSMatt Macy.It Sy c
379eda14cbcSMatt MacyCalculate and display checksums
380eda14cbcSMatt Macy.It Sy d
38116038816SMartin MatuskaDecompress the block.
38216038816SMartin MatuskaSet environment variable
383eda14cbcSMatt Macy.Nm ZDB_NO_ZLE
384eda14cbcSMatt Macyto skip zle when guessing.
385eda14cbcSMatt Macy.It Sy e
386eda14cbcSMatt MacyByte swap the block
387eda14cbcSMatt Macy.It Sy g
388eda14cbcSMatt MacyDump gang block header
389eda14cbcSMatt Macy.It Sy i
390eda14cbcSMatt MacyDump indirect block
391eda14cbcSMatt Macy.It Sy r
392eda14cbcSMatt MacyDump raw uninterpreted block data
393eda14cbcSMatt Macy.It Sy v
394eda14cbcSMatt MacyVerbose output for guessing compression algorithm
395eda14cbcSMatt Macy.El
396e92ffd9bSMartin Matuska.It Fl s , -io-stats
397eda14cbcSMatt MacyReport statistics on
398eda14cbcSMatt Macy.Nm zdb
399eda14cbcSMatt MacyI/O.
400eda14cbcSMatt MacyDisplay operation counts, bandwidth, and error counts of I/O to the pool from
401eda14cbcSMatt Macy.Nm .
402e92ffd9bSMartin Matuska.It Fl S , -simulate-dedup
403eda14cbcSMatt MacySimulate the effects of deduplication, constructing a DDT and then display
404eda14cbcSMatt Macythat DDT as with
405eda14cbcSMatt Macy.Fl DD .
4062276e539SMartin Matuska.It Fl T , -brt-stats
4072276e539SMartin MatuskaDisplay block reference table (BRT) statistics, including the size of uniques
4082276e539SMartin Matuskablocks cloned, the space saving as a result of cloning, and the saving ratio.
4092276e539SMartin Matuska.It Fl TT
4102276e539SMartin MatuskaDisplay the per-vdev BRT statistics, including total references.
4112276e539SMartin Matuska.It Fl TTT
4125c65a0a9SMartin MatuskaDisplay histograms of per-vdev BRT refcounts.
4135c65a0a9SMartin Matuska.It Fl TTTT
4142276e539SMartin MatuskaDump the contents of the block reference tables.
415e92ffd9bSMartin Matuska.It Fl u , -uberblock
416eda14cbcSMatt MacyDisplay the current uberblock.
417eda14cbcSMatt Macy.El
418eda14cbcSMatt Macy.Pp
419eda14cbcSMatt MacyOther options:
420eda14cbcSMatt Macy.Bl -tag -width Ds
421e92ffd9bSMartin Matuska.It Fl A , -ignore-assertions
422eda14cbcSMatt MacyDo not abort should any assertion fail.
423eda14cbcSMatt Macy.It Fl AA
424eda14cbcSMatt MacyEnable panic recovery, certain errors which would otherwise be fatal are
425eda14cbcSMatt Macydemoted to warnings.
426eda14cbcSMatt Macy.It Fl AAA
427eda14cbcSMatt MacyDo not abort if asserts fail and also enable panic recovery.
428e92ffd9bSMartin Matuska.It Fl e , -exported Ns = Ns Oo Fl p Ar path Oc Ns …
429eda14cbcSMatt MacyOperate on an exported pool, not present in
430eda14cbcSMatt Macy.Pa /etc/zfs/zpool.cache .
431eda14cbcSMatt MacyThe
432eda14cbcSMatt Macy.Fl p
433eda14cbcSMatt Macyflag specifies the path under which devices are to be searched.
434e92ffd9bSMartin Matuska.It Fl x , -dump-blocks Ns = Ns Ar dumpdir
435eda14cbcSMatt MacyAll blocks accessed will be copied to files in the specified directory.
436eda14cbcSMatt MacyThe blocks will be placed in sparse files whose name is the same as
437eda14cbcSMatt Macythat of the file or device read.
438eda14cbcSMatt Macy.Nm
439eda14cbcSMatt Macycan be then run on the generated files.
440eda14cbcSMatt MacyNote that the
441eda14cbcSMatt Macy.Fl bbc
442eda14cbcSMatt Macyflags are sufficient to access
443eda14cbcSMatt Macy.Pq and thus copy
444eda14cbcSMatt Macyall metadata on the pool.
445e92ffd9bSMartin Matuska.It Fl F , -automatic-rewind
446eda14cbcSMatt MacyAttempt to make an unreadable pool readable by trying progressively older
447eda14cbcSMatt Macytransactions.
448e92ffd9bSMartin Matuska.It Fl G , -dump-debug-msg
449eda14cbcSMatt MacyDump the contents of the zfs_dbgmsg buffer before exiting
450eda14cbcSMatt Macy.Nm .
451eda14cbcSMatt Macyzfs_dbgmsg is a buffer used by ZFS to dump advanced debug information.
452c03c5b1cSMartin Matuska.It Fl I , -inflight Ns = Ns Ar inflight-I/O-ops
453c03c5b1cSMartin MatuskaLimit the number of outstanding checksum I/O operations to the specified value.
454eda14cbcSMatt MacyThe default value is 200.
455eda14cbcSMatt MacyThis option affects the performance of the
456eda14cbcSMatt Macy.Fl c
457eda14cbcSMatt Macyoption.
4582a58b312SMartin Matuska.It Fl K , -key Ns = Ns Ar key
4592a58b312SMartin MatuskaDecryption key needed to access an encrypted dataset.
4602a58b312SMartin MatuskaThis will cause
4612a58b312SMartin Matuska.Nm
4622a58b312SMartin Matuskato attempt to unlock the dataset using the encryption root, key format and other
4632a58b312SMartin Matuskaencryption parameters on the given dataset.
4642a58b312SMartin Matuska.Nm
4652a58b312SMartin Matuskacan still inspect pool and dataset structures on encrypted datasets without
4662a58b312SMartin Matuskaunlocking them, but will not be able to access file names and attributes and
4672a58b312SMartin Matuskaobject contents. \fBWARNING:\fP The raw decryption key and any decrypted data
4682a58b312SMartin Matuskawill be in user memory while
4692a58b312SMartin Matuska.Nm
4702a58b312SMartin Matuskais running.
4712a58b312SMartin MatuskaOther user programs may be able to extract it by inspecting
4722a58b312SMartin Matuska.Nm
4732a58b312SMartin Matuskaas it runs.
4742a58b312SMartin MatuskaExercise extreme caution when using this option in shared or uncontrolled
4752a58b312SMartin Matuskaenvironments.
476c03c5b1cSMartin Matuska.It Fl o , -option Ns = Ns Ar var Ns = Ns Ar value Ns …
477eda14cbcSMatt MacySet the given global libzpool variable to the provided value.
478eda14cbcSMatt MacyThe value must be an unsigned 32-bit integer.
479eda14cbcSMatt MacyCurrently only little-endian systems are supported to avoid accidentally setting
480eda14cbcSMatt Macythe high 32 bits of 64-bit variables.
481e92ffd9bSMartin Matuska.It Fl P , -parseable
48216038816SMartin MatuskaPrint numbers in an unscaled form more amenable to parsing, e.g.\&
48316038816SMartin Matuska.Sy 1000000
48416038816SMartin Matuskarather than
48516038816SMartin Matuska.Sy 1M .
486e92ffd9bSMartin Matuska.It Fl t , -txg Ns = Ns Ar transaction
487eda14cbcSMatt MacySpecify the highest transaction to use when searching for uberblocks.
488eda14cbcSMatt MacySee also the
489eda14cbcSMatt Macy.Fl u
490eda14cbcSMatt Macyand
491eda14cbcSMatt Macy.Fl l
492eda14cbcSMatt Macyoptions for a means to see the available uberblocks and their associated
493eda14cbcSMatt Macytransaction numbers.
494e92ffd9bSMartin Matuska.It Fl U , -cachefile Ns = Ns Ar cachefile
495eda14cbcSMatt MacyUse a cache file other than
496eda14cbcSMatt Macy.Pa /etc/zfs/zpool.cache .
497e92ffd9bSMartin Matuska.It Fl v , -verbose
498eda14cbcSMatt MacyEnable verbosity.
499eda14cbcSMatt MacySpecify multiple times for increased verbosity.
500e92ffd9bSMartin Matuska.It Fl V , -verbatim
501eda14cbcSMatt MacyAttempt verbatim import.
502eda14cbcSMatt MacyThis mimics the behavior of the kernel when loading a pool from a cachefile.
503eda14cbcSMatt MacyOnly usable with
504eda14cbcSMatt Macy.Fl e .
505e92ffd9bSMartin Matuska.It Fl X , -extreme-rewind
506eda14cbcSMatt MacyAttempt
507eda14cbcSMatt Macy.Qq extreme
508eda14cbcSMatt Macytransaction rewind, that is attempt the same recovery as
509eda14cbcSMatt Macy.Fl F
510eda14cbcSMatt Macybut read transactions otherwise deemed too old.
511e92ffd9bSMartin Matuska.It Fl Y , -all-reconstruction
512eda14cbcSMatt MacyAttempt all possible combinations when reconstructing indirect split blocks.
513eda14cbcSMatt MacyThis flag disables the individual I/O deadman timer in order to allow as
514eda14cbcSMatt Macymuch time as required for the attempted reconstruction.
515e92ffd9bSMartin Matuska.It Fl y , -livelist
516eda14cbcSMatt MacyPerform validation for livelists that are being deleted.
517eda14cbcSMatt MacyScans through the livelist and metaslabs, checking for duplicate entries
518eda14cbcSMatt Macyand compares the two, checking for potential double frees.
519eda14cbcSMatt MacyIf it encounters issues, warnings will be printed, but the command will not
520eda14cbcSMatt Macynecessarily fail.
521eda14cbcSMatt Macy.El
522eda14cbcSMatt Macy.Pp
523eda14cbcSMatt MacySpecifying a display option more than once enables verbosity for only that
524eda14cbcSMatt Macyoption, with more occurrences enabling more verbosity.
525eda14cbcSMatt Macy.Pp
526eda14cbcSMatt MacyIf no options are specified, all information about the named pool will be
527eda14cbcSMatt Macydisplayed at default verbosity.
52816038816SMartin Matuska.
529eda14cbcSMatt Macy.Sh EXAMPLES
530da5137abSMartin Matuska.Ss Example 1 : No Display the configuration of imported pool Ar rpool
531eda14cbcSMatt Macy.Bd -literal
53216038816SMartin Matuska.No # Nm zdb Fl C Ar rpool
533eda14cbcSMatt MacyMOS Configuration:
534eda14cbcSMatt Macy        version: 28
535eda14cbcSMatt Macy        name: 'rpool'
53616038816SMartin Matuska537eda14cbcSMatt Macy.Ed
538da5137abSMartin Matuska.
539da5137abSMartin Matuska.Ss Example 2 : No Display basic dataset information about Ar rpool
540eda14cbcSMatt Macy.Bd -literal
54116038816SMartin Matuska.No # Nm zdb Fl d Ar rpool
542eda14cbcSMatt MacyDataset mos [META], ID 0, cr_txg 4, 26.9M, 1051 objects
543eda14cbcSMatt MacyDataset rpool/swap [ZVOL], ID 59, cr_txg 356, 486M, 2 objects
54416038816SMartin Matuska545eda14cbcSMatt Macy.Ed
546da5137abSMartin Matuska.
547da5137abSMartin Matuska.Ss Example 3 : No Display basic information about object 0 in Ar rpool/export/home
548eda14cbcSMatt Macy.Bd -literal
54916038816SMartin Matuska.No # Nm zdb Fl d Ar rpool/export/home 0
550eda14cbcSMatt MacyDataset rpool/export/home [ZPL], ID 137, cr_txg 1546, 32K, 8 objects
551eda14cbcSMatt Macy
552eda14cbcSMatt Macy    Object  lvl   iblk   dblk  dsize  lsize   %full  type
553eda14cbcSMatt Macy         0    7    16K    16K  15.0K    16K   25.00  DMU dnode
554eda14cbcSMatt Macy.Ed
555da5137abSMartin Matuska.
556da5137abSMartin Matuska.Ss Example 4 : No Display the predicted effect of enabling deduplication on Ar rpool
557eda14cbcSMatt Macy.Bd -literal
55816038816SMartin Matuska.No # Nm zdb Fl S Ar rpool
559eda14cbcSMatt MacySimulated DDT histogram:
560eda14cbcSMatt Macy
561eda14cbcSMatt Macybucket              allocated                       referenced
562eda14cbcSMatt Macy______   ______________________________   ______________________________
563eda14cbcSMatt Macyrefcnt   blocks   LSIZE   PSIZE   DSIZE   blocks   LSIZE   PSIZE   DSIZE
564eda14cbcSMatt Macy------   ------   -----   -----   -----   ------   -----   -----   -----
565eda14cbcSMatt Macy     1     694K   27.1G   15.0G   15.0G     694K   27.1G   15.0G   15.0G
566eda14cbcSMatt Macy     2    35.0K   1.33G    699M    699M    74.7K   2.79G   1.45G   1.45G
56716038816SMartin Matuska568eda14cbcSMatt Macydedup = 1.11, compress = 1.80, copies = 1.00, dedup * compress / copies = 2.00
569eda14cbcSMatt Macy.Ed
57016038816SMartin Matuska.
571eda14cbcSMatt Macy.Sh SEE ALSO
572eda14cbcSMatt Macy.Xr zfs 8 ,
573eda14cbcSMatt Macy.Xr zpool 8
574