PDA

View Full Version : sha1sum of iso image on cd or dvd


Joe48
2007-08-21, 01:21 AM CDT
Is there a way to check a iso image file already burned onto a cd or dvd with sha1sum ?
Thank you Joe48

Jman
2007-08-21, 08:54 PM CDT
Yes. sha1sum /dev/cdrom or whatever your device is.

Note that Fedora install media have a media check boot option built in.

stoat
2007-08-24, 05:20 PM CDT
Is there a way to check a iso image file already burned onto a cd or dvd with sha1sum ?
sha1sum /dev/cdromor whatever your device is.Hello Jman,

When I first saw that, I thought it was interesting but not something I would ever need to do. I just filed it away somewhere in my mind. Today, I needed to try it and remembered this thread.

sha1sum does work from that command format, but I can't get it to produce the checksum string found in the SHA1SUM file on the download server. When used on the actual F7 installation DVD, sha1sum produces a different checksum string which has nothing for comparison.
The checksum string for the F7 DVD ISO file in SHA1SUM on the Fedora server:
96b13dbbc9f3bc569ddad9745f64b9cdb43ea9ae F-7-i386-DVD.iso

Test 1: The checksum string by sha1sum on a known good F7 installation DVD in the DVD drive:
[root@localhost ~]# sha1sum /dev/hdc
d29bf54c674d2206b477410f2752897df0450759 /dev/hdc

Test 2: The checksum string by sha1sum on a known good F7 DVD ISO file in the DVD drive:
[root@localhost ~]# sha1sum /media/F7_DVD_ISO/F-7-i386-DVD.iso
96b13dbbc9f3bc569ddad9745f64b9cdb43ea9ae /media/F7_DVD_ISO/F-7-i386-DVD.isoSo, either I misunderstood you, or you misunderstood Joe48, or I misunderstood both of you, or it doesn't work on a working F7 installation DVD.

buddha
2007-08-24, 06:45 PM CDT
Many times discrepancies arise because of padding of the ISO images by the burning software when written to CD or DVD. For an explanation, read here:

http://www.troubleshooters.com/linux/coasterless.htm#_Accurately_Reading_a_CD

See the rawread script on the above page.

stoat
2007-08-24, 07:11 PM CDT
Many times discrepancies arise because of padding of the ISO images by the burning software when written to CD or DVD. For an explanation, read here:

http://www.troubleshooters.com/linux/coasterless.htm#_Accurately_Reading_a_CD

See the rawread script on the above page.I hereby nominate buddha for "Most Highly Exhalted Possessor of Obscure Knowledge". buddha single-handedly salvaged this thread from the junkpile and placed it in the Bin of Useful Trivialities. I thought that thing I tried couldn't possibly work or be right. I was willing to risk public humiliation to post my test of it. I am glad now that I did.

I copied the rawread script from the site in buddha's link to a text file, set permissions to allow execution, followed the simple directions, and BOOM: it generated a sha1sum checksum string from the actual working F7 installation DVD that perfectly matched the ISO checksum string on the download server...[root@localhost ~]# /home/rawread /dev/hdc | sha1sum
dd if=/dev/hdc bs=2048 count=1416310 conv=notrunc,noerror
1416310+0 records in
1416310+0 records out
2900602880 bytes (2.9 GB) copied, 210.728 seconds, 13.8 MB/s
96b13dbbc9f3bc569ddad9745f64b9cdb43ea9ae -

P.S.: That little rawread script can also be used to create an ISO image file of from a DVD. I tried that on the Fedora installation DVD, too. The sha1sum checksum string for the ISO file created from the DVD by the rawread script also verified perfectly.[user@localhost ~]$ /home/user/rawread /dev/scd0 > f7.iso
dd if=/dev/scd0 bs=2048 count=1416310 conv=notrunc,noerror
1416310+0 records in
1416310+0 records out
2900602880 bytes (2.9 GB) copied, 218.894 s, 13.3 MB/s
[user@localhost ~]$ ls
Desktop documents f7.iso files images rawread rpms scripts temp
[user@localhost ~]$ sha1sum f7.iso
96b13dbbc9f3bc569ddad9745f64b9cdb43ea9ae f7.iso

P.P.S.: To determine what the device name of your DVD drive is for use with the rawread script, insert a DVD and run the command df. Example from Fedora 7...[user@localhost ~]$ df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sdb10 8924628 3757428 4706540 45% /
/dev/sdb9 101086 17360 78507 19% /boot
tmpfs 516584 0 516584 0% /dev/shm
/dev/sdb11 4458380 1021912 3206340 25% /home
/dev/sda1 10008460 4318936 5689524 44% /mnt/winxp1
/dev/sda2 10000460 3809180 6191280 39% /mnt/winxp2
/dev/sdb1 4883728 1669860 3213868 35% /mnt/files1
/dev/sdb2 5116700 2061432 3055268 41% /mnt/files2
/dev/sdb3 40937696 5060832 35876864 13% /mnt/fat32
/dev/sdb7 4466124 939860 3295736 23% /mnt/fc6_home
/dev/sdc1 78148160 54487248 23660912 70% /mnt/video1
/dev/scd0 2832620 2832620 0 100% /media/Fedora 7 i386 DVD

robatino
2007-08-31, 12:26 AM CDT
The rawread method is nice in that it doesn't require rebooting, and also gives an independent check in case you obtain the disc from an untrusted source. If you're not worried about that, but don't want to reboot, you can get the equivalent of the media check by installing the anaconda-runtime package ("yum install anaconda-runtime"), and then running the /usr/lib/anaconda-runtime/checkisomd5 command as in

/usr/lib/anaconda-runtime/checkisomd5 --verbose /dev/dvd

Nezmin2
2007-09-02, 04:31 PM CDT
Ok, I have downloaded the dvd iso twice and ran sha1sum (matched correctly), ran rawread (matched correctly), ran anaconda-runtime app (matched correctly). However, after telling the installer to run from the cdrom I get "please install cd". It will not recognize the cd. I have even tried to trick the system by hitting ok after it kicks out the cd. Doesn't work.

Could someone please tell me how to get the installer to run from the dvd iso (cdrom)? :mad:

P.S. I downloaded the file from ftp://download.fedora.redhat.com/pub/fedora/linux/releases/7/Fedora/i386/iso/

stoat
2007-09-02, 04:36 PM CDT
Hello Nezmin2,

It's not uncommon. In fact, I just pasted this from a new thread just like this. You can read at least my explanation of this DVD issue with Fedora 7 in another thread here (http://www.fedoraforum.org/forum/showthread.php?t=163417). It also has my idea of a possible workaround. If you think it applies to your situation, you should try it.

Nezmin2
2007-09-07, 04:56 PM CDT
Is there anyone that can tell me why my brand new dvd writer is not being recognized even though I was able to burn the f7 dvd iso? :confused:

StopThatItSilly
2007-09-26, 03:01 AM CDT
su
/threadhijack/postthread/

Has anyone had any problems downloading an F7.iso and not had the correct checksum?

I have downloaded it a half dozen times and now from a different location, (a datacenter actually) and I always get the checksum:
355BDB01B0268A4BB7C757F2737DCF7C *F-7-i386-DVD.iso
instead of the one listed on the download server(s) of:
96b13dbbc9f3bc569ddad9745f64b9cdb43ea9ae F-7-i386-DVD.iso

I ended up burning a DVD anyway and was able to run a successful scan and install. How can this be?

robatino
2007-09-26, 03:50 AM CDT
That is the correct md5sum for the ISO. You should have checked the sha1sum, instead of the md5sum. You can tell which is which from the length (MD5 is 128 bits = 32 hexadecimal digits, SHA1 is 160 bits = 40 hexadecimal digits).

StopThatItSilly
2007-09-26, 11:09 AM CDT
ahhh

Thank you robatino, I did not realize that there was a difference between the two. Coming from the Windows world, this is not something that I've had to previously deal with.

Thanks again! =)

robatino
2007-09-26, 05:15 PM CDT
The type of hash was changed a little while back since the security of MD5 against deliberate falsification was starting to wear thin. The same thing is starting to happen to SHA1 now so it's possible that the hash type will change again. Of course, for just checking against natural errors either type is adequate. There are several SHA variants installed in F7, I don't know if one of them might be the next:

-rwxr-xr-x 1 root root 33556 2007-06-13 10:06 /usr/bin/sha1sum
-rwxr-xr-x 1 root root 42292 2007-06-13 10:06 /usr/bin/sha224sum
-rwxr-xr-x 1 root root 42356 2007-06-13 10:06 /usr/bin/sha256sum
-rwxr-xr-x 1 root root 77308 2007-06-13 10:06 /usr/bin/sha384sum
-rwxr-xr-x 1 root root 77308 2007-06-13 10:06 /usr/bin/sha512sum