1

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.

  • Hi, Welcome to unix Stackexchange! Did you try the answers on this post?:https://unix.stackexchange.com/questions/39467/how-to-verify-a-cd-against-an-iso-image seems like they might work... – Nordine Lotfi May 15 '21 at 20:11
  • 1
    Thanks! I did try the solutions found there—in fact, that thread is linked in my post. Unfortunately the solutions only seem to work for ISO files. Dumping a burned disk, even to a BIN/CUE file, results in a different filesize and will combine multiple BIN files into one. – roughtartlet May 15 '21 at 20:27
  • 1
    I see. I guess you could try and mount the CD + the BIN/CUE file, and compare the content inside of those, either by using cmp or hashes. You tried this too? (because this is referenced in the link above and on your post) – Nordine Lotfi May 15 '21 at 20:39
  • 1
    I missed that—thanks for pointing it out! I was able to solve my issue this way. I'll post a writeup once I can pack it into a script. Thanks again! – roughtartlet May 15 '21 at 21:07
  • No problem. Glad you found a solution :D – Nordine Lotfi May 15 '21 at 21:50

0 Answers0