looking for way to verify whether a CD/DVD was correctly burned

Bill Davidsen davidsen at tmr.com
Fri Dec 1 19:59:47 UTC 2006


Paul Smith wrote:
> Dear All
> 
> Is there some way to verify whether a CD/DVD was correctly burned?
>

This is a more common question on the cdwrite mailing list, here's how. 
Assume /dev/hdc is the CD burner, and orig.iso is the ISO filesystem you 
burn.

blox=$[$(wc -c <orig.iso / 2048]
dd if=/dev/hdc bs=2k count=$blox | md5sum - orig.iso

Wasn't that easy? No? Did you leave off the "<" in the first line? Now, 
if you have certain kernels, when reading a CD/DVD the readahead past 
EOF is botched. In that case you have to disable readahead on the CD with

blockdev --setra 0 /dev/hdc

(as root). PITA? Yes, update your kernel or live with it.

The two lines can be put into a script which takes the filename. Or if 
you like which takes the filename, the burner device, runs the burn and 
does a verify.

Anyway, that's how you do it...

-- 
Bill Davidsen <davidsen at tmr.com>
   Obscure bug of 2004: BASH BUFFER OVERFLOW - if bash is being run by a
normal user and is setuid root, with the "vi" line edit mode selected,
and the character set is "big5," an off-by-one errors occurs during
wildcard (glob) expansion.




More information about the fedora-list mailing list