[smartmontools-support] Calcuting smartctl output to recovery bad-sector on FreeBSD ZFS
Dan Lukes
dan at obluda.cz
Thu Mar 11 18:54:57 CET 2021
On 11.3.2021 13:44, Budi Janto wrote:
> Mar 11 18:45:42 BEC-STG-P1 kernel: (ada2:ahcich5:0:0:0):
> READ_FPDMA_QUEUED. ACB: 60 20 28 1f 90 40 b8 01 00 00 00 00
FreeBSD uses LSB, thus it needs to be read as 0x01B840901F = 7386206239
> root at BEC-STG-P1:~ # dd if=/dev/zero of=/dev/ada0 bs=128k count=1
> seek=268435455
> dd: /dev/ada0: Input/output error
You commanded dd to seek 268435455 block while you claimed block to be
128k. It's beyond end of the disc.
You should use seek=923275779 bs=4k count=1 instead
> root at BEC-STG-P1:~ # zfs get all | grep recordsize
> pool recordsize 128K default
It's sector size of the ZFS, but we are speaking of physical disc here.
Your physical disc have 4k sector size. Thus use 4k for dd
With bs=128k you are overwriting more than necessary.
Use physical sector size (4k) not the logical (512).
bs=512 may not work as you expect.
According my experience, some disks do no sector relocation during
sub-sector write. To be on safe side, always write full physical sector
to trigger relocation.
>> Sector Sizes: 512 bytes logical, 4096 bytes physical
>> 197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always
>> - 8
It seems there are (at least) two unreadable physical sectors on the
disc. Consider to run full disc scan to identify the second defect.
Remember - sector relocation doesn't recover the data. Zeroed sector may
be part of any file on your ZFS volume.
Dan
More information about the Smartmontools-support
mailing list