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