Original Post
[Request]Linux Disk Repair
My friend's Win XP computer broke and the start up diagnostics indicate a broken sector in the HDD. I have a Backtrack 3 on a CD and it boots fine from there. I can even view the files on his HDD.

But I don't know much about Linux. Anyone know if theres commands or programs I can use to try to fix the HDD somehow? Like find what sector it is and skip it or something. \(_o)/
last time i had a broken sector, i had to fully Format it, then reinstall an operating system on a different sector.
strange thing is, after that, it didnt show a broken sector, but the problem was still there.
Might be your only choice
If your friend has the install disk of WinXP, he may be able to use the DOS Prompt on it to run chkdsk and recover the bad sector.

This could most likely be from a virus, so you might want to look into that.
i liek turtelz xd
if youre on linux it would be

sudo fsck
sudo fsck <device>
if its a fat32 system,
dosfsck -a <device>
not sure about ntfs systems, but these ought to work
ntfsfix <device>
<device> is the name used in the /dev directory
usually its /dev/hdb or /dev/hda

it will prompt the details of the harddisk so you get it right and not mess up the files
My opinion... If you get more than 10 errors then buy a new HDD. It'll eventually get worse and worse, specially after defragging or during major file operations!

1- Get a copy of Knoppix and burn on a CD using your fav. software or use the free "ImgBurn", which is great.
2- Get a new (empty) hard disk with the same capacity or bigger and connect it to the motherboard along with the damaged one (if its IDE then jumper it to slave).
Start the computer with knoppix CD.

Notice the device names of both the new HDD and the damaged one, you'll need them. To understand the device names in linux read this: https://help.ubuntu.com/8.04/install...ice-names.html

If you really need to save tons of important data and it keeps failing when you're trying to back up stuff into a USB Flash or External HDD, then type these commands in the console:

#Get IP by DHCP:
sudo pump -i eth0
# download ddrescue
wget http://download.savannah.gnu.org/releases/ddrescue/ddrescue-1.8.tar.bz2
# extract the source code
tar xjf ddrescue-1.8.tar.bz2
# compile ddrescue
cd ddrescue-1.8
./configure && make
# first, grab most of the error-free areas in a hurry. (old_disk and new_disk must be the correct device names of the hard disks)
./ddrescue -n /dev/old_disk /dev/new_disk rescued.log
# Optionally, try to recover deeply, as much of the dicy areas as possible:
./ddrescue -r 1 /dev/old_disk /dev/new_disk rescued.log
This way you can recover all the readable stuff... This might take several hours or even days on a heavily damaged hard disk! But its one of the best ways to get stuff out of it. So let it do the work during the night.
Last edited by GenkiSudo; Nov 12, 2009 at 09:18 PM.
"There is enough on earth for everybody's need, but not for everyone's greed." - Mohandas Gandhi
When I had a bad sector, I used a gparted live disk to fix it. Make sure to include the ntfs addon.
i have a totally post modern tattoo of a scalene triangle.
<DeadorK> fair maiden
<DeadorK> if the cum is going to be in your mouth
<DeadorK> it shall be in mine as well