[clug] md5sum and verifying DVD

Tony and Robyn Lewis beakysnugger at yahoo.co.uk
Thu Jul 28 02:06:59 GMT 2005

Carlo Hamalainen wrote:

>c at t40:~$ md5sum 1.iso
>d7563e63f8e6306de0466cd3b3576571  1.iso
>c at t40:~$ md5sum /dev/hdc
>6b76ba56f97770f641012f156eba3a25  /dev/hdc
>Why are they different? What am I doing wrong here?
I suspect you'll find that it'll be reading trailing zeros/nuls/rubbish 
at the end, which changes the MD5 hash.

There might be a prettier way, but try:
 * finding the size of the ISO in bytes
 * dd if=/dev/hdc | head --bytes=<size> | md5sum

I haven't tried this.  You might find that the block sizes in dd defeat 
you.  If that's the case, and it's important enough to wait a long time, 
 * dd if=/dev/hdc bs=1 | head --bytes=<size> | md5sum

This will read one byte at a time - a lot slower.  There are probably 
better ways...


More information about the linux mailing list