Bad sectors: how bad can it be

Polytropon freebsd at
Tue Oct 27 14:05:21 UTC 2009

On Tue, 27 Oct 2009 08:31:18 +0100, Grünewald Michaël <michaelgrunewald at> wrote:
> Starting the machine by other means, I found that the hard-drive is  
> installed on has bad sectors. I am looking for advices on how to  
> recover from this, if possible.

If there's data on the disk you want to get back, first
make a dd copy of the drive or the partition in question.
Use an accurately working disk as the target. In case of
bad sectors, you should maybe try dd_rescue and ddrescue
because they can handle bad sectors often better than the
common dd. You'll find them in the ports.

After you got your dd copy, work with that for recovery.
Do not use the defective disk anymore, only if you messed
up the dd copy.

A command would look like this:

	# ddrescue -d -r 3 -n /dev/ad1s1f ads1f.dd ddrescue.log

The result is an image of the partition that you can then
mount again.

	# mdconfig -a -t vnode -u 10 -f ad1s1f.dd
	# mount -o ro /dev/md10 /mnt

If the file system isn't intact anymore, there are other tools
that may be able to help you, such as recoverdisk, ffs2recov,
magicrescue, testdisk, scan_ffs, recoverjpeg, photorec and
finally + ultimately, The Sleuth Kit (fls, dls, ils etc.).

> Basically the question is: shall I discard my hard-drive with bad- 
> sectors, or can I continue using it?

Discard it. Hard disks are cheap today, and bad sectors may
have the habit to multiply. Don't take that risk.

BUT: Discard it when you got all your important data off the

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

More information about the freebsd-questions mailing list