zdb question

Andriy Gapon avg at FreeBSD.org
Fri Mar 1 10:10:04 UTC 2019


On 28/02/2019 15:59, Dave Baukus wrote:
> If one uses zdb -R <pool name> <dva> to read the contents of every disk block
> associated with the DVA in a raidz2 pool then does one expect the
> dump of each DVA to be the exact USER WRITTEN contents of the file ?

I think so; on a condition that the DVA refers to the file's data block (L0).

> Or does this usage of zdb pull in the raidz2 checksum blocks and/or padding ?
> Looking at the code, I don't think so.
> 
> I ask because I have a file of known contents (every byte was written as 0x42 == 'B'),
> and if I execute the script below and redirect the output to a file then
> the contents of the output file has chunks of non-B characters.
> 
> For example:
> 
> Offset 300000, DVA 1:9f08e2ff000:120000

How did you come up with this DVA?
Are you sure about the size component?

> Found vdev type: raidz
> 
> 1:9f08e2ff000:120000
>            0 1 2 3 4 5 6 7   8 9 a b c d e f  0123456789abcdef
> 010000:  01000321b60d0000  0afb2f931d805100  ....!....Q.../..
> 010010:  02ac211c00020f00  00e2000680110031  .....!..1.......
> 010020:  39345f58656c6966  0f001334322e3639  fileX_4996.24...
> 010030:  050040cb1f0c0002  02020c003a35352f  ..... at ../55:....
> 010040:  3822050040ea1f00  210c00020f002136  ... at .."86!.....!
> 
> -----
> 
> Whereas I expect every DVA chunk to look like:
> 
> Offset 0, DVA 1:9f08e0bf000:120000
> Found vdev type: raidz
> 
> 1:9f08e0bf000:120000
>            0 1 2 3 4 5 6 7   8 9 a b c d e f  0123456789abcdef
> 000000:  4242424242424242  4242424242424242  BBBBBBBBBBBBBBBB
> 000010:  4242424242424242  4242424242424242  BBBBBBBBBBBBBBBB
> 000020:  4242424242424242  4242424242424242  BBBBBBBBBBBBBBBB
> 000030:  4242424242424242  4242424242424242  BBBBBBBBBBBBBBBB
> 000040:  4242424242424242  4242424242424242  BBBBBBBBBBBBBBBB
> 
> ----
> 
> On the other hand, if I use a simple program to read the file and verify that every byte
> is 0x42 then no errors are reported.
> 
> What gives ?
> Am I misusing zdb ?

Perhaps.

-- 
Andriy Gapon


More information about the freebsd-fs mailing list