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

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: