Home » Questions » Computers [ Ask a new question ]

External Hard Drive bad sectors recover/mark utility in linux

External Hard Drive bad sectors recover/mark utility in linux

I've just installed the new version of Ubuntu, Karmic Koala, in my laptop. Everything is fine, except for the fact the system identified about 300 bad sectors in my 1TB external hard drive. I'd like to recover or just mark then. Is there any free utility, that I can run on Linux, to accomplish this?

Asked by: Guest | Views: 411
Total answers/comments: 3
Guest [Entry]

"If the OS itself is showing bad sectors, then your drive is going downhill. The hardware should be removing bad sectors from service transparently, and it may have run out of spare sectors to remap to. If this is the case, your data is very much at risk.

I'd take David's suggestion to heart and migrate your data ASAP. You may want to install ""smartmontools"" and run smartctl to see what the device itself reports.

You can try using the ""badblocks"" utility on the raw device which houses your NTFS drive, since it works on the device and is not filesystem dependent. Make sure you read the man pages CAREFULLY and use the non-destructive mode. It should be able to read each sector, then re-write each sector. Doing this should force the drive itself to remap any problematic sectors. Test this procedure on a USB stick or some other media first.

I recommend you tell badblocks to process a large number of sectors at a time, since a 1TB drive will take a very long time to scan.

Again... make sure you know what you are doing. One slip and your data is toast.

If the data is valuable to you and you're not confident in your abilities, you may wish to use a commercial solution such as SpinRite (though, it's pricey and will require a Windows machinie). Note, I've never used SpinRite, but I've heard good things about it online."
Guest [Entry]

"fsck.ext4 -cDfty -C 0 /dev/sdxx

source: http://www.commandlinefu.com/commands/view/8474/run-a-ext4-file-system-check-and-badblocks-scan-with-progress-info"
Guest [Entry]

"If you hope to retain the data on that external partition, you do not want to write to that drive ever again, which some of these answers propose.
Instead, use a forensic recovery tool to image the drive. ddrescue is my favorite tool for such work.

Here's my ""notes to self"", which are mac specific, but cover the main points: Identifying the hardware /dev mount names of source and target, unmounting them, then sweeping the source onto the target, with read-retry disabled, logging read errors, but skipping the failing blocks for last.

Forensic imaging of disks and/or rescuing failing disks: Gnu ddrescue
(not the same as dd_rescue, though similar) All needs to be done as root.
First confirm your device mounts:
diskutil list
Unmount source (eg disk1) (and destination if sending to a physical partition, instead of a raw image file):
diskutil unmount disk1
Do a block-by-block image copy, from disk1 to a mountable disk image file, creating a log and first focusing on the readable parts:
ddrescue -v /dev/disk1 myrescueddisk.dmg rescue.log"