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