Jump to content

Shell script for checking md5sum of CDs


Guest ndeb
 Share

Recommended Posts

The script has been tested to work fine with supermount enabled. The cdrecord package must be installed for the script to work. I got it from http://www.troubleshooters.com/linux/coast...ess.htm#rawread and rectified some errors and here's what I use:

#!/bin/sh



device=$1



if test "$1" = ""; then

       echo "  Usage:   rawread <cdrom-device>"

       echo "  Example: rawread /dev/cdrom"

       exit 0

fi



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

Link to comment
Share on other sites

I have supermount enabled. I tried

cat /dev/cdrom | md5sum

for mdk-9.0 CD1 and got

ca676384df5ed11ff6900a513b18bcf6

which is wrong.

 

With the same CD and CD drive, when I ran

rawread /dev/cdrom | md5sum

I got the correct md5sum

f7a093af34b8cbe1abc165213fea9deb

 

Clearly, the cat command does not work.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...