[smartmontools-support] Calcuting smartctl output to recovery bad-sector on FreeBSD ZFS

Christian Franke Christian.Franke at t-online.de
Sat Mar 13 18:42:57 CET 2021


Budi Janto wrote:
>
> On 3/11/21 9:10 PM, Christian Franke wrote:
>> This is the legacy SMART error log which only supports 28-bit LBAs. 
>> This drive apparently logs the LBA registers as 0xff for LBAs greater 
>> than 0x0fffffff. Other drives don't log anything in this case.
>>
>> Don't use '-l error', use '-l xerror' instead. Note that '-l xerror' 
>> is not included in '-a' but in '-x'.
>>
>> Try also '-l defects' which also included only in '-x'. If supported 
>> by the drive, this should print the LBAs of the 8 pending sectors 
>> counted in attribute 197/198.
>
> Thanks,
>
> But I'am really don't understand. I use FreeBSD & ZFS, /dev/ada2 is 
> striped disk with /dev/ada1.

Did you try any of the suggested smartctl options (-l xerror -l defects) ?


> # smartctl -l selftest /dev/ada2
> smartctl 7.2 2020-12-30 r5155 [FreeBSD 12.2-STABLE amd64] (local build)
> Copyright (C) 2002-20, Bruce Allen, Christian Franke, 
> www.smartmontools.org
>
> === START OF READ SMART DATA SECTION ===
> SMART Self-test log structure revision number 1
> Num  Test_Description    Status                  Remaining 
> LifeTime(hours)  LBA_of_first_error
> # 1  Short offline       Completed: read failure       90% 28337      
> 3342106256
> # 2  Short offline       Completed: read failure       90% 28336      
> 3342106256
> # 3  Short offline       Completed: read failure       90% 28336      
> 3342106256
> # 4  Short offline       Completed: read failure       90% 28336      
> 3342106256
> ...

This is the legacy self-test log with LBA field limited to 32-bit (2TiB, 
~2.1TB). LBA values may be incorrect. Try '-l xselftest'.

Please provide a 'smartctl -x -a' output as a plain-text attachment(!). 
It includes '-l error -l xerror -l selftest -l xselftest -l defects'.


> # dd if=/dev/zero of=/dev/ada2 bs=4096 count=1 seek=417763282 
> conv=noerror,sync

I'm not sure whether 'conv=noerror,sync' has any effect in conjunction 
with /dev/zero.

Caching should be suppressed with '*flag=direct'. Check first that the 
physical sector is actually unreadable, for example:

# dd if=/dev/ada2 of=/dev/null bs=4096 count=1 skip=417763282 iflag=direct

If and only if this command reports a read error, try to overwrite the 
physical sector:

# dd if=/dev/zero of=/dev/ada2 bs=4096 count=1 seek=417763282 oflag=direct

Regards,
Christian



More information about the Smartmontools-support mailing list