]> git.proxmox.com Git - mirror_zfs-debian.git/blame - man/man8/zdb.8
Imported Upstream version 0.6.4.2
[mirror_zfs-debian.git] / man / man8 / zdb.8
CommitLineData
dd4769ad
RL
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.
c06d4368 14.\" Copyright (c) 2012 by Delphix. All rights reserved.
dd4769ad
RL
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"
ea04106b
AX
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 ...]]
dd4769ad
RL
25
26.P
c06d4368
AX
27\fBzdb\fR [-divPA] [-e [-p \fIpath\fR...]] [-U \fIcache\fR]
28 \fIdataset\fR [\fIobject\fR ...]
dd4769ad
RL
29
30.P
ea04106b 31\fBzdb\fR -m [-MLXFPA] [-t \fItxg\fR] [-e [-p \fIpath\fR...]] [-U \fIcache\fR]
c06d4368 32 \fIpoolname\fR [\fIvdev\fR [\fImetaslab\fR ...]]
dd4769ad
RL
33
34.P
c06d4368 35\fBzdb\fR -R [-A] [-e [-p \fIpath\fR...]] [-U \fIcache\fR] \fIpoolname\fR
dd4769ad
RL
36 \fIvdev\fR:\fIoffset\fR:\fIsize\fR[:\fIflags\fR]
37
38.P
c06d4368 39\fBzdb\fR -S [-AP] [-e [-p \fIpath\fR...]] [-U \fIcache\fR] \fIpoolname\fR
dd4769ad
RL
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"
48The \fBzdb\fR utility displays information about a ZFS pool useful for
49debugging and performs some amount of consistency checking. It is a not a
50general purpose tool and options (and facilities) may change. This is neither
51a fsck(8) nor an fsdb(8) utility.
52
53.P
54The output of this command in general reflects the on-disk structure of a ZFS
55pool, and is inherently unstable. The precise output of most invocations is
56not documented, a knowledge of ZFS internals is assumed.
57
58.P
59When operating on an imported and active pool it is possible, though unlikely,
60that zdb may interpret inconsistent pool data and behave erratically.
61
62.SH "OPTIONS"
63Display options:
058ac9ba 64
058ac9ba 65.sp
dd4769ad
RL
66.ne 2
67.na
68\fB-b\fR
69.ad
70.sp .6
71.RS 4n
72Display statistics regarding the number, size (logical, physical and
73allocated) and deduplication of blocks.
74.RE
75
058ac9ba 76.sp
dd4769ad
RL
77.ne 2
78.na
79\fB-c\fR
80.ad
81.sp .6
82.RS 4n
83Verify the checksum of all metadata blocks while printing block statistics
84(see \fB-b\fR).
058ac9ba 85.sp
dd4769ad
RL
86If specified multiple times, verify the checksums of all blocks.
87.RE
88
058ac9ba 89.sp
dd4769ad
RL
90.ne 2
91.na
92\fB-C\fR
93.ad
94.sp .6
95.RS 4n
96Display information about the configuration. If specified with no other
97options, 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
101If specified multiple times, and a pool name is also specified display both
102the cached configuration and the on-disk configuration. If specified multiple
103times with \fB-e\fR also display the configuration that would be used were the
104pool 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
114Display information about datasets. Specified once, displays basic dataset
115information: ID, create transaction, size, and object count.
116.sp
117If specified multiple times provides greater and greater verbosity.
118.sp
119If object IDs are specified, display information about those specific objects only.
120.RE
121
058ac9ba
BB
122.sp
123.ne 2
058ac9ba 124.na
dd4769ad 125\fB-D\fR
058ac9ba 126.ad
dd4769ad
RL
127.sp .6
128.RS 4n
129Display deduplication statistics, including the deduplication ratio (dedup),
130compression ratio (compress), inflation due to the zfs copies property
131(copies), and an overall effective ratio (dedup * compress / copies).
132.sp
133If specified twice, display a histogram of deduplication statistics, showing
134the allocated (physically present on disk) and referenced (logically
135referenced in the pool) block counts and sizes by reference count.
a08ee875
LG
136.sp
137If specified a third time, display the statistics independently for each deduplication table.
138.sp
139If specified a fourth time, dump the contents of the deduplication tables describing duplicate blocks.
140.sp
141If specified a fifth time, also dump the contents of the deduplication tables describing unique blocks.
058ac9ba
BB
142.RE
143
144.sp
145.ne 2
058ac9ba 146.na
dd4769ad 147\fB-h\fR
058ac9ba 148.ad
dd4769ad
RL
149.sp .6
150.RS 4n
151Display pool history similar to \fBzpool history\fR, but include internal
152changes, transaction, and dataset information.
058ac9ba
BB
153.RE
154
155.sp
156.ne 2
058ac9ba 157.na
dd4769ad 158\fB-i\fR
058ac9ba 159.ad
dd4769ad
RL
160.sp .6
161.RS 4n
162Display information about intent log (ZIL) entries relating to each
163dataset. If specified multiple times, display counts of each intent log
164transaction type.
058ac9ba
BB
165.RE
166
058ac9ba 167.sp
dd4769ad
RL
168.ne 2
169.na
170\fB-l\fR \fIdevice\fR
171.ad
172.sp .6
173.RS 4n
174Display the vdev labels from the specified device. If the \fB-u\fR option is
175also 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
185Disable leak tracing and the loading of space maps. By default, \fBzdb\fR
186verifies 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
196Display the offset, spacemap, and free space of each metaslab.
ea04106b
AX
197When specified twice, also display information about the on-disk free
198space histogram associated with each metaslab. When specified three time,
199display the maximum contiguous free space, the in-core free space histogram,
200and the percentage of free space in each space map. When specified
201four 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
211Display the offset, spacemap, and free space of each metaslab.
dd4769ad
RL
212When specified twice, also display information about the maximum contiguous
213free space and the percentage of free space in each space map. When specified
214three 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
224Read and display a block from the specified device. By default the block is
225displayed as a hex dump, but see the description of the \'r\' flag, below.
226.sp
227The block is specified in terms of a colon-separated tuple \fIvdev\fR (an
228integer 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,
230described below).
231
232.sp
233.ne 2
234.na
235\fBb\fR \fIoffset\fR
236.ad
237.sp .6
238.RS 4n
239Print block pointer
240.RE
241
242.sp
243.ne 2
244.na
245\fBd\fR
246.ad
247.sp .6
248.RS 4n
249Decompress the block
250.RE
251
252.sp
253.ne 2
254.na
255\fBe\fR
256.ad
257.sp .6
258.RS 4n
259Byte swap the block
260.RE
261
262.sp
263.ne 2
264.na
265\fBg\fR
266.ad
267.sp .6
268.RS 4n
269Dump gang block header
270.RE
271
272.sp
273.ne 2
274.na
275\fBi\fR
276.ad
277.sp .6
278.RS 4n
279Dump indirect block
280.RE
281
282.sp
283.ne 2
284.na
285\fBr\fR
286.ad
287.sp .6
288.RS 4n
289Dump 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
300Report statistics on \fBzdb\fR\'s I/O. Display operation counts, bandwidth,
301and 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
311Simulate the effects of deduplication, constructing a DDT and then display
312that 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
322Display the current uberblock.
323.RE
324
325.P
326Other options:
327
328.sp
329.ne 2
330.na
331\fB-A\fR
332.ad
333.sp .6
334.RS 4n
335Do 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
345Enable panic recovery, certain errors which would otherwise be fatal are
346demoted to warnings.
347.RE
348
349.sp
350.ne 2
351.na
352\fB-AAA\fR
353.ad
354.sp .6
355.RS 4n
356Do 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
366Operate 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
377Attempt to make an unreadable pool readable by trying progressively older
378transactions.
379.RE
380
c06d4368
AX
381.sp
382.ne 2
383.na
ea04106b 384\fB-I \fIinflight I/Os\fR \fR
c06d4368
AX
385.ad
386.sp .6
387.RS 4n
388Limit the number of outstanding checksum I/Os to the specified value. The
389default value is 200. This option affects the performance of the \fB-c\fR
390option.
391.RE
392
dd4769ad
RL
393.sp
394.ne 2
395.na
396\fB-P\fR
397.ad
398.sp .6
399.RS 4n
400Print numbers in an unscaled form more amenable to parsing, eg. 1000000 rather
401than 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
411Specify the highest transaction to use when searching for uberblocks. See also
412the \fB-u\fR and \fB-l\fR options for a means to see the available uberblocks
413and 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
c06d4368 423Use a cache file other than \fB/etc/zfs/zpool.cache\fR.
dd4769ad
RL
424.RE
425
426.sp
427.ne 2
428.na
429\fB-v\fR
430.ad
431.sp .6
432.RS 4n
433Enable 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
443Attempt \'extreme\' transaction rewind, that is attempt the same recovery as
444\fB-F\fR but read transactions otherwise deemed too old.
445.RE
446
ea04106b
AX
447.sp
448.ne 2
449.na
450\fB-V\fR
451.ad
452.sp .6
453.RS 4n
454Attempt a verbatim import. This mimics the behavior of the kernel when loading
455a pool from a cachefile.
456.RE
457
dd4769ad
RL
458.P
459Specifying a display option more than once enables verbosity for only that
460option, with more occurrences enabling more verbosity.
461.P
462If no options are specified, all information about the named pool will be
463displayed at default verbosity.
464
465.SH "EXAMPLES"
058ac9ba 466.LP
dd4769ad
RL
467\fBExample 1 \fRDisplay the configuration of imported pool 'rpool'
468.sp
469.in +2
470.nf
471# zdb -C rpool
472
473MOS 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
487Dataset mos [META], ID 0, cr_txg 4, 26.9M, 1051 objects
488Dataset rpool/swap [ZVOL], ID 59, cr_txg 356, 486M, 2 objects
489 ...
490.fi
491.in -2
492.sp
493
494.LP
2016ff96
BB
495\fBExample 3 \fRDisplay basic information about object 0
496in 'rpool/export/home'
dd4769ad
RL
497.sp
498.in +2
499.nf
500# zdb -d rpool/export/home 0
501Dataset 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
515Simulated DDT histogram:
516
517bucket allocated referenced
518______ ______________________________ ______________________________
519refcnt 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 ...
524dedup = 1.11, compress = 1.80, copies = 1.00, dedup * compress / copies = 2.00
525.fi
526.in -2
527.sp
528
ea04106b
AX
529.SH "ENVIRONMENT VARIABLES"
530.TP
531.B "SPA_CONFIG_PATH"
532Override 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
dd4769ad
RL
534.SH "SEE ALSO"
535zfs(8), zpool(8)