]> git.proxmox.com Git - mirror_zfs.git/blame - man/man8/zdb.8
Update zdb.8's fsck reference
[mirror_zfs.git] / man / man8 / zdb.8
CommitLineData
dd4769ad
RL
1.\"
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
5.\" 1.0 of the CDDL.
6.\"
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.
10.\"
11.\"
12.\" Copyright 2012, Richard Lowe.
21e7cf5d 13.\" Copyright (c) 2012, 2018 by Delphix. All rights reserved.
a44e7faa
BB
14.\" Copyright 2017 Nexenta Systems, Inc.
15.\" Copyright (c) 2017 Lawrence Livermore National Security, LLC.
16.\" Copyright (c) 2017 Intel Corporation.
dd4769ad 17.\"
a896468c 18.Dd April 14, 2017
a44e7faa
BB
19.Dt ZDB 8 SMM
20.Os Linux
21.Sh NAME
22.Nm zdb
23.Nd display zpool debugging and consistency information
24.Sh SYNOPSIS
25.Nm
64bdf63f 26.Op Fl AbcdDFGhikLMPsvXY
06675310 27.Op Fl e Oo Fl V Oc Op Fl p Ar path ...
a44e7faa
BB
28.Op Fl I Ar inflight I/Os
29.Oo Fl o Ar var Ns = Ns Ar value Oc Ns ...
30.Op Fl t Ar txg
31.Op Fl U Ar cache
32.Op Fl x Ar dumpdir
33.Op Ar poolname Op Ar object ...
34.Nm
35.Op Fl AdiPv
06675310 36.Op Fl e Oo Fl V Oc Op Fl p Ar path ...
a44e7faa
BB
37.Op Fl U Ar cache
38.Ar dataset Op Ar object ...
39.Nm
40.Fl C
41.Op Fl A
42.Op Fl U Ar cache
43.Nm
a896468c
MA
44.Fl E
45.Op Fl A
d7323e79 46.Ar word0 Ns \&: Ns Ar word1 Ns :...: Ns Ar word15
a896468c 47.Nm
a44e7faa
BB
48.Fl l
49.Op Fl Aqu
50.Ar device
51.Nm
52.Fl m
64bdf63f 53.Op Fl AFLPXY
06675310 54.Op Fl e Oo Fl V Oc Op Fl p Ar path ...
a44e7faa 55.Op Fl t Ar txg
a44e7faa
BB
56.Op Fl U Ar cache
57.Ar poolname Op Ar vdev Op Ar metaslab ...
58.Nm
59.Fl O
60.Ar dataset path
61.Nm
62.Fl R
63.Op Fl A
06675310 64.Op Fl e Oo Fl V Oc Op Fl p Ar path ...
a44e7faa 65.Op Fl U Ar cache
d7323e79 66.Ar poolname vdev Ns \&: Ns Ar offset Ns \&: Ns Ar size Ns Op : Ns Ar flags
a44e7faa
BB
67.Nm
68.Fl S
69.Op Fl AP
06675310 70.Op Fl e Oo Fl V Oc Op Fl p Ar path ...
a44e7faa
BB
71.Op Fl U Ar cache
72.Ar poolname
73.Sh DESCRIPTION
74The
75.Nm
76utility displays information about a ZFS pool useful for debugging and performs
77some amount of consistency checking.
78It is a not a general purpose tool and options
79.Pq and facilities
80may change.
c349137a
RL
81This is not a
82.Xr fsck 8
a44e7faa
BB
83utility.
84.Pp
dd4769ad 85The output of this command in general reflects the on-disk structure of a ZFS
a44e7faa
BB
86pool, and is inherently unstable.
87The precise output of most invocations is not documented, a knowledge of ZFS
88internals is assumed.
89.Pp
90If the
91.Ar dataset
92argument does not contain any
93.Qq Sy /
94or
95.Qq Sy @
96characters, it is interpreted as a pool name.
97The root dataset can be specified as
98.Ar pool Ns /
99.Pq pool name followed by a slash .
100.Pp
dd4769ad
RL
101When operating on an imported and active pool it is possible, though unlikely,
102that zdb may interpret inconsistent pool data and behave erratically.
a44e7faa 103.Sh OPTIONS
dd4769ad 104Display options:
a44e7faa
BB
105.Bl -tag -width Ds
106.It Fl b
107Display statistics regarding the number, size
108.Pq logical, physical and allocated
109and deduplication of blocks.
110.It Fl c
dd4769ad 111Verify the checksum of all metadata blocks while printing block statistics
a44e7faa
BB
112.Po see
113.Fl b
114.Pc .
115.Pp
dd4769ad 116If specified multiple times, verify the checksums of all blocks.
a44e7faa
BB
117.It Fl C
118Display information about the configuration.
119If specified with no other options, instead display information about the cache
120file
121.Pq Pa /etc/zfs/zpool.cache .
122To specify the cache file to display, see
123.Fl U .
124.Pp
125If specified multiple times, and a pool name is also specified display both the
126cached configuration and the on-disk configuration.
127If specified multiple times with
128.Fl e
129also display the configuration that would be used were the pool to be imported.
130.It Fl d
131Display information about datasets.
132Specified once, displays basic dataset information: ID, create transaction,
133size, and object count.
134.Pp
dd4769ad 135If specified multiple times provides greater and greater verbosity.
a44e7faa
BB
136.Pp
137If object IDs are specified, display information about those specific objects
138only.
139.It Fl D
140Display deduplication statistics, including the deduplication ratio
141.Pq Sy dedup ,
142compression ratio
143.Pq Sy compress ,
144inflation due to the zfs copies property
145.Pq Sy copies ,
146and an overall effective ratio
147.Pq Sy dedup No * Sy compress No / Sy copies .
148.It Fl DD
149Display a histogram of deduplication statistics, showing the allocated
150.Pq physically present on disk
151and referenced
152.Pq logically referenced in the pool
153block counts and sizes by reference count.
154.It Fl DDD
155Display the statistics independently for each deduplication table.
156.It Fl DDDD
157Dump the contents of the deduplication tables describing duplicate blocks.
158.It Fl DDDDD
159Also dump the contents of the deduplication tables describing unique blocks.
d7323e79 160.It Fl E Ar word0 Ns \&: Ns Ar word1 Ns :...: Ns Ar word15
a896468c
MA
161Decode and display block from an embedded block pointer specified by the
162.Ar word
163arguments.
a44e7faa
BB
164.It Fl h
165Display pool history similar to
166.Nm zpool Cm history ,
167but include internal changes, transaction, and dataset information.
168.It Fl i
169Display information about intent log
170.Pq ZIL
171entries relating to each dataset.
172If specified multiple times, display counts of each intent log transaction type.
d2734cce
SD
173.It Fl k
174Examine the checkpointed state of the pool.
175Note, the on disk format of the pool is not reverted to the checkpointed state.
a44e7faa
BB
176.It Fl l Ar device
177Read the vdev labels from the specified device.
178.Nm Fl l
179will return 0 if valid label was found, 1 if error occurred, and 2 if no valid
180labels were found. Each unique configuration is displayed only once.
181.It Fl ll Ar device
182In addition display label space usage stats.
183.It Fl lll Ar device
184Display every configuration, unique or not.
185.Pp
186If the
187.Fl q
188option is also specified, don't print the labels.
189.Pp
190If the
191.Fl u
192option is also specified, also display the uberblocks on this device. Specify
193multiple times to increase verbosity.
194.It Fl L
21e7cf5d 195Disable leak detection and the loading of space maps.
a44e7faa
BB
196By default,
197.Nm
dd4769ad 198verifies that all non-free blocks are referenced, which can be very expensive.
a44e7faa 199.It Fl m
dd4769ad 200Display the offset, spacemap, and free space of each metaslab.
a44e7faa
BB
201.It Fl mm
202Also display information about the on-disk free space histogram associated with
203each metaslab.
204.It Fl mmm
205Display the maximum contiguous free space, the in-core free space histogram, and
206the percentage of free space in each space map.
207.It Fl mmmm
208Display every spacemap record.
209.It Fl M
f3a7f661 210Display the offset, spacemap, and free space of each metaslab.
a44e7faa
BB
211.It Fl MM
212Also display information about the maximum contiguous free space and the
213percentage of free space in each space map.
214.It Fl MMM
215Display every spacemap record.
216.It Fl O Ar dataset path
217Look up the specified
218.Ar path
219inside of the
220.Ar dataset
221and display its metadata and indirect blocks.
222Specified
223.Ar path
224must be relative to the root of
225.Ar dataset .
226This option can be combined with
227.Fl v
228for increasing verbosity.
d7323e79
GDN
229.It Xo
230.Fl R Ar poolname vdev Ns \&: Ns Ar offset Ns \&: Ns Ar size Ns Op : Ns Ar flags
231.Xc
a44e7faa
BB
232Read and display a block from the specified device.
233By default the block is displayed as a hex dump, but see the description of the
234.Sy r
235flag, below.
236.Pp
237The block is specified in terms of a colon-separated tuple
238.Ar vdev
239.Pq an integer vdev identifier
240.Ar offset
241.Pq the offset within the vdev
242.Ar size
243.Pq the size of the block to read
244and, optionally,
245.Ar flags
246.Pq a set of flags, described below .
247.Pp
248.Bl -tag -compact -width "b offset"
249.It Sy b Ar offset
dd4769ad 250Print block pointer
a44e7faa 251.It Sy d
950e17c2
CC
252Decompress the block. Set environment variable
253.Nm ZBD_NO_ZLE
254to skip zle when guessing.
a44e7faa 255.It Sy e
dd4769ad 256Byte swap the block
a44e7faa 257.It Sy g
dd4769ad 258Dump gang block header
a44e7faa 259.It Sy i
dd4769ad 260Dump indirect block
a44e7faa 261.It Sy r
dd4769ad 262Dump raw uninterpreted block data
a44e7faa
BB
263.El
264.It Fl s
265Report statistics on
266.Nm zdb
267I/O.
268Display operation counts, bandwidth, and error counts of I/O to the pool from
269.Nm .
270.It Fl S
dd4769ad 271Simulate the effects of deduplication, constructing a DDT and then display
a44e7faa
BB
272that DDT as with
273.Fl DD .
274.It Fl u
dd4769ad 275Display the current uberblock.
a44e7faa
BB
276.El
277.Pp
dd4769ad 278Other options:
a44e7faa
BB
279.Bl -tag -width Ds
280.It Fl A
dd4769ad 281Do not abort should any assertion fail.
a44e7faa 282.It Fl AA
dd4769ad
RL
283Enable panic recovery, certain errors which would otherwise be fatal are
284demoted to warnings.
a44e7faa 285.It Fl AAA
dd4769ad 286Do not abort if asserts fail and also enable panic recovery.
a44e7faa
BB
287.It Fl e Op Fl p Ar path ...
288Operate on an exported pool, not present in
289.Pa /etc/zfs/zpool.cache .
290The
291.Fl p
292flag specifies the path under which devices are to be searched.
293.It Fl x Ar dumpdir
9867e8be
MA
294All blocks accessed will be copied to files in the specified directory.
295The blocks will be placed in sparse files whose name is the same as
a44e7faa
BB
296that of the file or device read.
297.Nm
298can be then run on the generated files.
299Note that the
300.Fl bbc
301flags are sufficient to access
302.Pq and thus copy
9867e8be 303all metadata on the pool.
a44e7faa 304.It Fl F
dd4769ad
RL
305Attempt to make an unreadable pool readable by trying progressively older
306transactions.
a44e7faa
BB
307.It Fl G
308Dump the contents of the zfs_dbgmsg buffer before exiting
309.Nm .
310zfs_dbgmsg is a buffer used by ZFS to dump advanced debug information.
311.It Fl I Ar inflight I/Os
312Limit the number of outstanding checksum I/Os to the specified value.
313The default value is 200.
314This option affects the performance of the
315.Fl c
5853fe79 316option.
a44e7faa
BB
317.It Fl o Ar var Ns = Ns Ar value ...
318Set the given global libzpool variable to the provided value.
319The value must be an unsigned 32-bit integer.
320Currently only little-endian systems are supported to avoid accidentally setting
321the high 32 bits of 64-bit variables.
322.It Fl P
dd4769ad
RL
323Print numbers in an unscaled form more amenable to parsing, eg. 1000000 rather
324than 1M.
a44e7faa
BB
325.It Fl t Ar transaction
326Specify the highest transaction to use when searching for uberblocks.
327See also the
328.Fl u
329and
330.Fl l
331options for a means to see the available uberblocks and their associated
332transaction numbers.
333.It Fl U Ar cachefile
334Use a cache file other than
335.Pa /etc/zfs/zpool.cache .
336.It Fl v
337Enable verbosity.
338Specify multiple times for increased verbosity.
339.It Fl V
06675310
RY
340Attempt verbatim import.
341This mimics the behavior of the kernel when loading a pool from a cachefile.
342Only usable with
343.Fl e .
a44e7faa
BB
344.It Fl X
345Attempt
346.Qq extreme
347transaction rewind, that is attempt the same recovery as
348.Fl F
349but read transactions otherwise deemed too old.
64bdf63f
BB
350.It Fl Y
351Attempt all possible combinations when reconstructing indirect split blocks.
352This flag disables the individual I/O deadman timer in order to allow as
353much time as required for the attempted reconstruction.
a44e7faa
BB
354.El
355.Pp
dd4769ad
RL
356Specifying a display option more than once enables verbosity for only that
357option, with more occurrences enabling more verbosity.
a44e7faa 358.Pp
dd4769ad
RL
359If no options are specified, all information about the named pool will be
360displayed at default verbosity.
a44e7faa
BB
361.Sh EXAMPLES
362.Bl -tag -width Ds
363.It Xo
364.Sy Example 1
365Display the configuration of imported pool
366.Pa rpool
367.Xc
368.Bd -literal
dd4769ad
RL
369# zdb -C rpool
370
371MOS Configuration:
372 version: 28
373 name: 'rpool'
374 ...
a44e7faa
BB
375.Ed
376.It Xo
377.Sy Example 2
378Display basic dataset information about
379.Pa rpool
380.Xc
381.Bd -literal
dd4769ad
RL
382# zdb -d rpool
383Dataset mos [META], ID 0, cr_txg 4, 26.9M, 1051 objects
384Dataset rpool/swap [ZVOL], ID 59, cr_txg 356, 486M, 2 objects
385 ...
a44e7faa
BB
386.Ed
387.It Xo
388.Sy Example 3
389Display basic information about object 0 in
390.Pa rpool/export/home
391.Xc
392.Bd -literal
dd4769ad
RL
393# zdb -d rpool/export/home 0
394Dataset rpool/export/home [ZPL], ID 137, cr_txg 1546, 32K, 8 objects
395
396 Object lvl iblk dblk dsize lsize %full type
397 0 7 16K 16K 15.0K 16K 25.00 DMU dnode
a44e7faa
BB
398.Ed
399.It Xo
400.Sy Example 4
401Display the predicted effect of enabling deduplication on
402.Pa rpool
403.Xc
404.Bd -literal
dd4769ad
RL
405# zdb -S rpool
406Simulated DDT histogram:
407
6b4e21c6 408bucket allocated referenced
dd4769ad
RL
409______ ______________________________ ______________________________
410refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE
411------ ------ ----- ----- ----- ------ ----- ----- -----
412 1 694K 27.1G 15.0G 15.0G 694K 27.1G 15.0G 15.0G
413 2 35.0K 1.33G 699M 699M 74.7K 2.79G 1.45G 1.45G
414 ...
415dedup = 1.11, compress = 1.80, copies = 1.00, dedup * compress / copies = 2.00
a44e7faa
BB
416.Ed
417.El
418.Sh SEE ALSO
419.Xr zfs 8 ,
420.Xr zpool 8