Checksumming CD or DVD media

Note on the MD5 command: On OS X, it’s md5. On RHEL it’s md5sum.

Doing it properly

Checksumming an ISO image is easy:

[user@localhost ~]# md5sum centos-5.5.i386.iso  

When you burn this to a DVD, you can verify that everything’s good by
first getting the size of the ISO in bytes:

[user@localhost ~]#  ls -l centos-5.5.i386.iso  
-rw-r--r-- 1 user user 4185118720 May 20 15:40 centos-5.5.i386.iso

Now divide that by 2048 (4185118720 √∑ 2048 = 2043515). You can now
verify the DVD the ISO was burned to using:

[user@localhost ~]# dd if=/dev/sdc bs=2048 count=2043515 | md5sum  

This verifies a successful burn. Merely using dd if=/dev/sdc | md5sum
will always give you an incorrect checksum!