[smartmontools-support] smartctl fails but badblocks succeeds

Nathan Stratton Treadway nathanst at ontko.com
Mon Jun 27 21:24:24 CEST 2022

On Sat, Jun 25, 2022 at 09:38:56 -0400, Alex wrote:
> The first one doesn't have all that many hours on it.
>    1. Model Family: Western Digital Caviar Black
>    2. Device Model: WDC WD1502FAEX-007BA0
>    1. Num Test_Description Status Remaining LifeTime(hours)
>    LBA_of_first_error
>    2. # 1 Extended offline Completed: read failure 80% 25420 556876652
> https://pastebin.com/P2uvFxfa
> I've also tried to run badblocks on the area around that bad sector, and
> it's succeeded.

As far as I could see, you didn't include the screen log of the
"badblocks" run -- I don't know if that will actually show us anything
useful, but certainly the exact details of the badblocks invocation
(including command-line options) may be important to understanding why
that isn't detecting the error.

I don't use badblocks myself and don't know off-hand if it bypasses the
OS device cache; if it doesn't, it's possible that it doesn't report any
errors because it's accessing the cache rather than causing an actual
read from the physical disk.

I have only a tiny bit of disk-analysis experience, but I've had some
luck using "dd" with iflag=direct to bypass the cache, thus forcing an
actual read of the drive.  So in your case something like this:

  # DEV=/dev/sdb
  # SECT=$(( 556876652 - 100 ))
  # dd iflag=direct if=$DEV of=/dev/null count=200 skip=$SECT 

(where here I just arbitrarily picked a window of 100 sectors on each
side of the target sector to search through)

Then if there is a hardware-level read error, the exact sector that
failed should show up in your kernel log messges.  

(But note that Linux often uses 8-sector blocks for disk IO, so
sometimes the kernel log messages reflect the start of the read block
that errored out rather than the exact sector which failed.)


Nathan Stratton Treadway  -  nathanst at ontko.com  -  Mid-Atlantic region
Ray Ontko & Co.  -  Software consulting services  -   http://www.ontko.com/
 GPG Key: http://www.ontko.com/~nathanst/gpg_key.txt   ID: 1023D/ECFB6239
 Key fingerprint = 6AD8 485E 20B9 5C71 231C  0C32 15F3 ADCD ECFB 6239

More information about the Smartmontools-support mailing list