bug-ddrescue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-ddrescue] Re: Reverse mode - yeah, it really is important


From: Piotr Pawłow
Subject: [Bug-ddrescue] Re: Reverse mode - yeah, it really is important
Date: Sun, 11 Jul 2010 05:06:50 +0200
User-agent: KNode/4.4.2

Jay R. Ashworth wrote:

> In any event, not being able to copy starting at the back of the drive and
> working forwards means that one is forced to binary search the drive by
> hand:
[...]

I wrote myself a script to automate it.

It scans a log file from ddrescue, finds the largest non-tried area and 
splits it in half. Then the script tries "hdparm -I" on given source drive 
to see if the drive is still responding. If the drive responds, the script 
calls ddrescue on the second half and repeats the whole process until all 
blocks are scanned, otherwise it exits with an error.

I wish I could call ddrescue on the first half to go in reverse...

Anyway, I put in rc.local something like this:

if grep -q "recovery" /proc/cmdline ; then
 cd /root/recovery
 if ./ddranalog.pl -e 0 -c 1 -n /dev/xxx /dev/yyy xxx.log ; then
  echo "finished"
 else
  echo 0 > /sys/class/rtc/rtc0/wakealarm
  echo `date '+%s' -d '+ 30 seconds'` > /sys/class/rtc/rtc0/wakealarm
  /sbin/poweroff
 fi
fi

/root/recovery/ddranalog.pl is the script mentioned earlier. Originally I 
wrote it to analyze log files, thus the name :) It will pass all given 
arguments to ddrescue, adding "-i" and "-s" arguments calculated from the 
log.

If the disk stops responding, ddranalog.pl script exits with error, and the 
computer turns off. Then the RTC alarm wakes the computer up, the system 
boots and continues the recovery.

I have an entry in grub with "recovery" added to kernel arguments, and I 
make it the default when I do a recovery job.

Unfortunately, my script works with an old ddrescue version only, and it 
expects an old ddrescue binary in the current directory. I use version 1.2. 
Newer versions added more stuff to the log file and more recovery logic 
which is useless for me and only complicate matters. The script is also very 
messy as I just add stuff to it and never have time to clean it up.

Anyway, if you're interested, it's here among all my temporary junk stuff:
http://pp.siedziba.pl/tmp/ddr/

Regards




reply via email to

[Prev in Thread] Current Thread [Next in Thread]