- 0 Talk
-
How to verify a burned CD or DVD image on Linux
Redirected from Howto verify a burned CD or DVD image on Linux
There are multiply ways to verify CD or DVD burn in Linux.
Contents |
Using Graphical software
Edit
Method 1: Using X-CD-Roast)
Edit
After burning an image, within X-CD-Roast
- Click Verify Tracks on the left side of the window.
- Make sure the Read Device is the CD/DVD drive you are using, and the Image Directory is correct.
- Select image you wish to verify, and click Verify selected tracks
- A second window will popup, and compare the image to the CD/DVD
- It may take some time to scan
- It will show the results at end of scan
Command line
Edit
- Create the following script
- Make is executable
- chmod 755 verifycd
- Run the script
- verifycd /dev/cdrom image.iso
Script
#!/bin/sh
######################################
# Usage: verifycd CDROM_DEVICE ISO_IMAGE
# example: verifycd /dev/cdrom image.iso
#
# References: http://www.troubleshooters.com/linux/coasterless.htm
# http://howto.wikia.com/wiki/Howto_verify_a_burned_CD_or_DVD_image_on_Linux
# Inputs
DEVICE=$1
IMAGE_FILE=$2
# temp files
MD5SUM_ISO='md5sum-file.txt'
MD5SUM_CD='md5sum-cdrom.txt'
# Checking cd's blocksize and count
echo "Checking CD's block size, and count..."
blocksize=`isoinfo -d -i $DEVICE | grep "^Logical block size is:" | cut -d " " -f 5`
if test "$blocksize" = ""; then
echo catdevice FATAL ERROR: Blank blocksize >&2
exit
fi
blockcount=`isoinfo -d -i $DEVICE | grep "^Volume size is:" | cut -d " " -f 4`
if test "$blockcount" = ""; then
echo catdevice FATAL ERROR: Blank blockcount >&2
exit
fi
echo "block size: $blocksize"
echo "block count: $blockcount"
#Command for reading disk
raw_read_command="dd if=$DEVICE bs=$blocksize count=$blockcount conv=notrunc,noerror"
#Getting checksums
echo "Reading CD and creating check sum..."
$raw_read_command | md5sum > $MD5SUM_CD
echo "Reading ISO and creating check sum..."
md5sum $IMAGE_FILE > $MD5SUM_ISO
# Comparing md5 checksums
echo "Comparing check sums..."
cat $MD5SUM_ISO | while read CODE NAME; do
if [ -n "`cat $MD5SUM_CD | grep $CODE`" ]; then
echo "Success: $NAME"
else
echo "Failure: $NAME"
fi
done
#Cleaning up
rm -f $MD5SUM_CD $MD5SUM_ISO