zdb -R question

Martin Simmons martin at lispworks.com
Wed Aug 13 10:31:45 UTC 2014


>>>>> On Tue, 12 Aug 2014 18:27:06 +0200, Patrick Proniewski said:
> 
> Hello,
> 
> I've a hard drive with corrupt blocks. I would like to know if those blocks belong to a real file.
> 
> /var/log/message reads:
> 
> 	smartd[1306]: Device: /dev/ada3, 3 Currently unreadable (pending) sectors
> 
> 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.


> zpool scrub won't show any error.

If scrub shows no errors then the blocks are not currently used.


> smartctl full test find errors:
> 
> 	SMART Self-test log structure revision number 1 
> 	Num Test_Description     Status                  Remaining     LifeTime(hours) LBA_of_first_error 
> 	../..
> 	# 2  Extended offline    Completed: read failure       80%     33003         460087328
> 	../..
> 	# 5  Extended offline    Completed: read failure       90%     32936         460087313
> 
> I've made some attempts with zdb -R to read faulted sectors, but I keep receiving errors like these ones: 
> 
> 	Invalid block specifier: gpt/ben: 460087328:512  - offset must be a multiple of sector size
> 	Invalid block specifier: gpt/ben:409600000:512  - size must be a multiple of sector size
> 
> whatever offset and size I try (4096/512), I always receive one of these errors... Any idea?

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.

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.  Don't mix up the if= and of=
arguments or you may lose data.

__Martin


More information about the freebsd-fs mailing list