Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Aug 2014 15:40:57 +0200
From:      Patrick Proniewski <patpro@patpro.net>
To:        Martin Simmons <martin@lispworks.com>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: zdb -R question
Message-ID:  <64CCA262-71E9-4688-A725-376DFA681548@patpro.net>
In-Reply-To: <201408131020.s7DAKeCl017621@higson.cam.lispworks.com>
References:  <BEC665FB-4F91-400D-BAA2-67D978C7AC66@patpro.net> <201408131020.s7DAKeCl017621@higson.cam.lispworks.com>

next in thread | previous in thread | raw e-mail | index | archive | help

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





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?64CCA262-71E9-4688-A725-376DFA681548>