Monday, July 16, 2007

md5sum checksum howto

What is md5sum?

From Wikipedia:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
md5sum is a computer program which calculates and verifies MD5 hashes, as described in RFC 1321. The MD5 hash (or checksum) functions as a compact digital fingerprint of a file. It is extremely unlikely that any two non-identical files will have the same MD5 hash (although it is certainly possible).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Let us try to use it then to verify the file integrity of an image file named F7 DVD ISO, for example.

# md5sum F-7-i386-DVD.iso

Since we are comparing md5 checksums, the result of this command should be exactly the same with the ones we get from the site of where we dloaded the ISO image file.

Now, if we want to do it for multiple files, say 3 or more ISO image files, we can create a check.txt text file and populate the file with the correct values:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
355bdb01b0268a4bb7c757f2737dcf7c F-7-i386-DVD.iso
89d337f5543474532027950b44ecbdd5 FC-6-i386-DVD.iso
b5633ee6ee3b2e10d92672c74e594d75 CentOS-5.0-i386-bin-DVD.iso
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
** Notice the 2 spaces between the two columns.

First column is the md5 string and second column is the location of the file. To check all of them, do this:

# md5sum -c check.txt

It would give you similar lines like this

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
F-7-i386-DVD.iso: OK
FC-6-i386-DVD.iso: OK
CentOS-5.0-i386-bin-DVD.iso: OK
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Remember, if the md5sum result doesnt match, it is not adviseable to burn that ISO image.

HTH

0 comments:

Sign up for PayPal and start accepting credit card payments instantly.
ILoveTux - howtos and news | About | Contact | TOS | Policy