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