zdb -R question

Patrick Proniewski patpro at patpro.net
Wed Aug 13 13:41:01 UTC 2014


On 13 août 2014, at 12:20, Martin Simmons wrote:

>> devices ada2 and ada3 are in ZRAID1 mirror. 
> 
> I think you mean just "mirror"? here.  ZRAID1 is not a term used by ZFS -- it
> has RAIDZ1, but that requires at least 3 drives.

Yes, you are right, it's just mirror even though I was thinking about raidz1


>> zpool scrub won't show any error.
> 
> If scrub shows no errors then the blocks are not currently used.

thanks for this confirmation.


> For a start, you probably have partitions on the disk so that LBA (from the
> start of the disk) will not be the offset into the ZFS vdev.  Secondly, the
> offset passed to zdb -R should be in bytes, whereas the LBA is in sectors.

Before writing to the list I've tried both bytes and sectors/blocks without any positive result. 

If I'm not mistaken, 460087328 sectors with a 512 byte size yields to 235564705792 byte offset. So this command should not return "offset must be a multiple of sector size" error:

zdb -R zdata /dev/ada3:235564705792:512

I've used gpart to prepare the drive, so its layout is the following:

# gpart show ada3
=>        34  3907029101  ada3  GPT  (1.8T)
          34  3907029101     1  freebsd-zfs  (1.8T)

I'm quite lost here, with zdb.

> Try using dd on the whole disk, something like
> 
> dd if=/dev/ada3 of=/dev/null bs=512 count=1 skip=460087328
> 
> Use bs=4096 if your drive has 4096 byte sectors.

dd confirms that the first faulty sector is unreadable:

- faulty sector -
# dd if=/dev/ada3 of=/dev/null bs=512 count=1 skip=460087328
dd: /dev/ada3: Input/output error
0+0 records in
0+0 records out
0 bytes transferred in 9.761358 secs (0 bytes/sec)

- previous sector -
# dd if=/dev/ada3 of=/dev/null bs=512 count=1 skip=460087327
1+0 records in
1+0 records out
512 bytes transferred in 0.035261 secs (14520 bytes/sec)

- next sector - 
# dd if=/dev/ada3 of=/dev/null bs=512 count=1 skip=460087329
1+0 records in
1+0 records out
512 bytes transferred in 0.032987 secs (15521 bytes/sec)


thanks,
Pat




More information about the freebsd-fs mailing list