Zed Lopez

MD5 Checksum of a CD

I’ve been playing around with some new Linux CDs. A while back, I crowed about getting 200 CDs on the cheap. It turns out they were cheap in every sense, and between a third and a half of them turn to coasters when I use them. So I thought I’d start looking at the burned CD’s checksum to verify it. Surely there was some easy way to do that; I just didn’t know what it was.

Turns out: not really.

There’s this mess, requiring a local copy of the .iso:

dd if=/dev/cdrom | head -c `stat --format=%s /ISO/Mandrake/MandrakeLinux-9.2beta1-CD1.i586.iso` | md5sum

and there’s just cmping it — if the CD eofs first, there was a problem.

$ cmp /dev/cdrom /ISO/Mandrake/MandrakeLinux-9.2beta1-CD1.i586.iso
cmp: EOF on /ISO/Mandrake/MandrakeLinux-9.2beta1-CD1.i586.iso

And then maybe none of the above will work on modern high-speed anti-vibration drives.

I did find that reading a CD in one of the high speed anti-vibration CD drives can be a problem — in trying to do the md5sum after burning on such a CD drive using “md5sum /dev/cdroms/cdrom1” I got inconsistent results.