zfs icon indicating copy to clipboard operation
zfs copied to clipboard

zdb: show bp in uberblock dump

Open robn opened this issue 1 year ago • 0 comments

Motivation and Context

I was helping a friend with a broken pool. zdb -lu didn't show a head block pointer, and it annoyed me.

Description

Just format and print the block pointer in the uberblock when dumping it.

How Has This Been Tested?

Run program, enjoy block pointer:

$ sudo ./zdb -lqu /dev/nvme0n1p2
    Uberblock[0]
	magic = 0000000000bab10c
	version = 5000
	txg = 2476320
	guid_sum = 17693405506996517599
	timestamp = 1729339026 UTC = Sat Oct 19 22:57:06 2024
	bp = DVA[0]=<0:62290b6000:1000> DVA[1]=<0:5f41c5b000:1000> DVA[2]=<0:10016b9000:1000> [L0 DMU objset] fletcher4 uncompressed unencrypted LE contiguous unique triple size=1000L/1000P birth=2476320L/2476320P fill=264 cksum=00000004118c836b:00000fa5d98389b1:001e1fc53b6ba384:26b43e0bf0e15a8f
	mmp_magic = 00000000a11cea11
	mmp_delay = 0
	mmp_valid = 0
	checkpoint_txg = 0
	raidz_reflow state=0 off=0
        labels = 0 1 2 3
    Uberblock[1]
	magic = 0000000000bab10c
	version = 5000
...

zdb test tag ran to success.

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Performance enhancement (non-breaking change which improves efficiency)
  • [ ] Code cleanup (non-breaking change which makes code smaller or more readable)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • [ ] Documentation (a change to man pages or other documentation)

Checklist:

  • [x] My code follows the OpenZFS code style requirements.
  • [ ] I have updated the documentation accordingly.
  • [x] I have read the contributing document.
  • [ ] I have added tests to cover my changes.
  • [x] I have run the ZFS Test Suite with this change applied.
  • [x] All commit messages are properly formatted and contain Signed-off-by.

robn avatar Oct 19 '24 12:10 robn