Verify optical media data integrity

I've burned .iso image to CD-RW with burncd
Now I wana compare optical media, to that file.iso :stud

So I can ensure that, there are no data read errors, on optical media.

How do I do that? :stud
 
Use md5(1) and/or sha256(1) to get hashes of the original and the copy?

Something like:

Code:
md5 file.iso /mnt/cdrw/file.iso
sha256 file.iso /mnt/cdrw/file.iso

This should produce two sets of identical hashes.
 
I can't use yours method, as once burned file.iso to optical media, does not contain file.iso, as it is image.

So newly burned and mounted optical media contains list of files and not file.iso on which I could use md5 or sha256

So, yours method is applicable only after this:
Code:
# dd if=/dev/acd0 of=filename.iso bs=2048
Now I can use:
Code:
# md5 filename.iso already_burned.iso
# sha256 filename.iso already_burned.iso
 
In Linux (and probably BSD as well) you can md5sum an unmounted device and it'll do exactly what you want.

Code:
md5sum /dev/scd0 file.iso


I haven't tried it, but you could probably pipe the output of a dd command into md5sum to bypass writing to disk. Something like:

Code:
dd if=/dev/acd0 bs=2048 |md5;md5 file.iso

Again, I have not tested this, so I don't know if it would work or not. Don't see why not though.
 
Back
Top