Bad Sectors Help ive check forums and irc i need help

Rashkae ubuntu at tigershaunt.com
Mon Dec 21 18:19:13 UTC 2009


Escobar, Marvin A wrote:
> My harddrive says it has bad sectors like current pending sector count. can someone please help me.i was going to do fsck but when i did  it prompt me saying it can do severe damage to my files so i didnt. can i please have some help
> 


This situation is potential dire.  If you have important information on
your hard drive that needs to be recovered, it might be best to simply
turn off the computer and engage pro help.

Here's how I would proceed.

First copy all data from the hard drive that can be recovered as is.  I
like to do a file copy, because then I can get a list of files that
could not be recovered without hitting a bad block.  It might be best to
get an image of the hard drive first instead. You should do this booted
from a live cd, (or boot from a known good hard drive)

For file copy, assuming old/failing hard drive is mounted /mnt/sda1 and
good new hard drive is mounted /mnt/sdb1

rsync -a /mnt/sda1/ /mnt/sdb1/recovered_filesystem/ &> /mnt/sdb1/errors.log

In this example, the files that rsync was unable to recover would be
found in your errors.log file.

If you wanted to just grab as much of the filesystem image as you can:

ddrescue /dev/sda1 /mnt/sdb1/recovered_ext3.img

Once you are satisfied with data recovery, you can attempt to restore
the hard drive with a low level format (see your hd manufacturer for
tools/utilities) or simply do it yourself by overwriting and testing the
entire surface of the disk.  (badblocks -w will do the trick nicely, 3
times over just to be sure.).  Bad sectors should get re-allocated by
the drive firmware and be completely transparent to the operating
system.  Personally, I would just toss it in a bin.




More information about the ubuntu-users mailing list