Checking the integrity of a LiveDVD/CD

Installer Issues via Installer -- Not for global upgrades or upgrading individual packages -- ONLY ISSUES WITH INSTALLATION OF THE OS -- Can't get Sabayon installed, than post here, otherwise use correct forums

Moderator: Moderators

Checking the integrity of a LiveDVD/CD

Postby Fitzcarraldo » Sun Oct 21, 2007 1:21

Many people in the SL forum know they can check if a downloaded ISO file is OK by comparing the md5sum of the ISO file against the md5sum posted on the SL mirrors. For example:

Code: Select all
localhost fitzcarraldo # md5sum SabayonLinux-x86_64-3.4f.iso
645600788920443b372baae3544acffa  SabayonLinux-x86_64-3.4f.iso
localhost fitzcarraldo #

cf. the contents of ftp://bo.mirror.garr.it/mirrors/sabayon ... 4f.iso.md5 which are:
645600788920443b372baae3544acffa SabayonLinux-x86_64-3.4f.iso

(so the ISO I downloaded was good.)

But a different method is needed to verify the integrity of the LiveDVD/CD itself. You should select the verify written data checkbox in K3b before burning the DVD/CD, but if you forgot or still have doubts then the following methods can be used to check the integrity of the burnt LiveDVD/CD:

EDIT (May 24 2012): Method 1 and Method 2 below no longer work in SL, so jump to the end of this post for the latest method to use. See Method 3 if you are using Windows.

Method 1

If you know the md5sum from the mirrors, you can find the md5sum of the LiveDVD/CD you burnt and compare the two.

a) Boot up SL as usual from the HDD, then put the LiveDVD/CD in the optical drive.
b) Do the following (two commands) in a Terminal window:

Code: Select all
localhost fitzcarraldo # isoinfo -d -i /dev/cdrom
CD-ROM is in ISO 9660 format
System id: LINUX
Volume id: Sabayon Linux - x86-64
Volume set id:
Publisher id:
Data preparer id:
Application id: MKISOFS ISO 9660/HFS FILESYSTEM BUILDER & CDRECORD CD-R/DVD CREATOR (C) 1993 E.YOUNGDALE (C) 1997 J.PEARSON/J.SCHILLING
Copyright File id:
Abstract File id:
Bibliographic File id:
Volume set size is: 1
Volume set sequence number is: 1
Logical block size is: 2048
Volume size is: 2282392
El Torito VD version 1 found, boot catalog is in sector 751
Joliet with UCS level 3 found
Rock Ridge signatures version 1 found
Eltorito validation header:
    Hid 1
    Arch 0 (x86)
    ID ''
    Key 55 AA
    Eltorito defaultboot header:
        Bootid 88 (bootable)
        Boot media 0 (No Emulation Boot)
        Load segment 0
        Sys type 0
        Nsect 4
        Bootoff 2F0 752
localhost fitzcarraldo # dd if=/dev/cdrom bs=2048 count=2282392 conv=notrunc,noerror | md5sum
2282392+0 records in
2282392+0 records out
645600788920443b372baae3544acffa  -
4674338816 bytes (4.7 GB) copied, 594.962 s, 7.9 MB/s
localhost fitzcarraldo #


Notice that the value I have used for bs= in the second command is the "Logical block size" displayed from the first command, and the value I have used for count= in the second command is the "Volume size" displayed from the first command.

The long alphanumeric string displayed should equal the m5dsum published on the SL mirrors provided that you recorded the LiveDVD/CD using 'session at once' mode (single session, disk-at-once), not 'track at once' mode (multi-session, track-at-once).

In this example (SL x86-64 3.4f), the md5sum published on the mirrors for the ISO file is:
645600788920443b372baae3544acffa SabayonLinux-x86_64-3.4f.iso
Notice that this matches the md5sum of /dev/cdrom, so the burn was good. If it does not match the md5sum published on the mirrors then the DVD/CD is useless and you need to burn another one.


Method 2

If you know the ISO you downloaded from the mirrors is good (because you checked the md5sum), you can create an ISO from the LiveDVD/CD and compare it with the good ISO.

(In the example below I assume the original ISO you downloaded is on your desktop, so alter the path accordingly if it is somewhere else on your PC.)

a) Boot up SL as usual from the HDD, then put the LiveDVD/CD in the optical drive.
b) Do the following (two commands) in a Terminal window:

Code: Select all
localhost fitzcarraldo # isoinfo -d -i /dev/cdrom
CD-ROM is in ISO 9660 format
System id: LINUX
Volume id: Sabayon Linux - x86-64
Volume set id:
Publisher id:
Data preparer id:
Application id: MKISOFS ISO 9660/HFS FILESYSTEM BUILDER & CDRECORD CD-R/DVD CREATOR (C) 1993 E.YOUNGDALE (C) 1997 J.PEARSON/J.SCHILLING
Copyright File id:
Abstract File id:
Bibliographic File id:
Volume set size is: 1
Volume set sequence number is: 1
Logical block size is: 2048
Volume size is: 2282392
El Torito VD version 1 found, boot catalog is in sector 751
Joliet with UCS level 3 found
Rock Ridge signatures version 1 found
Eltorito validation header:
    Hid 1
    Arch 0 (x86)
    ID ''
    Key 55 AA
    Eltorito defaultboot header:
        Bootid 88 (bootable)
        Boot media 0 (No Emulation Boot)
        Load segment 0
        Sys type 0
        Nsect 4
        Bootoff 2F0 752
localhost fitzcarraldo # cd /
localhost / # dd if=/dev/cdrom bs=2048 count=2282392 conv=notrunc,noerror > SabayonLinux-x86_64-3.4f.iso
2282392+0 records in
2282392+0 records out
4674338816 bytes (4.7 GB) copied, 612.163 s, 7.6 MB/s
localhost / # diff SabayonLinux-x86_64-3.4f.iso /home/fitzcarraldo/Desktop/SabayonLinux-x86_64-3.4f.iso
localhost / #


Notice that the value I have used for bs= in the third command is the "Logical block size" displayed from the first command, and the value I have used for count= in the third command is the "Volume size" displayed from the first command.

If the result of the diff (compare file) command is just the usual prompt then the files are identical and the burn was good. In the example above it was. But if the result is:

Code: Select all
Files SabayonLinux-x86_64-3.4f.iso and /home/fitzcarraldo/Desktop/SabayonLinux-x86_64-3.4f.iso differ


then the LiveDVD/CD is useless and you must burn another.


Method 3

If you only have Windows installed on your HDD, apparently you can use a Windows shareware application to perform something similar to the above method -- see the following Web page for details:
http://www.mepis.org/docs/en/index.php? ... _a_Live_CD


TWO WARNINGS:

1. I have not checked if the method for Windows on the above-mentioned Web page actually works, so use it at your own risk.
2. The method for checking the integrity of a LiveCD under Linux, given on the above-mentioned Web page, does not work for me. If I use md5sum /dev/cdrom it does not return the same md5sum as published on the mirrors even though the LiveCD is good. So do not use that method under Linux, use either Method 1 or Method 2 given in this post.

EDIT (Dec 13 2010): Updated link to Mepis Wiki, as it has changed since I posted this HowTo.

EDIT (May 24 2012): Method 1 and Method 2 no longer work, and the method for checking the integrity of a LiveCD under Linux, given on the above-mentioned Web page, does now work. This is how to do it:

Insert the LiveDVD into the optical drive, let the disc spin up and then enter the following three commands:

Code: Select all
md5sum /dev/cdrom | awk '{print $1}' > md5a.txt
md5sum ~/Sabayon_Linux_8_amd64_K.iso | awk '{print $1}' > md5b.txt
diff -qs md5a.txt md5b.txt

(Obviously change the path and/or the ISO file name to match your circumstances.)

If you get an error message while the md5sum is reading the disc, there must be something wrong either with the burn or with the optical drive itself.

If you get the message "Files md5a.txt and md5b.txt differ" then the burn was bad.

If you get the message "Files md5a.txt and md5b.txt are identical" then the burn was good.
Last edited by Fitzcarraldo on Mon Oct 22, 2007 16:53, edited 3 times in total.
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 8028
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: Checking the integrity of a LiveDVD/CD

Postby wolfden » Sun Oct 21, 2007 1:35

moved and stickied

Great Stuff!
wolfden
Sharecropper
 
Posts: 9051
Joined: Sat Jan 14, 2006 0:55
Location: Midwest USA

Re: Checking the integrity of a LiveDVD/CD

Postby sb_user » Sun Mar 29, 2009 22:24

Good one. But you don't thinks about do it more easy in next time releases? Like that:
http://images.howtoforge.com/images/dual_boot_windows_xp_ubuntu_feisty/bootsn5.jpg
Trouble what people have only one PC (most of them) and can't read this forum with "magic commands" when installing Sabayon Linux.
Also many developers prefer not check isoinfo -d -i /dev/cdrom, but include md5 hash list to the live cd and check squashfs image and other files this scripts by user request.

I think trouble not in writing iso.. trouble what sometime one DVD-drive can't read what writed(and can be readed) at another DVD-drive.. maybe is about DVD-disk quality. Anyway i recommend Verbatim disks http://www.verbatim.com/ for writing linux distro.
sb_user
Baby Hen
 
Posts: 5
Joined: Sun Mar 29, 2009 21:21

Re: Checking the integrity of a LiveDVD/CD

Postby Fitzcarraldo » Mon Mar 30, 2009 14:30

sb_user wrote:Good one. But you don't thinks about do it more easy in next time releases? Like that:
http://images.howtoforge.com/images/dual_boot_windows_xp_ubuntu_feisty/bootsn5.jpg

That link gives a white screen with "403 - Forbidden" on my PC.

sb_user wrote:Trouble what people have only one PC (most of them) and can't read this forum with "magic commands" when installing Sabayon Linux.

Not sure what you mean. As stated in the first post, Method 1 assumes that you have a Linux distro (not necessarily SL) already installed on your HDD. Method 2 also assumes that you already have a Linux distro (not necessarily SL) already installed on your HDD. Method 3 is for Windows users -- see the section titled "On Windows" on the page linked to in the first post, which gives Methods 1 and 2 for Windows users.

sb_user wrote:I think trouble not in writing iso.. trouble what sometime one DVD-drive can't read what writed(and can be readed) at another DVD-drive.. maybe is about DVD-disk quality. Anyway i recommend Verbatim disks http://www.verbatim.com/ for writing linux distro.

In some cases that is the problem ("one DVD-drive can't read what writed(and can be readed) at another DVD-drive"), but in other cases it isn't. For example, I have had the problem on the same PC (i.e. burn LiveDVD and then try to use it in the same DVD drive) when using good quality blank DVD-R or DVD+R discs (including Verbatim) and burning at slowest speed. The problem seems to be even worse with laptop DVD reader/writer drives, as they are flimsier. The current optical media are actually a relatively unreliable method for storing data, and I'm looking forward to them becoming obsolete and being replaced by a more reliable and as-cheap method of storing data that will last longer.
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 8028
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: Checking the integrity of a LiveDVD/CD

Postby second_exodous » Thu Oct 15, 2009 6:47

Isn't it possible to have the live DVD check on the boot options screen? I remember that Gentoo did this and I'm pretty sure Ubuntu does also. It shouldn't be that hard of a script to put in the liveDVD, other distros do it. I always thought only paranoid people checked but I've had an oredeal that taught me otherwise.
second_exodous
Baby Hen
 
Posts: 17
Joined: Fri Jul 17, 2009 4:17

Re: Checking the integrity of a LiveDVD/CD

Postby wolfden » Thu Oct 15, 2009 7:41

no, not only paranoid people, it's the first and easiest thing to check to make sure your file is good to save you and others headaches. It's the first thing you are gonna be asked with issues.
wolfden
Sharecropper
 
Posts: 9051
Joined: Sat Jan 14, 2006 0:55
Location: Midwest USA

Re: Checking the integrity of a LiveDVD/CD

Postby second_exodous » Thu Oct 15, 2009 9:38

I had never been asked to do this before when a distro didn't install, but from now on i'll check the media I burn.
second_exodous
Baby Hen
 
Posts: 17
Joined: Fri Jul 17, 2009 4:17

Re: Checking the integrity of a LiveDVD/CD

Postby Marius » Mon Nov 23, 2009 7:58

Fitzcarraldo wrote:
Method 3

If you only have Windows installed on your HDD, apparently you can use a Windows shareware application to perform something similar to the above method -- see the following Web page for details:
http://www.mepis.org/docs/en/index.php/ ... _a_Live_CD

TWO WARNINGS:

1. I have not checked if the method for Windows on the above-mentioned Web page actually works, so use it at your own risk.
2. The method for checking the integrity of a LiveCD under Linux, given on the above-mentioned Web page, does not work for me. If I use md5sum /dev/cdrom it does not return the same md5sum as published on the mirrors even though the LiveCD is good. So do not use that method under Linux, use either Method 1 or Method 2 given in this post.


That's strange. I performed md5sum, sha1sum, sha256sum, etc, on the device corresponding to the CD/DVD many times under Linux and it always worked. Are you sure /dev/cdrom was the right device, and the right CD was in the CD/DVD drive? On my Dell Optiplex under CentOS it is /dev/hdc, not /dev/cdrom. After burning an ISO image I always eject and reinsert the CD in order to make its contents available to the operating system.

The following information is for a general, not particularly experienced, user: you can find which device corresponds to your CD/DVD drive by checking the output of `ps -ef' while an ISO image is being burned by whatever application your window manager uses. Try for example this:

ps -ef|grep -i .iso

This instruction applies only to Linux, of course.
Marius
Simple Hen
 
Posts: 82
Joined: Thu Nov 01, 2007 5:48
Location: Berkeley, California

Re: Checking the integrity of a LiveDVD/CD

Postby Marius » Mon Nov 23, 2009 8:07

wolfden wrote:no, not only paranoid people, it's the first and easiest thing to check to make sure your file is good to save you and others headaches. It's the first thing you are gonna be asked with issues.


That's right. That's a very sound advice. I always do that myself. At least once I observed how a faulty burn produced a Live CD that had been hanging during the boot up, while the contents of the CD could be viewed in a window manager and superficially seemed perfectly good.
Marius
Simple Hen
 
Posts: 82
Joined: Thu Nov 01, 2007 5:48
Location: Berkeley, California

Re: Checking the integrity of a LiveDVD/CD

Postby Fitzcarraldo » Mon Nov 23, 2009 16:44

Marius wrote:Are you sure /dev/cdrom was the right device, and the right CD was in the CD/DVD drive?

Yes, I am sure.

Marius wrote:After burning an ISO image I always eject and reinsert the CD in order to make its contents available to the operating system.

So do I.
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 8028
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Next

Return to Installer Issues - Calamares **Not for Package Manager Stuff**

Who is online

Users browsing this forum: No registered users and 1 guest