6324 Add an `ndp' tool for manipulating the neighbors table
[illumos-gate.git] / usr / src / man / man1m / zdb.1m
blob7ec98908f625a509f1a750f063dac7207487d53d
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, 2014 by Delphix. All rights reserved.
15 .\"
16 .TH "ZDB" "1M" "March 6, 2014" "" ""
18 .SH "NAME"
19 \fBzdb\fR - Display zpool debugging and consistency information
21 .SH "SYNOPSIS"
22 \fBzdb\fR [-CumdibcsDvhLMXFPA] [-e [-p \fIpath\fR...]] [-t \fItxg\fR]
23     [-U \fIcache\fR] [-I \fIinflight I/Os\fR] [-x \fIdumpdir\fR]
24     [\fIpoolname\fR [\fIobject\fR ...]]
27 \fBzdb\fR [-divPA] [-e [-p \fIpath\fR...]] [-U \fIcache\fR]
28     \fIdataset\fR [\fIobject\fR ...]
31 \fBzdb\fR -m [-MLXFPA] [-t \fItxg\fR] [-e [-p \fIpath\fR...]] [-U \fIcache\fR]
32     \fIpoolname\fR [\fIvdev\fR [\fImetaslab\fR ...]]
35 \fBzdb\fR -R [-A] [-e [-p \fIpath\fR...]] [-U \fIcache\fR] \fIpoolname\fR
36     \fIvdev\fR:\fIoffset\fR:\fIsize\fR[:\fIflags\fR]
39 \fBzdb\fR -S [-AP] [-e [-p \fIpath\fR...]] [-U \fIcache\fR] \fIpoolname\fR
42 \fBzdb\fR -l [-uA] \fIdevice\fR
45 \fBzdb\fR -C [-A] [-U \fIcache\fR]
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(1M) nor an fsdb(1M) utility.
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.
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.
62 .SH "OPTIONS"
63 Display options:
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
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
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.
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.
108 .ne 2
110 \fB-d\fR
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.
117 If specified multiple times provides greater and greater verbosity.
119 If object IDs are specified, display information about those specific objects only.
123 .ne 2
125 \fB-D\fR
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).
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.
137 If specified a third time, display the statistics independently for each deduplication table.
139 If specified a fourth time, dump the contents of the deduplication tables describing duplicate blocks.
141 If specified a fifth time, also dump the contents of the deduplication tables describing unique blocks.
145 .ne 2
147 \fB-h\fR
149 .sp .6
150 .RS 4n
151 Display pool history similar to \fBzpool history\fR, but include internal
152 changes, transaction, and dataset information.
156 .ne 2
158 \fB-i\fR
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.
168 .ne 2
170 \fB-l\fR \fIdevice\fR
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.
179 .ne 2
181 \fB-L\fR
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.
190 .ne 2
192 \fB-m\fR
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.
205 .ne 2
207 \fB-M\fR
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.
218 .ne 2
220 \fB-R\fR \fIpoolname\fR \fIvdev\fR:\fIoffset\fR:\fIsize\fR[:\fIflags\fR]
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.
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).
233 .ne 2
235 \fBb\fR \fIoffset\fR
237 .sp .6
238 .RS 4n
239 Print block pointer
243 .ne 2
245 \fBd\fR
247 .sp .6
248 .RS 4n
249 Decompress the block
253 .ne 2
255 \fBe\fR
257 .sp .6
258 .RS 4n
259 Byte swap the block
263 .ne 2
265 \fBg\fR
267 .sp .6
268 .RS 4n
269 Dump gang block header
273 .ne 2
275 \fBi\fR
277 .sp .6
278 .RS 4n
279 Dump indirect block
283 .ne 2
285 \fBr\fR
287 .sp .6
288 .RS 4n
289 Dump raw uninterpreted block data
294 .ne 2
296 \fB-s\fR
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.
305 .ne 2
307 \fB-S\fR
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.
316 .ne 2
318 \fB-u\fR
320 .sp .6
321 .RS 4n
322 Display the current uberblock.
326 Other options:
329 .ne 2
331 \fB-A\fR
333 .sp .6
334 .RS 4n
335 Do not abort should any assertion fail.
339 .ne 2
341 \fB-AA\fR
343 .sp .6
344 .RS 4n
345 Enable panic recovery, certain errors which would otherwise be fatal are
346 demoted to warnings.
350 .ne 2
352 \fB-AAA\fR
354 .sp .6
355 .RS 4n
356 Do not abort if asserts fail and also enable panic recovery.
360 .ne 2
362 \fB-e\fR [-p \fIpath\fR]...
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.
371 .ne 2
373 \fB-x\fR \fIdumpdir\fR
375 .sp .6
376 .RS 4n
377 All blocks accessed will be copied to files in the specified directory.
378 The blocks will be placed in sparse files whose name is the same as
379 that of the file or device read.  zdb can be then run on the generated files.
380 Note that the \fB-bbc\fR flags are sufficient to access (and thus copy)
381 all metadata on the pool.
385 .ne 2
387 \fB-F\fR
389 .sp .6
390 .RS 4n
391 Attempt to make an unreadable pool readable by trying progressively older
392 transactions.
396 .ne 2
398 \fB-I \fIinflight I/Os\fR \fR
400 .sp .6
401 .RS 4n
402 Limit the number of outstanding checksum I/Os to the specified value. The
403 default value is 200. This option affects the performance of the \fB-c\fR
404 option.
408 .ne 2
410 \fB-P\fR
412 .sp .6
413 .RS 4n
414 Print numbers in an unscaled form more amenable to parsing, eg. 1000000 rather
415 than 1M.
419 .ne 2
421 \fB-t\fR \fItransaction\fR
423 .sp .6
424 .RS 4n
425 Specify the highest transaction to use when searching for uberblocks. See also
426 the \fB-u\fR and \fB-l\fR options for a means to see the available uberblocks
427 and their associated transaction numbers.
431 .ne 2
433 \fB-U\fR \fIcachefile\fR
435 .sp .6
436 .RS 4n
437 Use a cache file other than \fB/etc/zfs/zpool.cache\fR.
441 .ne 2
443 \fB-v\fR
445 .sp .6
446 .RS 4n
447 Enable verbosity. Specify multiple times for increased verbosity.
451 .ne 2
453 \fB-X\fR
455 .sp .6
456 .RS 4n
457 Attempt \'extreme\' transaction rewind, that is attempt the same recovery as
458 \fB-F\fR but read transactions otherwise deemed too old.
462 Specifying a display option more than once enables verbosity for only that
463 option, with more occurrences enabling more verbosity.
465 If no options are specified, all information about the named pool will be
466 displayed at default verbosity.
468 .SH "EXAMPLES"
470 \fBExample 1 \fRDisplay the configuration of imported pool 'rpool'
472 .in +2
474 # zdb -C rpool
476 MOS Configuration:
477         version: 28
478         name: 'rpool'
479  ...
481 .in -2
485 \fBExample 2 \fRDisplay basic dataset information about 'rpool'
487 .in +2
489 # zdb -d rpool
490 Dataset mos [META], ID 0, cr_txg 4, 26.9M, 1051 objects
491 Dataset rpool/swap [ZVOL], ID 59, cr_txg 356, 486M, 2 objects
492  ...
494 .in -2
498 \fBExample 3 \fRDisplay basic information about object 0 in 'rpool/export/home'
500 .in +2
502 # zdb -d rpool/export/home 0
503 Dataset rpool/export/home [ZPL], ID 137, cr_txg 1546, 32K, 8 objects
505     Object  lvl   iblk   dblk  dsize  lsize   %full  type
506          0    7    16K    16K  15.0K    16K   25.00  DMU dnode
508 .in -2
512 \fBExample 4 \fRDisplay the predicted effect of enabling deduplication on 'rpool'
514 .in +2
516 # zdb -S rpool
517 Simulated DDT histogram:
519 bucket              allocated                       referenced          
520 ______   ______________________________   ______________________________
521 refcnt   blocks   LSIZE   PSIZE   DSIZE   blocks   LSIZE   PSIZE   DSIZE
522 ------   ------   -----   -----   -----   ------   -----   -----   -----
523      1     694K   27.1G   15.0G   15.0G     694K   27.1G   15.0G   15.0G
524      2    35.0K   1.33G    699M    699M    74.7K   2.79G   1.45G   1.45G
525  ...
526 dedup = 1.11, compress = 1.80, copies = 1.00, dedup * compress / copies = 2.00
528 .in -2
531 .SH "SEE ALSO"
532 zfs(1M), zpool(1M)