I'm using ubuntu 11.04. Disk utility is reporting I have a bad sector on my hard drive. Is this reliable?

I'm skeptical that it's reporting accurately because

  1. When I googled "ubuntu disk utility bad sectors," it brought me to this bug: https://bugs.launchpad.net/ubuntu/+source/libatasmart/+bug/438136?comments=all
  2. I've scanned the drive with the manufacturer's tool (Seagate Seatools) and it didn't report any errors
  3. I scanned the drive with a couple other tools and they didn't report any errors
  4. Running fdisk and ntfsfix didn't find anything (other than ntfsinfo saying that my windows volume was "scheduled for check")
  5. Disk utility is reporting some crazy numbers in other places: the read error rate is over 60 million (yet still green), the seek error rate is over 150 billion (yet still green), hardware ECC recovered is over 84 million (again, green). see these screenshots:

    Edit: wikipedia's entry for SMART has this to say for each of these attributes: "The raw value has different structure for different vendors and is often not meaningful as a decimal number."



Having said all that, my windows partition has become unbootable (ntoskrnl.exe missing or corrupted, etc.) multiple times over the last several years, and other than the fact that windows is relatively unreliable, bad sectors would explain why it keeps messing up.

What's the best way to determine whether or not there really is anything wrong with the drive?

  • I was able to confirm the results of disk utility by downloading smartmontools (sudo aptitude install smartmontools) and running sudo smartctl -a /dev/sda
    – bmaupin
    Jun 2 '11 at 15:56

Yes, it is reliable. Run sudo badblocks -b 512 /dev/sda to scan the disk and find where the bad sector is. It will show the number of the bad sector. You can then verify it with:

sudo dd if=/dev/sda of=/dev/null iflag=direct bs=512 skip=sector_number count=1

Make sure you type the command exactly as stated, using the correct sector_number from badblocks. This should fail with an IO error ( since the sector is bad ). If it doesn't, then you got something wrong. If it does, then you can proceed with trying to repair the bad sector:

sudo dd if=/dev/zero of=/dev/sda oflag=direct bs=512 seek=sector_number count=1

After that, check the SMART status again and the pending_count should have gone down. If the reallocated_count is still zero, then the disk is fine.

  • 1
    I ran badblocks, and it didn't find anything: ubuntu@ubuntu:~$ sudo badblocks -vsb 512 /dev/sda Checking blocks 0 to 312581807 Checking for bad blocks (read-only test): done Pass completed, 0 bad blocks found. But in disk utility, current pending sector count and uncorrectable sector count are still 1. I even ran it in destructive write mode (badblocks -wsb 512 /dev/sda --I don't care about the data at this point), and it didn't find any bad blocks after 4 passes. Any other suggestions?
    – bmaupin
    May 27 '11 at 15:52
  • @Bryan and the counts are still 1 after the write test? And you aren't mixing up the drives and running badblocks on a drive other than the one you are reading the smart status from? If so, then your drive must have buggy firmware.
    – psusi
    May 27 '11 at 17:26
  • @psusi yes, the counts are still 1. There's only one drive in the system, but I verified it by installing the smartmontools package and running sudo smartctl -a /dev/sda. I'll see if there are any firmware updates. If not, I need to convince Seagate the drive is bad, because according to Seatools it's fine, but "Seagate reserves the right to return a good drive back to its owner and to charge for all associated shipping costs." Thanks for your help!
    – bmaupin
    May 27 '11 at 17:33
  • Just to make sure, the count of 1 is in the pending attribute, not reallocated, right?
    – psusi
    May 27 '11 at 19:06
  • Yes, I have a count of 1 for "Current Pending Sector Count", ID 197, and a count of 1 for "Uncorrectable Sector count", ID 198
    – bmaupin
    May 27 '11 at 22:12

I find that the disks utility is fairly accurate. when it reports bad sectors though, it includes pending sectors. as in you could have 2 pending sectors (sectors with poor performance) and it would tell you there are a few bad sectors.

The statement "a few" isn't exactly explicit either, and is relative to the disk size. As in, a 4GB disk with 53 "failed sectors" is in critical condition. (IMHO) where a larger disk with more sectors may also have more sectors available for failure. disks does no such analysis of those conditions, it simply reports back on the sensor data.

failed or pending MBR sectors can cause boot problems when the disk just doesn't respond in time to boot.

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.