I'm trying to recover data from an old 320G hard drive (full of bad sectors) to a new one. I found that ddrescue is a good tool for this task due to it's smart algorithm. I have already done this once with following command:
ddrescue -f -n /dev/sda /dev/sdb log
It was completed in several hours with errsize 16G (unrecovered) wich still may contain important data, so I ran next pass:
ddrescue -f -d /dev/sda /dev/sdb log
but it runs too slow (avg 300B/s) because linux getting stuck on each bad sector.
It's actually linux kernel (probably libata), not a hard disk itself, because I tried to recover in DMDE tool running on clean DOS and there was no such problem: ATA timeout can be tuned there and overall recovery process runs MUCH faster.
But not in Linux.
I also tried these kernel parameters:
libata.force=noncq,norst and also
libata.dma=0 passing to cmdline at bootlader, but it had no effect (im using System Rescue CD where LIBATA compiled in kernel).
Also tried to change device timeout:
echo 1 > /sys/block/sda/device/timeout
(default is 30)
but it's only generates more errors flood in syslog and don't help.
Passing bad blocks still takes 1-3 minutes for each sector wich is incredebly slow. How much time it need for parsing 16GBs of "bad" chunks? A week? Month?
I still prefer ddrescue for recovery (due to its efficient algorithm and logfile functionality) and want to know how to tune kernel driver to speedup ata/disk error handling. Google and related questions here on SU did'nt help. Any ideas?
P.S. sorry for my english
Why don't you just restore from your regular backups?
This hard disk of my friend, not mine. So sad, he have no backups. Now, after disk crash, he starting think about making backups, yes :)
UPD: 2.5 years later I still don't know the answer, but just realized that
ddrescue works faster when sata controller is in Compatibility (IDE) mode, another tip is always use
-d option (direct access) to speed up things slightly. Also take a look at
hdparm options to tune HDD (
-P), it could help (on old hardware).
UPD2: Just noticed the Slizzered's answer to related question. It's great! I tried:
smartctl -l scterc,20,20 /dev/sda
and recovery went much faster than before (only in IDE mode though).