[Discuss] K3b verify problems
John Blomfield
jabfield at shaw.ca
Mon Mar 24 23:11:17 PDT 2008
I'm not a script writer so feel free to criticize but here is a possible
bash file based upon Alan's commands:
#!/bin/bash
# usage isoverify.sh [iso file path] [cd device path]
# eg ./isoverify.sh [/path/xxxxxxxxx.iso] [/dev/cdrom ]
# $1 = iso file path
# $2 = cd device path
# extract the number of bytes from iso file
SIZE=`ls -l $1 |cut --delimiter=" " --field=5`
#pipe that number of bytes from CD to md5sum and parse result
CDMD5SUM=`head --bytes=$SIZE $2 | md5sum |cut --delimiter=" " --fields=1`
echo "CD md5sum = "$CDMD5SUM
#get md5sum for iso file and parse result
FILEMD5SUM=`md5sum $1 |cut --delimiter=" " --fields=1`
echo "iso file md5sum = "$FILEMD5SUM
if [ $FILEMD5SUM = $CDMD5SUM ]; then
echo "CD burn successful!"
else
echo "Fail - Error in md5sum for the CD burn!"
fi
John Blomfield
Alan W. Irwin wrote:
> On 2008-03-24 08:24-0700 pw wrote:
>
>> Alan W. Irwin wrote:
>
>>> head --bytes=size /dev/cdrom |md5sum
>
> Should have been
>
> head --bytes=$size /dev/cdrom |md5sum
>
>> This appears to be a good way of doing it. The only problem I can see
>> with this method is that it only tells you if the file organization and
>> number of bytes are the same for all files, not whether the content of
>> all files are the same.
>
> Actually it does that as well, see below.
>
>>
>> If you have corrupted files that are the same size as original,
>> the MD5 for the ISO image should be different.
>
> Exactly. Since md5sum is involved in the above it prints out the
> md5sum of
> the CD which you can then manually compare with the expected result
> which is
> normally on the iso download site. If identical, then no corrupted
> files.
> If non-identical, then something has been corrupted in the download or in
> the cd burn. You can apply md5sum to the downloaded iso file on your HD
> to see whether it is a download error. If the downloaded iso is fine,
> but
> the CD iso md5sum is not, then it is a CD burn error.
>
> Alan
> __________________________
> Alan W. Irwin
>
> Astronomical research affiliation with Department of Physics and
> Astronomy,
> University of Victoria (astrowww.phys.uvic.ca).
>
> Programming affiliations with the FreeEOS equation-of-state
> implementation
> for stellar interiors (freeeos.sf.net); PLplot scientific plotting
> software
> package (plplot.org); the libLASi project (unifont.org/lasi); the
> Loads of
> Linux Links project (loll.sf.net); and the Linux Brochure Project
> (lbproject.sf.net).
> __________________________
>
> Linux-powered Science
> __________________________
> _______________________________________________
> Discuss mailing list
> Discuss at vlug.org
> http://ladybug.vlug.org/cgi-bin/mailman/listinfo/discuss
>
More information about the Discuss
mailing list