[smartmontools-support] Differences in test report results: xselftest vs selftest

Carlos E. R. robin.listas at telefonica.net
Sat Apr 27 14:41:36 CEST 2024


On 2024-04-26 13:59, Daniel Fishman wrote:
> 
> 
> On 4/25/24 18:58, Christian Franke wrote:
> 
>>
>> Are any read error reported in the SMART error logs?
>>
>> If not, run a read test with badblocks or GNU ddrescue. If read errors 
>> occur, the last ones should appear in the error logs. Errors detected 
>> by self-tests only usually do not.
>>
> 
> Indeed, there were some errors in the "SMART Extended Comprehensive 
> Error Log",
> (the xerror log) but those reported blocks were readable. I ran badblocks
> (in read-only mode), and then it did find some bad blocks which appeared 
> in the
> log above as well - and those ones were unreadable (with hdparm)
> 
> Strange thing though: when I test a reported block (the ones that appeared
> after execution of badblocks) by 'hdparm --read-sector <num> /dev/sdc', I
> get an error, and 'Device Error Count' in xerror log increases. But when
> I ran what I think should be an equivalent dd command:
> 
> 'dd if=/dev/sdc of=/dev/null bs=512 count=1 seek=<num>'
> 
> I neither get any error, nor does device error count increases. It also 
> doesn't
> happen when I convert block number to a file system block (using 
> (int)((L-S)*512/B)
> formula from the wiki) and adjust the command as follows (B is 4096 in 
> my case):
> 
> 'dd if=/dev/sdc1 of=/dev/null bs=4096 count=1 seek=<adjusted num>'
> 
> Is there a reason for that? I suppose that there is a good reason why wiki
> instructs to use 'dd' and only if it doesn't work - use hdparm (probably
> because it adds confidence that there was no error in converting LBA to
> file system block) - and therefore I would also prefer to use dd both for
> actually overwriting the block, and for reading it (and getting error)
> to make sure that I don't fix something wrong.

I wonder if this might work:

read with dd the supposed bad sector into a temporary file
write back that temporary file into that same bad sector. That way it 
doesn't matter if the sector is not actually bad.

I suppose it could be coded a program that reads every sector into 
memory (in turn), and if there is a read error, write back into the same 
place those "bad" sectors. But I don't think I have currently a disk 
with bad sectors to test it.


I have a brute force strategy, though:

I copy with one of the two ddrescue variants the entire partition (or 
disk) into another disk, then write it back, in full.

Or perhaps:

  read into backup the entire partition
  write the entire partition with zeroes
  write back the backup


However, if I see the number of bad sectors increasing, I ditch the 
disk. I only keep using it if the number is stable.

-- 
Cheers / Saludos,

		Carlos E. R.
		(from 15.5 x86_64 at Telcontar)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 203 bytes
Desc: OpenPGP digital signature
URL: <https://listi.jpberlin.de/pipermail/smartmontools-support/attachments/20240427/84397fdb/attachment.asc>


More information about the Smartmontools-support mailing list