Recovering bad sectors and smartctl no lba in error report

Artem Kuchin artem at artem.ru
Fri Mar 27 19:10:41 UTC 2020


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

for freebsd.


Artem



More information about the freebsd-fs mailing list