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