Saturday, June 23, 2018

hard drive - Is Disk Utility reliable?



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?



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.


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...