Recovering bad sectors and smartctl no lba in error report
Miroslav Lachman
000.fbsd at quip.cz
Fri Mar 27 20:59:46 UTC 2020
Artem Kuchin wrote on 2020/03/27 20:10:
> One more strange thing i found out
>
>> rror 5 occurred at disk power-on lifetime: 46151 hours (1922 days + 23
>> hours)
>> When the command that caused the error occurred, the device was
>> active or idle.
>>
>> After command completion occurred, registers were:
>> ER ST SC SN CL CH DH
>> -- -- -- -- -- -- --
>> 40 51 a0 08 de 3e 0b Error: UNC at LBA = 0x0b3ede08 = 188669448
>
>
> The only error i saw in the log is about swap partition not redable.
>
> However,
>
> # gpart show
>
> => 34 5860533101 ada2 GPT (2.7T)
> 34 6 - free - (3.0K)
> 40 128 1 freebsd-boot (64K)
> 168 8388608 2 freebsd-swap (4.0G)
> 8388776 5852144352 3 freebsd-ufs (2.7T)
> 5860533128 7 - free - (3.5K)
>
> Now see to which partition this LBA belongs. The block in the gpart show
> are 512 b ytes and
>
> LBA is 512 too. So, we can just compare numbers. And as you see
> 188669448 is not in the swap
>
> partition. It is in FREEBSD-UFS! So, some file is damaged there and i
> need to know which one.
>
> I need a way to map LBA (block) to a file. Linux has debugfs utility,
> but i haven't found anything like that
I tried this few years ago. It is hard and not reliable to find file
belonging to certain LBA.
fsdb findblk uses file system block sizes, smartctl LBA reports block in
disk block sizes which can be 512 or 4k.
Then you need to substract partition offset etc.
One way to find the file is "guess". Read the given block by DD, open in
editor and see the content of the file. Then you can guess what file it
can be. In one case I found it was lighttpd.conf just by seeing the
content of the file.
In other case it was empty space.
Miroslav Lachman
More information about the freebsd-fs
mailing list