Project

General

Profile

Feature #2013

ZDB capability to walk the MOS

Added by Jim Klimov almost 9 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
zfs - Zettabyte File System
Start date:
2012-01-21
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

My "zpool status" reports a corruption in "<metadata>:<0x0>". From the code in http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libzfs/common/libzfs_pool.c#zpool_obj_to_path it seems that the textual output name "<metadata>:<*>" is assigned to "dsobj==0" which is the MOS. Object number 0x0 inside that should be the "DMU dnode", and apparently some of this mismatches the checksum in higher-level blocks.

Currently, attempts to trace this ZFS object like a file with "zdb -ddddddd pool mos" only produce dumps of the metaslabs and spacemaps, some info on the MOS dataset (below) and tons of similar infos on all datasets and snapshots in the pool.

I just wanted to see a Ln-L0 block tree with DVAs and such, like for other objects (ZPL/ZVOL datasets), and optionally output checksums for comparison in search of errors (see RFE #2012).

Dataset part (start of) the ZDB output for my MOS:

===

Dataset mos [META], ID 0, cr_txg 4, 50.5G, 75783 objects, rootbp DVA0=<0:433c989a000:3000> DVA1=<0:97756624000:3000> DVA2=<0:295c3f3a000:3000> [L0 DMU objset] fletcher4 uncompressed LE contiguous unique triple size=800L/800P birth=325612946L/325612946P fill=75783 cksum=3ca32ede8:711f9f84746:69c9a40c13c88:421e60a170970b8

Object  lvl   iblk   dblk  dsize  lsize   %full  type
0 3 16K 16K 83.8M 78.5M 47.15 DMU dnode
dnode flags: USED_BYTES
dnode maxblkid: 5022
Deferred frees: 20 local blkptrs, 0 subobjs, 575K (50.5K/50.5K comp)
Pool frees: 0 local blkptrs, 0 subobjs, 0 (0/0 comp)

Dirty time logs:

pool [DTL-required]
raidz [DTL-required]
/dev/dsk/c6t0d0s0 [DTL-expendable]
/dev/dsk/c6t1d0s0 [DTL-expendable]
/dev/dsk/c6t2d0s0 [DTL-expendable]
/dev/dsk/c6t3d0s0 [DTL-expendable]
/dev/dsk/c6t4d0s0 [DTL-expendable]
/dev/dsk/c6t5d0s0 [DTL-expendable]
Dataset pool/media [ZPL], ID 281, cr_txg 291705, 850G, 338171 objects, rootbp DVA[0]=&lt;0:49c1a790000:3000&gt; DVA[1]=&lt;0:29767208000:3000&gt; [L0 DMU objset] sha256 lzjb LE contiguous unique double size=800L/200P birth=325604000L/325604000P fill=338171 cksum=a3688c0fe5542424:fd7669a381e1e00f:517ddd86c742e1d9:e0ec04feaef1b341
Object  lvl   iblk   dblk  dsize  lsize   %full  type
0 7 16K 16K 221M 3.31G 4.87 DMU dnode
dnode flags: USED_BYTES
dnode maxblkid: 217088
...
(thousands of these on my system)

Also available in: Atom PDF