Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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."

    im1

    im2

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?

share|improve this question
    
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

1 Answer 1

up vote 5 down vote accepted

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.

share|improve this answer
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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