Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have been looking into copying the contents of old CDs onto mobile disks in order to save space and preserve the content, since rewritable CDs appear to degrade over time (at least the ones I am using). I have come up with this little script which works nicely with ISO9660 formated CDs

#!/bin/bash
echo "Reading Volume Information"
SOURCECD=/dev/cdrw
OUTPUTCDDIR=/workarea/tmp
isoinfo dev=$SOURCECD || { printf "%b" "FAILED.\n" ; exit 1 ; }
VOLUMEID=`isoinfo -d dev=$SOURCECD | grep "Volume id" --color=never | awk -F": " '{ print $2}'` || { printf "%b" "FAILED.\n" ; exit 1 ; }
VOLUMESIZE=`isoinfo -d dev=$SOURCECD | grep "Volume size is" --color=never | awk -F": " '{ print $2}'` || { printf "%b" "FAILED.\n" ; exit 1 ; }
LABEL=$VOLUMEID-$VOLUMESIZE
OUTPUTDIR=$OUTPUTCDDIR/$LABEL
if [ -d "$OUTPUTDIR" ]; then # Dir exists, mention that...
echo "$OUTPUTDIR exists...exiting"
exit 1;
fi
mkdir -p "$OUTPUTDIR" || { printf "%b" "FAILED.\n" ; exit 1 ; }
OUTPUTISO=$OUTPUTDIR/image.iso
echo "Copying ISO for $LABEL"
dd if=$SOURCECD of="$OUTPUTISO" bs=2048 conv=sync || { printf "%b" "FAILED.\n" ; exit 1 ; }
echo "Verify Structures for $LABEL"
isovfy -i "$OUTPUTISO" > "$OUTPUTDIR"/verify-report.txt || { printf "%b" "FAILED.\n" ; exit 1 ; }
file "$OUTPUTISO" > "$OUTPUTDIR"/file-report.txt || { printf "%b" "FAILED.\n" ; exit 1 ; }
echo "Generating Metadata for $LABEL"
md5sum -b "$OUTPUTISO" > "$OUTPUTDIR"/md5.sum || { printf "%b" "FAILED.\n" ; exit 1 ; }
isoinfo -d -i "$OUTPUTISO" > "$OUTPUTDIR"/metadata.txt || { printf "%b" "FAILED.\n" ; exit 1 ; }
isoinfo -l -i "$OUTPUTISO" > "$OUTPUTDIR"/ls-lrt.txt || { printf "%b" "FAILED.\n" ; exit 1 ; }
eject $SOURCECD || { printf "%b" "FAILED.\n" ; exit 1 ; }

This works nicely with ISO9660 formatted CDs, however fails (not surprisingly) with UDF formatted CDs and DVDs. Does anyone have any ideas of tools like this which I can build to use a similar script for DVDs?

share
add comment

3 Answers

The standard tool is

dvd+rw-mediainfo /dev/dvd

I wouldn't expect it to work with CDs, in this case one needs to script around:

cdrwtool ... -i

To verify the filesystem I would try udffsck (aka fsck.udf) or udf_test (from udfct), although I have no experience with either of these.

At the point where you do isoinfo -l you would need to actually mount -t udf -o ro ... && ls -lrt && umount ...

share
add comment

dd is not the best way to copy the image, and will fail when it hits a read error.
The best program I have found, by far, is dvdisaster.

Not only will it re-read when errors are encountered,
it can generate an error correction file,
and also produces a surface scan graph
(if you see some areas taking longer to read, the media may be failing).

Even if there are read errors, if you created the .ecc file previously you can recover the image (and burn a new copy).

I am still keeping the output of dvd+rw-mediainfo /dev/dvd or cdrecord -atip dev=/dev/cd (as appropriate for the medium, to get manufacturer), plus .dvdisaster.log which has a list of errors (for tracking later, and to see if there is any correlation with manufacturers).

There are a number of CDs I had marked "unreadable" years ago that dvdisaster was able to recover. Works on video DVDs too (at least the ones I burned).

The ability to do a surface scan will depend on your hardware capabilities (newer drives should handle it?). Works great for me on Ubuntu with a cheap (< $20, Optiarc 'DVD RW AD-7260S') internal dual-layer burner. No success on OS X though, but that seems more like system software trying to seize control of the drive.

share
add comment

readcd from wodim/cdrecord can process any media blocksize and skip the unreadable slack. you might need IOUSB drivers from developer.apple.com to get it working.

Do you have power source to DVD drive outside USB cable? DVD laser draws more power than CD.

Also ISO label reading tools obviously will not handle UDF...

share
add comment

This site is currently not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .