Using Ubuntu 12.04, I booted into maintenance mode and selected fsck from the menu. This ran a filesystem check on all my volumes (all ext2), mounting them read/write by default. After the tests completed it said there were bad blocks detected and that the filesystem had been written to. I immediately rebooted and ran smartmon tools (full tests) on the disk. The SMART information showed the drive to be perfectly healthy (no re-allocated sectors, no pending re-allocations). I then ran the badblocks utility on all my volumes with absolutely no errors. What is going on?


Google published a report about 5 years ago basically stating that the SMART attributes in modern hard drives were not generally predictive of drive failure or useful for diagnostics. Which is unfortunate, because we generally want this kind of thing to be useful.

I suggest using the -c switch twice on fsck to force a read-write test of the sectors. This invokes the badblocks program. It it accomplishes roughly the same thing that GRC's SpinRite does. (SpinRite will work on any linux formatted drive, btw.) Example fsck invocation:

fsck.ext2 -fycc /dev/sdb1

I have seen ext2 formatted drives with errors rapidly decay into trashed filesystems when plied with fsck, so before invoking badblocks on the disk, if you can still mount the partition, back it up. When running the check, make sure you have good ventilation across your disk(s) because this will turn up the heat.

  • 1
    fsck.ext2 or e2fsck with -cc will take LOTS of time. Expect to wait for a day per TB with a modern HDD. SMART is no good for this accoding to Google and personal experience. – Mikko Rantalainen Jan 16 '13 at 8:41
  • from what I've heard from the Security Now! podcast, writing the data doesn't stimulate error correction, but reading it does. So, a single -c switch might be as effective and faster. – memnoch_proxy Jan 16 '13 at 19:31
  • 1
    Perhaps it might depend on HDD manufacturer but rest assured that at least SATA Western Digital Green series requires writing over whole a physical 4KB block at once to fix a sector with a read error (UNC). Trying to write only 512 bytes to a broken sector will result in write error. Read does nothing. You could do read-only-testing with -c to get a list of bad sectors and then selectively overwrite only broken blocks. However, that does not guarantee that the whole disk is okay because some errors show up only after first writing to the block. – Mikko Rantalainen Jan 18 '13 at 8:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.