Burning a BIN/CUE image to a CD is pretty easy using cdrdao write --speed 1 --device /dev/sr0 path/to/image.cue
, but I can't find any way to verify the burn afterwards. I'm used to Windows utilities like ImgBurn which can read back the disk after the burn is complete to check for errors.
The common advice to use cmp /dev/cdrom path/to/image.iso
or to compare checksums doesn't work, especially if there's more than one BIN file. Using grep
to search for the reference bin file within a dump consumes too much memory—on my system, even with a CD, I run out of memory and the process is killed.
Is there a simple way to do this on Linux?
Partial solution :
Mount the image as a virtual disk with cdemu load any path/to/image.cue
, dump each with cdrdao read-cd --read-raw --device /dev/srX --datafile path/to/dataX.bin path/to/imageX.toc
, and compare with cmp path/to/data1.bin path/to/data2.bin && echo "OK!"
. (Simply using cmp /dev/sr0 /dev/sr1
does not work, so they must be dumped to a temp location first.)
Unfortunately, while this worked for the first image I tested, it does not work for any others that I have tried. The two dumps will come out different, producing a false negative, even in the following scenarios:
- Repeating the dump yields the same checksum, which rules out a random read error.
- Verifying a commercial CD (one that I did not burn myself) against a dump obtained through the internet also fails verification, which rules out a random write error.
- A disk burned and successfully verified with ImgBurn on Windows also fails this verification procedure, which rules out any true data corruption (as long as we trust ImgBurn's verification procedure).
So, it's probably due to some alignment/padding issue, resulting in a non-bit-perfect copy. This isn't an issue for actually using the burned media, but it will defeat a simple comparison using cmp
.