Tips Linux Explorers   All Things Linux Forum   Great Linux Links   LinuxClues.com   Hometown   Email 



CHECK CD SCRIPT:



Imagine, you did the checksum on the ISO and you burned the CD, still you want to double check the integrity of the files on the CD . . . .

Here is a little script that will do the checksum on your CDs. You do need the original checksum to compare with the outcome of this script.

CODE
$ vi checkcd

"i" ( to put vi in insertmode )

And paste the following lines:

QUOTE (Text @ Script)
#!/bin/sh
#checkcd

device=$1

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

command="dd if=$device bs=$blocksize count=$blockcount conv=notrunc,noerror"
echo "$command" >&2
$command


< Esc > ( put vi in command mode )
"ZZ" ( save the file )

CODE
$ su
< password >
# chmod 755 checkcd


CODE
# ./checkcd /dev/cdrom | md5sum


This should give you the md5sum after a minute. Check it with the original and then you´re sure the CD is 100% perfect.


Bruno


NOTE: For more information on CDWriting, see the following comprehensive article by Steve Litt here which includes other sniplets of code like the one above and some very interesting concepts: Coasterless CD burning © by Steve Litt


-- Dec 4 2003 ( Revised Dec 9 2005 ) --


Tips Linux Explorers   All Things Linux Forum   Great Linux Links   LinuxClues.com   Hometown   Email