Getting the right image

Update: Using Toad’s very useful comment this post now uses a better method. Thanks Toad!

As noted on the Xubuntu website, there is a most urgent need for testers of Xubuntu’s next release, 7.10, dubbed Gutsy Gibbon. Now, obviously you are eager to help out, so you download Xubuntu’s latest ISO image in order to burn it onto a CD. However, you realize that, when you report a bug in Launchpad, the error might just be caused by an incorrect download. How are you to know that your download completed successfully?

That’s where MD5 comes in. MD5 is an algorithm to convert input to a 32-character text string. When provided the same input, it will always return the same output. What’s more, it can even take a file as argument, including your ISO image!

You get it: if the MD5 sum (the output) of the image you downloaded is the same as the sum of the image on the server, your image is the same as the image on the server, and you know your download was not corrupted :)

So how do you get Xubuntu to calculate the MD5 sum of your ISO image? It’s simple, really. First, of course, you need the image itself, so go and download that, save it in a folder of your choice. You also need the MD5SUMS file listed on the same page, so click the MD5SUMS link.



You will see a text file that will look something like this:

d39feb6d64127aac844cf99d788f3b5b *xubuntu-7.10-alternate-amd64.iso
8a6e05a36ff5098ece6e3d28ad3b279a *xubuntu-7.10-alternate-i386.iso
41c7b57b82373d756adf6d90558c2c86 *xubuntu-7.10-desktop-amd64.iso
877ae9aceb9fa5abcc8f8758c3f9f111 *xubuntu-7.10-desktop-i386.iso

As you can guess, this file lists the MD5 sums that are associated with the files listed on the server. Save the file (in Firefox: File->Save Page As) into the same folder you downloaded the ISO image to.

When the download is complete, open Thunar (Applications->Accessories->Thunar File Manager) and browse to the folder you downloaded the image to. Right-click the part of Thunar where the contents of the folder is displayed and select “Open Terminal Here” (yes, you have to work in a terminal window, but it’s not scary or anything). A terminal window opens, in which you have to enter the md5sum command, with the -c argument and instruct it to use the MD5SUMS file. In short, enter this:

md5sum -c MD5SUMS

This will look for each file listed in the MD5SUMS file and, if it is present, calculate the MD5 sum of that file and compare it with the one listed in the file.
The output should be similar to this:

md5sum: xubuntu-7.10-alternate-amd64.iso: No such file or directory
xubuntu-7.10-alternate-amd64.iso: FAILED open or read
md5sum: xubuntu-7.10-alternate-i386.iso: No such file or directory
xubuntu-7.10-alternate-i386.iso: FAILED open or read
md5sum: xubuntu-7.10-desktop-amd64.iso: No such file or directory
xubuntu-7.10-desktop-amd64.iso: FAILED open or read
xubuntu-7.10-desktop-i386.iso: OK
md5sum: WARNING: 3 of 4 listed files could not be read



As you can see, it encounters a few errors about files not found, because, well, it can’t find some files… There are four files listed in the MD5SUMS file, but I only wanted to check the MD5 sum of one: xubuntu-7.10-desktop-i386.iso in my case. And look what it says:

xubuntu-7.10-desktop-i386.iso: OK

My MD5 sum is correct!

However, the image might still get corrupted when burning it onto a CD! Luckily, Xubuntu can check the MD5 sum when you boot the CD, by choosing Check CD for defects in the menu.



It will then “check the integrity” of the CD.



Once it has finished, it will notify you whether errors were found.



If no errors were found both in the downloaded image and burned CD, then you know that any errors encountered are not caused by a corrupt download or an error in burning the CD. Obviously, this means it is a bug and should be reported in Launchpad ;)

(And by the way, thanks for testing ;) )

About these ads

8 Responses to “Getting the right image”


  1. 1 Papa 8 October 2007 at 7:12 pm

    And .. the most important tip: do not burn another distro :-))

    Nice post Vincent !!

    Dad

  2. 2 Toad 21 October 2007 at 1:54 am

    Nice article, the pictures are sweet touch. I have two things to say, and I think they would be beneficial in your article. Perhaps you can add and flesh them out some. If you like my suggestions, I hope you can improve my ideas into some coherent; your writing style is much better than mine.

    This code below makes life very simple compared to running md5sum and comparing method. Personally, I hate comparing by hand, since it is slow and I’m afraid might miss something. For while, I used a little interactive python to do checking for me, then I found out about the -c option for md5sum.
    $ md5sum -c MD5SUM
    Where ‘MD5SUM’ is the file downloaded from the ubuntu download page, residing in the same directory as the .iso file.

    Either delete the other .iso entries in MD5SUM, or just ignore the errors md5sum will give since most likely the user hasn’t downloaded all of the .iso files that are referenced in MD5SUM. I recommend not deleting them just in case the user decides to try another .iso, the MD5SUM file won’t have to be re-downloaded.

    Second:
    Make sure the burned cd is correct. I’ve had cd’s that have had bad burns but good a .iso file. It seems there are two ways of doing this checking.

    method 1:
    Use the checking feature of the liveCD

    https://help.ubuntu.com/community/Installation/CDIntegrityCheck?action=show&redirect=CDIntegrityCheck

    method 2:
    use md5sum again, look at the ‘MD5SUM on CD’ section at the bottom of the page in the url below.

    https://help.ubuntu.com/community/HowToMD5SUM

    I found that the code there doesn’t quite work right anymore, but it’s nothing major. for some ‘cd /cdrom’ didn’t actually point to the cd.

    This is what I used to check my Ubuntu 7.10 cd
    $ cd /media/dvdrecorder
    $ md5sum -c md5sum.txt | grep -v ‘OK$’
    If the last command output anything, the burn is bad.

  3. 3 Vincent 21 October 2007 at 2:52 pm

    Toad, thanks a lot, that was very helpful (and less prone to humar error ;-) ). I’ve added it to the post :)

  4. 4 Toad 21 October 2007 at 6:57 pm

    You’re very welcome, glad I could help out. :) I think you have created the definitive Xubuntu post/article for MD5SUMing. :)

  5. 5 geomorillo 18 April 2008 at 1:49 am

    I can demonstrate that the original xubuntu 7.10 iso from the website contains corrupted files

    when i downloaded the iso the md5 was correct so the iso i have downloaded was right

    then i burned it into a cd twice, both cds reports 7 not found files, and 1 crc file error

    well maybe my cd writer is burning bad cds??

    i dont think so,

    So i’ve made a little test, i opened the iso file with winrar, and uncompressed it, the md5 reports again 7 not found files and 1 crc error

    So the original iso from the website contains corrupted files am i wrong???

  6. 6 Vincent 18 April 2008 at 8:24 am

    Have you tried booting it? (Supposing it was a LiveCD)
    The images have not been updated since 16 October 2007, and have since worked for many people.
    What might be the case is that the ISO’s also do not include those files on the server (accounting for the correct MD5 sum), and that these files are simply not needed (accounting for the many correct installations).
    MD5 does not, though, report missing files. It only gives an MD5 checksum which has to be the same as the one on the server. So I suppose it was something else that checked the CD and which somehow thought these files were supposed to be present.


  1. 1 TuxFeed » Getting the right image Trackback on 14 February 2008 at 9:08 pm
  2. 2 Sharing the love with BitTorrent « Xubuntu Blog Trackback on 24 April 2008 at 5:47 pm

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s




a

RSS More Xubuntu


Follow

Get every new post delivered to your Inbox.

Join 44 other followers

%d bloggers like this: