En:HOWTO: Checking the integrity of a LiveCD or LiveDVD

From Sabayon Wiki
Revision as of 22:55, 3 October 2012 by Palica (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
i18n: ca en es it tr

Many people 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:

# md5sum -c SabayonLinux-x86_64-3.4f.iso.md5
SabayonLinux-x86_64-3.4f.iso: OK

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

so the ISO I downloaded was good.

Remember - verify the MD5 sum for the version of Sabayon that you downloaded - they are all different. The MD5s can be found on the mirrors listed at: http://www.sabayonlinux.org/mirrors

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 for Linux no longer work, so jump to the end of this article for the latest method to use if you are not using Windows. If you are using Windows, see Method 3.


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:

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. Make sure you use the values returned when you run 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 as displayed by the second command above, so the burn was good. If it does not match the md5sum published on the mirrors then the LiveDVD/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 (three commands) in a Terminal window:

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. Make sure you use the values returned when you run 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:

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?title=Checking_the_integrity_of_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 Web page mentioned under Method 3, does not work for me. If I use the command 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 Wiki article.



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 Web page mentioned under Method 3, 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:

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.



Original article submitted by Fitzcarraldo on 24.10.07.