Get ISO From CD For Checksum Verification

WRONG WAY:  This will generate an ISO file but its checksum will be different from the source ISO image:

dd if=/dev/sr0 of=/tmp/disk_image.iso

RIGHT WAY:  To generate an image identical to the source, first find CD info

$ isoinfo -d -I /dev/sr0 | egrep -i 'block size|volume size'
Logical block size is: 2048
Volume size is: 275040

Next, use the logical block size for the ‘bs’ operand and volume size for the ‘count’ operand:

$ dd if=/dev/sr0 of=/tmp/disk_image.iso bs=2048 count=275040

This will create a ISO file identical to the source, thus having the same checksum.

Or just skip the ISO file and pipe the image to md5sum, for example.

$ dd if=/dev/sr0 bs=2048 count=275040 | md5sum