]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - cddl/contrib/opensolaris/cmd/zdb/zdb.8
MFC r324220:
[FreeBSD/stable/10.git] / cddl / contrib / opensolaris / cmd / zdb / zdb.8
1 '\" te
2 .\" Copyright (c) 2012, Martin Matuska <mm@FreeBSD.org>.
3 .\" All Rights Reserved.
4 .\"
5 .\" This file and its contents are supplied under the terms of the
6 .\" Common Development and Distribution License ("CDDL"), version 1.0.
7 .\" You may only use this file in accordance with the terms of version
8 .\" 1.0 of the CDDL.
9 .\"
10 .\" A full copy of the text of the CDDL should have accompanied this
11 .\" source.  A copy of the CDDL is also available via the Internet at
12 .\" http://www.illumos.org/license/CDDL.
13 .\"
14 .\"
15 .\" Copyright 2012, Richard Lowe.
16 .\" Copyright (c) 2012, Marcelo Araujo <araujo@FreeBSD.org>.
17 .\" Copyright (c) 2012, 2014 by Delphix. All rights reserved.
18 .\" All Rights Reserved.
19 .\"
20 .\" $FreeBSD$
21 .\"
22 .Dd July 26, 2014
23 .Dt ZDB 8
24 .Os
25 .Sh NAME
26 .Nm zdb
27 .Nd Display zpool debugging and consistency information
28 .Sh SYNOPSIS
29 .Nm
30 .Op Fl CumdibcsDvhLMXFPA
31 .Op Fl e Op Fl p Ar path...
32 .Op Fl t Ar txg
33 .Op Fl U Ar cache
34 .Op Fl I Ar inflight I/Os
35 .Op Fl x Ar dumpdir
36 .Op Fl o Ar var=value
37 .Ar poolname
38 .Op Ar object ...
39 .Nm
40 .Op Fl divPA
41 .Op Fl e Op Fl p Ar path...
42 .Op Fl U Ar cache
43 .Ar dataset
44 .Op Ar object ...
45 .Nm
46 .Fl m Op Fl MLXFPA
47 .Op Fl t Ar txg
48 .Op Fl e Op Fl p Ar path...
49 .Op Fl U Ar cache
50 .Ar poolname
51 .Nm
52 .Fl R Op Fl A
53 .Op Fl e Op Fl p Ar path...
54 .Op Fl U Ar cache
55 .Ar poolname
56 .Ar poolname
57 .Ar vdev Ns : Ns Ar offset Ns : Ns Ar size Ns Op Ns : Ns Ar flags
58 .Nm
59 .Fl S
60 .Op Fl AP
61 .Op Fl e Op Fl p Ar path...
62 .Op Fl U Ar cache
63 .Ar poolname
64 .Ar poolname
65 .Nm
66 .Fl l
67 .Op Fl uA
68 .Ar device
69 .Nm
70 .Fl C
71 .Op Fl A
72 .Op Fl U Ar cache
73 .Sh DESCRIPTION
74 The
75 .Nm
76 utility displays information about a ZFS pool useful for debugging and
77 performs some amount of consistency checking.
78 It is a not a general purpose tool and options (and facilities) may change.
79 This is neither a
80 .Xr fsck 8
81 nor a
82 .Xr fsdb 8
83 utility.
84 .Pp
85 The output of this command in general reflects the on-disk structure of a ZFS
86 pool, and is inherently unstable.
87 The precise output of most invocations is not documented, a knowledge of ZFS
88 internals is assumed.
89 .Pp
90 If the
91 .Ar dataset
92 argument does not contain any
93 .Sy /
94 or
95 .Sy @
96 characters, it is interpreted as a pool name.
97 The root dataset can be specified as
98 .Pa pool Ns Sy /
99 (pool name followed by a slash).
100 .Pp
101 When operating on an imported and active pool it is possible, though unlikely,
102 that zdb may interpret inconsistent pool data and behave erratically.
103 .Sh OPTIONS
104 Display options:
105 .Bl -tag -width indent
106 .It Fl b
107 Display statistics regarding the number, size (logical, physical and
108 allocated) and deduplication of blocks.
109 .It Fl c
110 Verify the checksum of all metadata blocks while printing block statistics
111 (see
112 .Fl b Ns ).
113 .Pp
114 If specified multiple times, verify the checksums of all blocks.
115 .It Fl C
116 Display information about the configuration. If specified with no other
117 options, instead display information about the cache file
118 .Po Pa /etc/zfs/zpool.cache Pc .
119 To specify the cache file to display, see
120 .Fl U
121 .Pp
122 If specified multiple times, and a pool name is also specified display both
123 the cached configuration and the on-disk configuration.
124 If specified multiple times with
125 .Fl e
126 also display the configuration that would be used were the pool to be
127 imported.
128 .It Fl d
129 Display information about datasets. Specified once, displays basic dataset
130 information: ID, create transaction, size, and object count.
131 .Pp
132 If specified multiple times provides greater and greater verbosity.
133 .Pp
134 If object IDs are specified, display information about those specific objects only.
135 .It Fl D
136 Display deduplication statistics, including the deduplication ratio (dedup),
137 compression ratio (compress), inflation due to the zfs copies property
138 (copies), and an overall effective ratio (dedup * compress / copies).
139 .Pp
140 If specified twice, display a histogram of deduplication statistics, showing
141 the allocated (physically present on disk) and referenced (logically
142 referenced in the pool) block counts and sizes by reference count.
143 .Pp
144 If specified a third time, display the statistics independently for each deduplication table.
145 .Pp
146 If specified a fourth time, dump the contents of the deduplication tables describing duplicate blocks.
147 .Pp
148 If specified a fifth time, also dump the contents of the deduplication tables describing unique blocks.
149 .It Fl h
150 Display pool history similar to
151 .Cm zpool history ,
152 but include internal changes, transaction, and dataset information.
153 .It Fl i
154 Display information about intent log (ZIL) entries relating to each
155 dataset.
156 If specified multiple times, display counts of each intent log transaction
157 type.
158 .It Fl l Ar device
159 Display the vdev labels from the specified device.
160 If the
161 .Fl u
162 option is also specified, also display the uberblocks on this device.
163 .It Fl L
164 Disable leak tracing and the loading of space maps.
165 By default,
166 .Nm
167 verifies that all non-free blocks are referenced, which can be very expensive.
168 .It Fl m
169 Display the offset, spacemap, and free space of each metaslab.
170 When specified twice, also display information about the on-disk free
171 space histogram associated with each metaslab. When specified three time,
172 display the maximum contiguous free space, the in-core free space histogram,
173 and the percentage of free space in each space map.  When specified
174 four times display every spacemap record.
175 .It Fl M
176 Display the offset, spacemap, and free space of each metaslab.
177 When specified twice, also display information about the maximum contiguous
178 free space and the percentage of free space in each space map.
179 When specified three times display every spacemap record.
180 .It Xo
181 .Fl R Ar poolname
182 .Ar vdev Ns : Ns Ar offset Ns : Ns Ar size Ns Op Ns : Ns Ar flags
183 .Xc
184 Read and display a block from the specified device. By default the block is
185 displayed as a hex dump, but see the description of the
186 .Fl r
187 flag, below.
188 .Pp
189 The block is specified in terms of a colon-separated tuple
190 .Ar vdev
191 (an integer vdev identifier)
192 .Ar offset
193 (the offset within the vdev)
194 .Ar size
195 (the size of the block to read) and, optionally,
196 .Ar flags
197 (a set of flags, described below).
198 .Bl -tag -width indent
199 .It Sy b offset
200 Print block pointer
201 .It Sy d
202 Decompress the block
203 .It Sy e
204 Byte swap the block
205 .It Sy g
206 Dump gang block header
207 .It Sy i
208 Dump indirect block
209 .It Sy r
210 Dump raw uninterpreted block data
211 .El
212 .It Fl s
213 Report statistics on
214 .Nm Ns 's
215 I/O.
216 Display operation counts, bandwidth, and error counts of I/O to the pool from
217 .Nm .
218 .It Fl S
219 Simulate the effects of deduplication, constructing a DDT and then display
220 that DDT as with \fB-DD\fR.
221 .It Fl u
222 Display the current uberblock.
223 .El
224 .Pp
225 Other options:
226 .Bl -tag -width indent
227 .It Fl A
228 Do not abort should any assertion fail.
229 .It Fl AA
230 Enable panic recovery, certain errors which would otherwise be fatal are
231 demoted to warnings.
232 .It Fl AAA
233 Do not abort if asserts fail and also enable panic recovery.
234 .It Fl e Op Fl p Ar path...
235 Operate on an exported pool, not present in
236 .Pa /etc/zfs/zpool.cache .
237 The
238 .Fl p
239 flag specifies the path under which devices are to be searched.
240 .It Fl x Ar dumpdir
241 All blocks accessed will be copied to files in the specified directory.
242 The blocks will be placed in sparse files whose name is the same as
243 that of the file or device read.  zdb can be then run on the generated files.
244 Note that the
245 .Fl bbc
246 flags are sufficient to access (and thus copy)
247 all metadata on the pool.
248 .It Fl F
249 Attempt to make an unreadable pool readable by trying progressively older
250 transactions.
251 .It Fl I Ar inflight I/Os
252 Limit the number of outstanding checksum I/Os to the specified value.
253 The default value is 200. This option affects the performance of the
254 .Fl c
255 option.
256 .It Fl o Ar var=value
257 Set the given global libzpool variable to the provided value. The value must be
258 an unsigned 32-bit integer. Currently only little-endian systems are supported
259 to avoid accidentally setting the high 32 bits of 64-bit variables.
260 .It Fl P
261 Print numbers in an unscaled form more amenable to parsing, eg. 1000000 rather
262 than 1M.
263 .It Fl t Ar transaction
264 Specify the highest transaction to use when searching for uberblocks.
265 See also the
266 .Fl u
267 and
268 .Fl l
269 options for a means to see the available uberblocks and their associated
270 transaction numbers.
271 .It Fl U Ar cachefile
272 Use a cache file other than
273 .Pa /boot/zfs/zpool.cache .
274 .It Fl v
275 Enable verbosity.
276 Specify multiple times for increased verbosity.
277 .It Fl X
278 Attempt
279 .Ql extreme
280 transaction rewind, that is attempt the same recovery as
281 .Fl F
282 but read transactions otherwise deemed too old.
283 .El
284 .Pp
285 Specifying a display option more than once enables verbosity for only that
286 option, with more occurrences enabling more verbosity.
287 .Pp
288 If no options are specified, all information about the named pool will be
289 displayed at default verbosity.
290 .Sh EXAMPLES
291 .Bl -tag -width 0n
292 .It Sy Example 1 Display the configuration of imported pool 'rpool'
293 .Bd -literal -offset 2n
294 .Li # Ic zdb -C rpool
295
296 MOS Configuration:
297         version: 28
298         name: 'rpool'
299  ...
300 .Ed
301 .It Sy Example 2 Display basic dataset information about 'rpool'
302 .Bd -literal -offset 2n
303 .Li # Ic zdb -d rpool
304 Dataset mos [META], ID 0, cr_txg 4, 26.9M, 1051 objects
305 Dataset rpool/swap [ZVOL], ID 59, cr_txg 356, 486M, 2 objects
306  ...
307 .Ed
308 .It Xo Sy Example 3 Display basic information about object 0 in
309 .Sy 'rpool/export/home'
310 .Xc
311 .Bd -literal -offset 2n
312 .Li # Ic zdb -d rpool/export/home 0
313 Dataset rpool/export/home [ZPL], ID 137, cr_txg 1546, 32K, 8 objects
314
315     Object  lvl   iblk   dblk  dsize  lsize   %full  type
316          0    7    16K    16K  15.0K    16K   25.00  DMU dnode
317 .Ed
318 .It Xo Sy Example 4 Display the predicted effect of enabling deduplication on
319 .Sy 'rpool'
320 .Xc
321 .Bd -literal -offset 2n
322 .Li # Ic zdb -S rpool
323 Simulated DDT histogram:
324
325 bucket             allocated                      referenced
326 ______  ______________________________  ______________________________
327 refcnt  blocks   LSIZE   PSIZE   DSIZE  blocks   LSIZE   PSIZE   DSIZE
328 ------  ------   -----   -----   -----  ------   -----   -----   -----
329      1    694K   27.1G   15.0G   15.0G    694K   27.1G   15.0G   15.0G
330      2   35.0K   1.33G    699M    699M   74.7K   2.79G   1.45G   1.45G
331  ...
332 dedup = 1.11, compress = 1.80, copies = 1.00, dedup * compress / copies = 2.00
333 .Ed
334 .El
335 .Sh SEE ALSO
336 .Xr zfs 8 ,
337 .Xr zpool 8
338 .Sh AUTHORS
339 This manual page is a
340 .Xr mdoc 7
341 reimplementation of the
342 .Tn illumos
343 manual page
344 .Em zdb(1M) ,
345 modified and customized for
346 .Fx
347 and licensed under the
348 Common Development and Distribution License
349 .Pq Tn CDDL .
350 .Pp
351 The
352 .Xr mdoc 7
353 implementation of this manual page was initially written by
354 .An Martin Matuska Aq mm@FreeBSD.org
355 and
356 .An Marcelo Araujo Aq araujo@FreeBSD.org .