copying a disk with ignoring errors

Polytropon freebsd at
Mon Jul 5 19:39:56 UTC 2010

On Mon, 05 Jul 2010 16:09:23 +0200, Christoph Kukulies <kuku at> wrote:
> Some student lost some important data due to disk failure.

He will restore it easily from backup. :-)

> I tried PHKs' recoverdisk with  recoverdisk -b 1024000 /dev/ad2 ad2.dmp
> and it went off quite promising just few dma read timeouts and when I 
> was at 7% of recovery
> it suddenly says:
> ad2: FAILURE - device detached.
> 1558528000 1024000 failed (device not configured)
> #

Not good. Can you obtain an 1:1 copy of the disk using ddrescue?
And it's often easier to operate partition-wise, if there are
functionally separated partitions on the disk; let's assume
the /home directory was mounted from slice 1 partition f, then

	# ddrescue -d -r 3 -n /dev/ad2s1f home.ddr logfile

If you are lucky to get a copy of this partition, you can try
to apply analytic and repairing tools to that partition copy.

> Hmm. How can I avoid that the device gets detached?

I do not think you can do anything against it. A device detachment
means a MASSIVE failure. It *can* be a problem of the controller,
but mostly it is a problem of the disk itself. There can be a way
to get around it - by replacing the disk's PCB with an identical
one. But it's not for sure that this will work, e. g. if the disk's
drive components have massive defects.

A device detachment at least doesn't look like an "easy" I/O problem
within the drive's components (the platters, heads, the motors).

The error must be that massive that the disk itself says goodbye
to the system and disappears so that no control commands will reach

You can try "atacontrol reinit" to force the disk back on-line,
but it may refuse to do so. See "man atacontrol" for other options.
You can also use the "smartctl" program (from port "smartmontools")
to check the drive's error memory to see what has caused the detachment;
maybe there's some information there.

It's like /dev/cpu: device disappeared. :-)

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

More information about the freebsd-questions mailing list