SHA256 Hash – How to Get Correct SHA256 Hash for Kubuntu 15.10 DVD

15.10burningdvdkubuntusha256

I have downloaded the .iso file for Kubuntu-15.10.iso from the official site. I successfully verified the correct sha256sum hash of

9e5eb424eabfd9b2d193d8c34eca7b48ad944b90c0de0bdcbb638563c14c4d2b

I am having trouble hashing the DVD though. When I used the burner xfburn I kept getting the hash

758061ca3be30128dca74e3f73b5dd6e76fb5047c0c4e0743f22786fb0a02dd0  /dev/cdrom

So I changed burners to K3B and it would give me the hash

d7559c90efece2b38021804cc34011eb2cb161fff2afe6894985083bd41232d5  /dev/cdrom

So I am unable to verify the correct DVD sha256sum hash. I have also used the burner that comes with my system which is Xubuntu 14.04. I also tried K3B burner which comes highly recommended online. I'm out of ideas.

Please help me get the correct hash…OR is the DVD's with the wrong hashes fine to burn? And its some bug in Xubuntu's DVD Rom system? Has anyone gottent the correct hashes for the DVD burned with this ISO?

Best Answer

Hashing /dev/cdrom has the effect of hashing also potential blank space at the end of the DVD, which changes the output hash: this is because ISOs are padded with zeros at the end until their overall size matches a multiple of 16 sectors, or 32768 B, before they are burnt.

If you want to hash the DVD, make sure that you're hashing the same number of bytes of the original image; in the commands below, make sure that $total is divisible by $bs ($bs is arbitrary, but I suggest using a number "bigger enough" than the default 512, as the default 512 usually slows down the reading; maybe this isn't relevant for DVD-ROM drives, but just to make sure):

total="$(du /path/to/image.iso | cut -d $'\t' -f 1)"
bs=8192 # make sure that $total is divisible by this number
dd if=/dev/cdrom iflag=fullblock bs=$bs count=$((total/bs)) | sha256sum -
Related Question