]> git.proxmox.com Git - mirror_zfs-debian.git/blob - man/man8/zdb.8
Imported Upstream version 0.6.5.3
[mirror_zfs-debian.git] / man / man8 / zdb.8
1 '\" t
2 .\"
3 .\" This file and its contents are supplied under the terms of the
4 .\" Common Development and Distribution License ("CDDL"), version 1.0.
5 .\" You may only use this file in accordance with the terms of version
6 .\" 1.0 of the CDDL.
7 .\"
8 .\" A full copy of the text of the CDDL should have accompanied this
9 .\" source. A copy of the CDDL is also available via the Internet at
10 .\" http://www.illumos.org/license/CDDL.
11 .\"
12 .\"
13 .\" Copyright 2012, Richard Lowe.
14 .\" Copyright (c) 2012 by Delphix. All rights reserved.
15 .\"
16 .TH "ZDB" "8" "February 15, 2012" "" ""
17
18 .SH "NAME"
19 \fBzdb\fR - Display zpool debugging and consistency information
20
21 .SH "SYNOPSIS"
22 \fBzdb\fR [-CumdibcsDvhLMXFPA] [-e [-p \fIpath\fR...]] [-t \fItxg\fR]
23 [-U \fIcache\fR] [-I \fIinflight I/Os\fR]
24 [\fIpoolname\fR [\fIobject\fR ...]]
25
26 .P
27 \fBzdb\fR [-divPA] [-e [-p \fIpath\fR...]] [-U \fIcache\fR]
28 \fIdataset\fR [\fIobject\fR ...]
29
30 .P
31 \fBzdb\fR -m [-MLXFPA] [-t \fItxg\fR] [-e [-p \fIpath\fR...]] [-U \fIcache\fR]
32 \fIpoolname\fR [\fIvdev\fR [\fImetaslab\fR ...]]
33
34 .P
35 \fBzdb\fR -R [-A] [-e [-p \fIpath\fR...]] [-U \fIcache\fR] \fIpoolname\fR
36 \fIvdev\fR:\fIoffset\fR:\fIsize\fR[:\fIflags\fR]
37
38 .P
39 \fBzdb\fR -S [-AP] [-e [-p \fIpath\fR...]] [-U \fIcache\fR] \fIpoolname\fR
40
41 .P
42 \fBzdb\fR -l [-uA] \fIdevice\fR
43
44 .P
45 \fBzdb\fR -C [-A] [-U \fIcache\fR]
46
47 .SH "DESCRIPTION"
48 The \fBzdb\fR utility displays information about a ZFS pool useful for
49 debugging and performs some amount of consistency checking. It is a not a
50 general purpose tool and options (and facilities) may change. This is neither
51 a fsck(8) nor an fsdb(8) utility.
52
53 .P
54 The output of this command in general reflects the on-disk structure of a ZFS
55 pool, and is inherently unstable. The precise output of most invocations is
56 not documented, a knowledge of ZFS internals is assumed.
57
58 .P
59 If the \fIdataset\fR argument does not contain any \fB/\fR or \fB@\fR
60 characters, it is interpreted as a pool name. The root dataset can be
61 specified as \fIpool\fB/\fR (pool name followed by a slash).
62
63 .P
64 When operating on an imported and active pool it is possible, though unlikely,
65 that zdb may interpret inconsistent pool data and behave erratically.
66
67 .SH "OPTIONS"
68 Display options:
69
70 .sp
71 .ne 2
72 .na
73 \fB-b\fR
74 .ad
75 .sp .6
76 .RS 4n
77 Display statistics regarding the number, size (logical, physical and
78 allocated) and deduplication of blocks.
79 .RE
80
81 .sp
82 .ne 2
83 .na
84 \fB-c\fR
85 .ad
86 .sp .6
87 .RS 4n
88 Verify the checksum of all metadata blocks while printing block statistics
89 (see \fB-b\fR).
90 .sp
91 If specified multiple times, verify the checksums of all blocks.
92 .RE
93
94 .sp
95 .ne 2
96 .na
97 \fB-C\fR
98 .ad
99 .sp .6
100 .RS 4n
101 Display information about the configuration. If specified with no other
102 options, instead display information about the cache file
103 (\fB/etc/zfs/zpool.cache\fR). To specify the cache file to display, see
104 \fB-U\fR.
105 .P
106 If specified multiple times, and a pool name is also specified display both
107 the cached configuration and the on-disk configuration. If specified multiple
108 times with \fB-e\fR also display the configuration that would be used were the
109 pool to be imported.
110 .RE
111
112 .sp
113 .ne 2
114 .na
115 \fB-d\fR
116 .ad
117 .sp .6
118 .RS 4n
119 Display information about datasets. Specified once, displays basic dataset
120 information: ID, create transaction, size, and object count.
121 .sp
122 If specified multiple times provides greater and greater verbosity.
123 .sp
124 If object IDs are specified, display information about those specific objects only.
125 .RE
126
127 .sp
128 .ne 2
129 .na
130 \fB-D\fR
131 .ad
132 .sp .6
133 .RS 4n
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 .sp
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 .sp
142 If specified a third time, display the statistics independently for each deduplication table.
143 .sp
144 If specified a fourth time, dump the contents of the deduplication tables describing duplicate blocks.
145 .sp
146 If specified a fifth time, also dump the contents of the deduplication tables describing unique blocks.
147 .RE
148
149 .sp
150 .ne 2
151 .na
152 \fB-h\fR
153 .ad
154 .sp .6
155 .RS 4n
156 Display pool history similar to \fBzpool history\fR, but include internal
157 changes, transaction, and dataset information.
158 .RE
159
160 .sp
161 .ne 2
162 .na
163 \fB-i\fR
164 .ad
165 .sp .6
166 .RS 4n
167 Display information about intent log (ZIL) entries relating to each
168 dataset. If specified multiple times, display counts of each intent log
169 transaction type.
170 .RE
171
172 .sp
173 .ne 2
174 .na
175 \fB-l\fR \fIdevice\fR
176 .ad
177 .sp .6
178 .RS 4n
179 Display the vdev labels from the specified device. If the \fB-u\fR option is
180 also specified, also display the uberblocks on this device.
181 .RE
182
183 .sp
184 .ne 2
185 .na
186 \fB-L\fR
187 .ad
188 .sp .6
189 .RS 4n
190 Disable leak tracing and the loading of space maps. By default, \fBzdb\fR
191 verifies that all non-free blocks are referenced, which can be very expensive.
192 .RE
193
194 .sp
195 .ne 2
196 .na
197 \fB-m\fR
198 .ad
199 .sp .6
200 .RS 4n
201 Display the offset, spacemap, and free space of each metaslab.
202 When specified twice, also display information about the on-disk free
203 space histogram associated with each metaslab. When specified three time,
204 display the maximum contiguous free space, the in-core free space histogram,
205 and the percentage of free space in each space map. When specified
206 four times display every spacemap record.
207 .RE
208
209 .sp
210 .ne 2
211 .na
212 \fB-M\fR
213 .ad
214 .sp .6
215 .RS 4n
216 Display the offset, spacemap, and free space of each metaslab.
217 When specified twice, also display information about the maximum contiguous
218 free space and the percentage of free space in each space map. When specified
219 three times display every spacemap record.
220 .RE
221
222 .sp
223 .ne 2
224 .na
225 \fB-R\fR \fIpoolname\fR \fIvdev\fR:\fIoffset\fR:\fIsize\fR[:\fIflags\fR]
226 .ad
227 .sp .6
228 .RS 4n
229 Read and display a block from the specified device. By default the block is
230 displayed as a hex dump, but see the description of the \'r\' flag, below.
231 .sp
232 The block is specified in terms of a colon-separated tuple \fIvdev\fR (an
233 integer vdev identifier) \fIoffset\fR (the offset within the vdev) \fIsize\fR
234 (the size of the block to read) and, optionally, \fIflags\fR (a set of flags,
235 described below).
236
237 .sp
238 .ne 2
239 .na
240 \fBb\fR \fIoffset\fR
241 .ad
242 .sp .6
243 .RS 4n
244 Print block pointer
245 .RE
246
247 .sp
248 .ne 2
249 .na
250 \fBd\fR
251 .ad
252 .sp .6
253 .RS 4n
254 Decompress the block
255 .RE
256
257 .sp
258 .ne 2
259 .na
260 \fBe\fR
261 .ad
262 .sp .6
263 .RS 4n
264 Byte swap the block
265 .RE
266
267 .sp
268 .ne 2
269 .na
270 \fBg\fR
271 .ad
272 .sp .6
273 .RS 4n
274 Dump gang block header
275 .RE
276
277 .sp
278 .ne 2
279 .na
280 \fBi\fR
281 .ad
282 .sp .6
283 .RS 4n
284 Dump indirect block
285 .RE
286
287 .sp
288 .ne 2
289 .na
290 \fBr\fR
291 .ad
292 .sp .6
293 .RS 4n
294 Dump raw uninterpreted block data
295 .RE
296 .RE
297
298 .sp
299 .ne 2
300 .na
301 \fB-s\fR
302 .ad
303 .sp .6
304 .RS 4n
305 Report statistics on \fBzdb\fR\'s I/O. Display operation counts, bandwidth,
306 and error counts of I/O to the pool from \fBzdb\fR.
307 .RE
308
309 .sp
310 .ne 2
311 .na
312 \fB-S\fR
313 .ad
314 .sp .6
315 .RS 4n
316 Simulate the effects of deduplication, constructing a DDT and then display
317 that DDT as with \fB-DD\fR.
318 .RE
319
320 .sp
321 .ne 2
322 .na
323 \fB-u\fR
324 .ad
325 .sp .6
326 .RS 4n
327 Display the current uberblock.
328 .RE
329
330 .P
331 Other options:
332
333 .sp
334 .ne 2
335 .na
336 \fB-A\fR
337 .ad
338 .sp .6
339 .RS 4n
340 Do not abort should any assertion fail.
341 .RE
342
343 .sp
344 .ne 2
345 .na
346 \fB-AA\fR
347 .ad
348 .sp .6
349 .RS 4n
350 Enable panic recovery, certain errors which would otherwise be fatal are
351 demoted to warnings.
352 .RE
353
354 .sp
355 .ne 2
356 .na
357 \fB-AAA\fR
358 .ad
359 .sp .6
360 .RS 4n
361 Do not abort if asserts fail and also enable panic recovery.
362 .RE
363
364 .sp
365 .ne 2
366 .na
367 \fB-e\fR [-p \fIpath\fR]...
368 .ad
369 .sp .6
370 .RS 4n
371 Operate on an exported pool, not present in \fB/etc/zfs/zpool.cache\fR. The
372 \fB-p\fR flag specifies the path under which devices are to be searched.
373 .RE
374
375 .sp
376 .ne 2
377 .na
378 \fB-F\fR
379 .ad
380 .sp .6
381 .RS 4n
382 Attempt to make an unreadable pool readable by trying progressively older
383 transactions.
384 .RE
385
386 .sp
387 .ne 2
388 .na
389 \fB-I \fIinflight I/Os\fR \fR
390 .ad
391 .sp .6
392 .RS 4n
393 Limit the number of outstanding checksum I/Os to the specified value. The
394 default value is 200. This option affects the performance of the \fB-c\fR
395 option.
396 .RE
397
398 .sp
399 .ne 2
400 .na
401 \fB-P\fR
402 .ad
403 .sp .6
404 .RS 4n
405 Print numbers in an unscaled form more amenable to parsing, eg. 1000000 rather
406 than 1M.
407 .RE
408
409 .sp
410 .ne 2
411 .na
412 \fB-t\fR \fItransaction\fR
413 .ad
414 .sp .6
415 .RS 4n
416 Specify the highest transaction to use when searching for uberblocks. See also
417 the \fB-u\fR and \fB-l\fR options for a means to see the available uberblocks
418 and their associated transaction numbers.
419 .RE
420
421 .sp
422 .ne 2
423 .na
424 \fB-U\fR \fIcachefile\fR
425 .ad
426 .sp .6
427 .RS 4n
428 Use a cache file other than \fB/etc/zfs/zpool.cache\fR.
429 .RE
430
431 .sp
432 .ne 2
433 .na
434 \fB-v\fR
435 .ad
436 .sp .6
437 .RS 4n
438 Enable verbosity. Specify multiple times for increased verbosity.
439 .RE
440
441 .sp
442 .ne 2
443 .na
444 \fB-X\fR
445 .ad
446 .sp .6
447 .RS 4n
448 Attempt \'extreme\' transaction rewind, that is attempt the same recovery as
449 \fB-F\fR but read transactions otherwise deemed too old.
450 .RE
451
452 .sp
453 .ne 2
454 .na
455 \fB-V\fR
456 .ad
457 .sp .6
458 .RS 4n
459 Attempt a verbatim import. This mimics the behavior of the kernel when loading
460 a pool from a cachefile.
461 .RE
462
463 .P
464 Specifying a display option more than once enables verbosity for only that
465 option, with more occurrences enabling more verbosity.
466 .P
467 If no options are specified, all information about the named pool will be
468 displayed at default verbosity.
469
470 .SH "EXAMPLES"
471 .LP
472 \fBExample 1 \fRDisplay the configuration of imported pool 'rpool'
473 .sp
474 .in +2
475 .nf
476 # zdb -C rpool
477
478 MOS Configuration:
479 version: 28
480 name: 'rpool'
481 ...
482 .fi
483 .in -2
484 .sp
485
486 .LP
487 \fBExample 2 \fRDisplay basic dataset information about 'rpool'
488 .sp
489 .in +2
490 .nf
491 # zdb -d rpool
492 Dataset mos [META], ID 0, cr_txg 4, 26.9M, 1051 objects
493 Dataset rpool/swap [ZVOL], ID 59, cr_txg 356, 486M, 2 objects
494 ...
495 .fi
496 .in -2
497 .sp
498
499 .LP
500 \fBExample 3 \fRDisplay basic information about object 0
501 in 'rpool/export/home'
502 .sp
503 .in +2
504 .nf
505 # zdb -d rpool/export/home 0
506 Dataset rpool/export/home [ZPL], ID 137, cr_txg 1546, 32K, 8 objects
507
508 Object lvl iblk dblk dsize lsize %full type
509 0 7 16K 16K 15.0K 16K 25.00 DMU dnode
510 .fi
511 .in -2
512 .sp
513
514 .LP
515 \fBExample 4 \fRDisplay the predicted effect of enabling deduplication on 'rpool'
516 .sp
517 .in +2
518 .nf
519 # zdb -S rpool
520 Simulated DDT histogram:
521
522 bucket allocated referenced
523 ______ ______________________________ ______________________________
524 refcnt blocks LSIZE PSIZE DSIZE blocks LSIZE PSIZE DSIZE
525 ------ ------ ----- ----- ----- ------ ----- ----- -----
526 1 694K 27.1G 15.0G 15.0G 694K 27.1G 15.0G 15.0G
527 2 35.0K 1.33G 699M 699M 74.7K 2.79G 1.45G 1.45G
528 ...
529 dedup = 1.11, compress = 1.80, copies = 1.00, dedup * compress / copies = 2.00
530 .fi
531 .in -2
532 .sp
533
534 .SH "ENVIRONMENT VARIABLES"
535 .TP
536 .B "SPA_CONFIG_PATH"
537 Override the default \fBspa_config_path\fR (\fI/etc/zfs/zpool.cache\fR) setting. If \fB-U\fR flag is specified it will override this environment variable settings once again.
538
539 .SH "SEE ALSO"
540 zfs(8), zpool(8)