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

Re: good tool to recover scratched CD's/DVD's?



Tyler MacDonald <tyler@yi.org> wrote:
> I've completed recovery now and have ended up with maybe a few gigs of files
> (out of hundreds of DVD's) that can't be covered. I think that's a pretty
> good recovery rate... and the files that were lost aren't exactly rare, so I
> should be able to find them again.

  Oh, and if anybody's interested, here's a simple shell script I wrote for
my first pass recovery. Here's what I did:

  - First, run this script -- if it succeeds, great, if not, stick the disc
    on a "maybe" pile

  - Clean the discs on the "maybe" pile, and try them on dvd reader #2... if
    they dont work, try them on dvd reader #3, if they still dont work, put
    them on the "maybe not" pile

  - Run dvdisaster (used to be dd_rescue until I got that amazing
    reccomendation) on the "maybe not" pile to create flawed iso images

  - Import files from flawed images to HD, run them against their sha1 file,
    delete any that fail

  Well over a 99% recovery rate, probably closer to 99.9%... I'm glad my
DVD's held up :-)

  Anyways, here's the script I used for the first pass..

  Cheers,
    Tyler
#!/bin/bash

set -x
set -e

CDROM=/cdrom

if test -z "$TMPDIR"
then
  TMPDIR=/tmp
fi

real_cdrom=`realpath "$CDROM"`

if test -z "$1"
then
  echo "Usage: $0 [dir]"
  exit 1
fi

dest="$1"

if grep -q "$real_cdrom" /proc/mounts
then
  umount "$real_cdrom"
fi

mount "$real_cdrom"
phys=`fgrep "$real_cdrom" /proc/mounts | awk '{print $1}'`
infof=`mktemp -p "$TMPDIR" cpcdiXXXX`
/lib/udev/vol_id "$phys" | sed -e 's,=,=",' -e 's,$,",' > "$infof"
. "$infof"
rm -f "$infof"
ddir="$ID_FS_LABEL_SAFE"
fdest="$dest/$ddir"

if test -e "$fdest"
then
  echo "$fdest already exists."
  exit 1
fi

tdest=`mktemp -p "$TMPDIR" cpcdXXXX`
rm -f "$tdest"
mkdir "$tdest"
tfdest="$tdest/$ddir"

if cp -av "$real_cdrom/." "$tfdest"
then
  chmod -R u+w "$tdest"
  if mv "$tfdest" "$fdest"
  then
    echo "$ddir copied to $tfdest"
    exitt="0"
  else
    echo "move from $tfdest to $fdest failed"
    exitt="1"
  fi
else
  echo "$ddir FAILED copy to $tfdest"
  exitt="1"
fi

rm -rf "$tdest"
umount "$phys"
eject "$phys"
exit "$exitt"

Reply to: