You are not logged in.
#!/bin/bash
if [ "$#" -ne 2 ] ; then
echo use "$0" cdromdevice isofile
exit 1
fi
if [ ! -b "$1" -o ! -f "$2" ] ; then
echo both files must exist
exit 1
fi
LSIS="^Logical block size is: "
VSIS="^Volume size is: "
L=`isoinfo -d -i "$1"`
BS=`echo "$L" | grep "$LSIS" | sed -e 's.[^0-9]..g'`
VS=`echo "$L" | grep "$VSIS" | sed -e 's.[^0-9]..g'`
if [ x"$BS" = x -o x"$VS" = x ] ; then
echo Error getting media info
exit 1
fi
dd if="$1" bs="$BS" count="$VS" conv=notrunc,noerror \
| md5sum | sed -e 's- .*--' > ~/silverdisk
md5sum "$2" | sed -e 's- .*--' > ~/isoimage
if ( diff ~/silverdisk ~/isoimage ) ; then
echo $0: "The copy is ok".
else
echo -e $0: "\x1b[31mISO file and copy are not identical!\x1b[0m".
fi
rm ~/silverdisk
rm ~/isoimage
I bought new blank DVDs, but some copies I burned where unusable. So now I make an iso image (with graveman), burn it with growisofs and finally check if it is ok with this little script that make md5sum of both things and check if they are identical.
Since dd reads every part of the dvd it should work well.
Last edited by ezzetabi (2007-04-07 16:46:07)
Offline