Announcement

Collapse
No announcement yet.

How to md5sum check the burned ISO CD

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to md5sum check the burned ISO CD

    Many new users of Kubuntu have problems with their installation. These problems are most often narrowed down to a bad download or a bad burn of the ISO. Checking the md5sum of a download has been addressed in the following post:
    http://kubuntuforums.net/forums/inde...opic=3104464.0

    This tip deals with checking the md5sum of the CD after the burn.

    So, you burn the ISO onto a CD at 4X, or as low as your burner will go (mine is 10X), and now the burn is done. The burn is usually more successful if you use the TAO (Track At Once) or the DAO (Disk At Once) option, depending on your hardware, instead of "Auto".

    The CD has been ejected by your burner, or you ejected it.

    Question: How do you verify the md5sum of the burned CD?

    Here is how you test the burned CD:

    Close the CD tray. Open a Konsole and issue the following command:

    dd if=/dev/cdrom bs=2048 | head -c 693188608 | md5sum (See end of msg)
    e5e5a9ae40eea8a6ca01423d24e24ecd -
    338471+0 records in
    338471+0 records out
    693188608 bytes (693 MB) copied, 257.534 s, 2.7 MB/s
    The md5sum that was returned, in 257 seconds, is correct, so my burn was good.

    I know, you're asking how I got that size, 693188608? Using Dolphin I right moused on the iso file in the download directory and clicked on the "Properties" option. In that dialog the exact byte size is displayed. For your ISO use that value instead of the number I used above.

    IF the md5sum of the CD (now a LiveCD) had not been good then you can immediately burn a NEW CD of the ISO and then test the CD again. This way you don't have to boot the LiveCD and use the test option on its menu, only to reboot your computer again if the LiveCD CD test option reveals a bad LiveCD. If this md5sum check of the CD works then you can boot the LiveCD immediately and know that it is good.

    It's NOT ENOUGH to merely check the md5sum of the downloaded ISO file. You must also check the md5sum of the burned CD.

    Now you know how to do it.

    You also now know that if you have any problems during or after the install it lies in the options you chose while installing Kubuntu, something you did after the install, or a bug in an application.

    EDIT - 10/15/09
    BlindSide (whom I now call "BashMaster" 8) ) has added a modification to the command I posted above. It is a decided improvement over my method in that it does NOT require one to use Dolphin to find out the exact byte size of the iso file. For that reason I recommend that you scroll down to BashMaster's post and use his method.

    The only thing left to do now is to create a script, say, "chkcdrom", which can be called like so;

    chkcdrom somefile.iso

    and have it print the md5sum of the CD in the cdrom to the standard output.

    "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
    – John F. Kennedy, February 26, 1962.

    #2
    Re: How to md5sum check the burned ISO CD

    A couple of additional comments:
    (1) This is VERY, VERY IMPORTANT. Many people have had problems installing from homemade CDRs. It is NOT enough to verify the download, one bad byte in a music CD is totally unnoticeable, but one bad byte, in the wrong place, can ruin an installation CD. Please, read the material on this subject at The Ubuntu Community Wiki. Notice that you can check the CDR from windoze, before you even install (*)buntu!

    (2) There are actually two steps to verify your newly burnt CD. The first step is to find the MD5SUM that you want to verify. It is listed here. The second step is to follow the instructions above.

    Comment


      #3
      Re: How to md5sum check the burned ISO CD

      This is very helpful, nice work GreyGeek

      I understand it is more convenient for you to do it this way, but those new to Kubuntu may be more comfortable using the CD's built in integrity checker. Either way it does the same job, and users are free to choose whatever method they like best. (I love freedom!)

      By the way, I did link to this thread from my own HOWTO verify the Kubuntu ISO. People should do both before they install Kubuntu to completely eliminate the two biggest causes of bad installations: corrupted downloads, and bad burns.
      Welcome newbies!
      Verify the ISO
      Kubuntu's documentation

      Comment


        #4
        Re: How to md5sum check the burned ISO CD

        dd if=/dev/cdrom bs=2048 | head -c 693188608 | md5sum
        e5e5a9ae40eea8a6ca01423d24e24ecd -
        338471+0 records in
        338471+0 records out
        693188608 bytes (693 MB) copied, 257.534 s, 2.7 MB/s
        At the risk of overstepping the mark as a new member on the forum...

        This method works very well but adds an extra pipe for the 'head' command. It may also struggle more if you use DVDs to burn CD ISOs - I know, I know but I do sometimes do this myself (albeit using DVD-RWs) - since the full size of the medium exceeds the size of the ISO to such a large degree.

        Anyway, since you should still have the original .iso and it should be divisible by 2048 bytes you can use the following bash command line :

        dd if=/dev/cdrom bs=2048 count=$(( $(stat -c %s karmic-desktop-i386.iso) / 2048)) | md5sum
        # $() : applies command substitution ie runs the enclosed command and uses the result in its place
        # stat -c %s "filename" : grabs the filesize of "filename" (in this case, the karmic iso image)
        # $(( )) : applies arithmetic substitution ie evaluates the enclosed expression and uses the result in its place
        # Net upshot - the filesize is grabbed, divided by 2048 and plugged in as the 'count'
        *** Corrected and expanded explanation! ***
        You must, of course, change the .iso filename to match your one and either path it fully or ensure that you are in the same directory. It would also be trivial to alter this to make a script that checks one or more .iso images named as parameters.

        Hoping that this is of use to someone and not ripped to shreds by anyone!

        Comment


          #5
          Re: How to md5sum check the burned ISO CD

          Very NICE enhancement! Thank you! Your method eliminates the necessity of having to look up the EXACT byte count and then transfer it by Cut&Paste or by memory.

          At the risk of overstepping the mark as a new member on the forum...
          You haven't overstepped at all!

          Kubuntu, Linux and its community is a meritocracy. Skill trumps tenure, gender, race or religion. You've definitely proved your skill, and by sharing your knowledge ALL who visit this forum and read your post have benefited.

          "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
          – John F. Kennedy, February 26, 1962.

          Comment


            #6
            Re: How to md5sum check the burned ISO CD

            Originally posted by GreyGeek
            Very NICE enhancement! Thank you! Your method eliminates the necessity of having to look up the EXACT byte count and then transfer it by Cut&Paste or by memory.
            (*shrugs*) I'm just a scripting/coding kind of guy and feel that if you can *sensibly* automate a process then it is a good thing to do. One of the biggest steps for newcomers to Linux to learn is that scripting, while awkward to follow at times, can make your life much easier. Ooops! Sounding pompous... ;-)

            Originally posted by GreyGeek
            You haven't overstepped at all!

            Kubuntu, Linux and its community is a meritocracy. Skill trumps tenure, gender, race or religion. You've definitely proved your skill, and by sharing your knowledge ALL who visit this forum and read your post have benefited.
            Thankfully the Linux/Open Source world tends to be much more generous in spirit than certain other technical communities. Long may that remain true!

            Comment


              #7
              Re: How to md5sum check the burned ISO CD

              Actually you don't need to know the size of the iso file. dd will stop with an error when it reaches the end of the finalized data on the cd. So all you really need to do is to direct the stderror to /dev/null.
              Here is the output when I run this on my latest TinyCore cd.
              $ dd if=/dev/sr0 bs=2048 2>/dev/null|md5sum
              b410a5a20a7adee41e5e4d39111a0541 -
              Compare that to the iso:
              $ md5sum Downloads/isofiles/TinyCore-4.2.iso
              b410a5a20a7adee41e5e4d39111a0541 Downloads/isofiles/TinyCore-4.2.iso

              The only disadvantage is that you will get a md5sum even if you check an empty drive . Of course if you write a script you can add error checking.

              So the advantage is that you can check a cd even if you already deleted the iso file. Another use would be to catalog all your picture cd's along with a md5sum of the cd. And you have an easy way to check if your cd's are starting to go bad.

              Comment


                #8
                Re: How to md5sum check the burned ISO CD

                Nice modification! BlindSide's improvement eliminated the necessity of having to know the size of the iso, and requires only the name of the iso. Your command eliminates the need to know anything about the iso at all. All one needs to do is be sure that the CD in the burner is of the iso they are checking.
                (I isolated and enlarged the command to make it easier to see and read).
                "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                – John F. Kennedy, February 26, 1962.

                Comment

                Working...
                X