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