checking a burned CD against an ISO

John Vetterli jvetterli-zC6tqtfhjqE at public.gmane.org
Wed May 23 15:28:06 UTC 2007


I usually just use:

 	readcd dev=<device> f=- | diff -s - <filename>

where <device> is the scsi "scsibus,target,lun" and <filename> is the iso 
file.  Try "man readcd" for more info.

HTH
JV

On Tue, 22 May 2007, Sy Ali wrote:

> Because of some odd issue with k3b not verifying a burned disk, I went
> ahead and explored a better way to compare the disk.  Thanks to some
> earlier advice I already had the groundwork, but I wanted to make
> things a bit easier.
>
> So I came up with the following script.
>
> It seems to work fine - and both works and fails under the correct
> circumstances.. but is there anything which anyone here would change
> to make for less cutting-and-pasting or cleaner/happier code?
>
>
> ISO_FILENAME=pclinuxos-2007.iso
> MD5_FILENAME=pclinuxos-2007.md5sum
> DEVICE=/dev/dvd
>
> # SOURCE_MD5=`md5sum $ISO_FILENAME`
> SOURCE_MD5=`cat $MD5_FILENAME`
> # Remove the trailing filename
> SOURCE_MD5=`echo $SOURCE_MD5 | sed "s/$ISO_FILENAME$//"`
>
> FILESIZE=$(stat -c%s "$ISO_FILENAME")
> DISK_MD5=`dd if=$DEVICE | head -c $FILESIZE | md5sum`
> # Remove the trailing hyphon
> DISK_MD5=`echo $DISK_MD5 | sed "s/-$//"`
>
> echo ""
> echo ""
> echo ""
> if [ $SOURCE_MD5 = $DISK_MD5 ]; then
>  echo "$ISO_FILENAME: OK"
> else
>  echo "Sorry, your disk is not ok"
>  echo "I checked $ISO_FILENAME against $MD5_FILENAME"
>  echo ""
>  echo "md5sum was $SOURCE_MD5"
>  echo "cd sum was $DISK_MD5"
> fi
> --
> The Toronto Linux Users Group.      Meetings: http://gtalug.org/
> TLUG requests: Linux topics, No HTML, wrap text below 80 columns
> How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists
>
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list