How to repair bad sectors on hard drive.
A while ago a friend of mine brought a laptop with a vista system that would not boot, i took out the hard drive and checked the smart data. Over 1000 bad sectors! (note- I just witnessed a new record, 2088 bad sectors.) It’s a miracle the hard still knew it had Windows on it. But how did this happen? Let’s go back to the start.
In the beginning, God created the chicken…. No No No that’s too far.
My friend was having trouble booting into his laptop sometimes, so I taught him the power of safe mode and restore. It went well until finally it just would not boot no matter what. But this happened because they never did a check disk. Windows comes with a great and powerful utility called. Check Disk (I think i don’t really remember). Let’s let Microsoft explain how to use it.
- Double-click My Computer, and then right-click the hard disk drive you want to check.
- Click Properties, and then click Tools.
- In Error-checking, click Check now.
Easy peasy right? Windows Vista/7 is the same thing really, but if you don’t believe me, read this. http://windows.microsoft.com/en-US/windows-vista/Check-your-hard-disk-for-errors also, windows XP may ask you to reboot.
You can also, remove the bad Hard drive, slave it over to another working computer, and use Disk check on that drive.
But let’s go to the extreme, this is what you’re supposed to do on a regular basis, or at least whenever you don’t shutdown your computer properly. But if you can’t boot into your system, then it’s time for Linux to the rescue.
Ubuntu in this case has fsck tool thingie that checks your hard drive for errors and such, even fixes them, there’s a gui for that too you know. Warning, the following will erase everything on your hard drive, but it will leave it nice and usable.
Plug that bad hard drive in and boot your Ubuntu.
Now open up Gparted.
Unmount that drive.
Delete that partition.
Create a new ext3 partition.
Now apply man apply! This will take around ten minutes maybe, after those ten minutes you will have a new ext3 partition, useless for windows but useful for us to check for errors.
Now, while still being in GParted.
Right click the newly creates EXT3 partition and click check. This will take forever depending on the size of your disk. Go do laundry, watch some Lost reruns and figure out the meaning of life. When you are done, your computer should be done too.
Then, delete the partition.
Format it as EXT2
Read what Jocko said below
Jocko said ”
If the filesystem is already mounted, unmount it by:
sudo umount /dev/hdXY
(if it’s your / or /home file system you may need to do it from a live cd)
Then start the check by:
sudo e2fsck -fpC 0 /dev/hdXY
the “-f” option will force a check even if the filesystem is marked as clean, “-p” will repair any errors and “-C 0″ will give you a progress bar in the terminal.”
PS also make sure the hard drive is formated as ext2 for this to work. this will take a long time if there are many errors, also make sure you press y to yes and fix all the errors, i did this i wished i had added the -y switch to answer default yes to all the questions but ended up using a mini mag flashlight as my -y switch. i only wish i had a camera right now.
(Update) Mehh this took too long i used this command.
sudo e2fsck -fyC 0 /dev/hdXY so far so good.
Note: This is not a real solution for badly damaged hard drive sectors, the real solution is to buy a new one, but this will work if you are cheap and don’t care much about reliability.
The sectors on Hard drives are stored in lists on a G List and P List, the G list the the bad sectors that keep Growing on there and are stored away for non-use. The P List is the list of bad sectors that came with your drive. Go figure.
You can also use one of my favourite utilies to check the SMART data on your computer. http://www.almico.com/sfdownload.php