How to validate a DVD against an ISO

18,878

Solution 1

The following command compares the contents of two binary files, and print the offset of the first differing byte. Replace /dev/dvd by the path to the DVD device (/dev/cdrom, /dev/scd0, /dev/hdc, …).

cmp /dev/dvd /path/to/foo.iso

I'm not sure if all DVDs contain an indication of where the data ends (I think some CDs don't); you can limit the comparison to the size of the image file.

ls -l /path/to/foo.iso  # copy the file size, e.g. 123456789 bytes
cmp -n 123456789 /dev/dvd /path/to/foo.iso

You can also compute a checksum for the image file, compute a checksum for the disk, and check that they match. This is slower for a single comparison, but faster if you need to compare many disks against one image, and allows the image and the disk to be on different computers. To detect accidental corruption, md5sum is perfectly suitable.

md5sum /path/to/foo.iso
md5sum /dev/dvd     # if the size can be determined; otherwise:
head -c 123456789 /dev/dvd | md5sum

Solution 2

Since the question is not OS-specific and Windows users may find their way here, I’ll suggest that a relatively easy way to accomplish this on Windows is to mount the ISO (OSFMount is particularly good), then compare (e.g., with WinMerge) the CD/DVD drive root with the mounted volume root:

winmerge d:\ e:\

Solution 3

Here are the correct steps to verify 256sum of the iso before and after burning.

determine iso sha256sum..

$ sha256sum ubuntu-5.10-dvd-i386.iso
e41c0631f6f2c138a417b59bcb880fce

then determine size of iso in bytes...

$ wc -c ubuntu-5.10-dvd-i386.iso  
3048179712

then dd your cd/dvd drive |then count the first bits of each file to sum |then read its sha256sum

$ dd if=/dev/sr0 | head -c 3048179712 | sha256sum  
e41c0631f6f2c138a417b59bcb880fce

Substitute /dev/sr0 with /dev/cdrom or other drive name depending on system.

For a better DD experience and to view dd's progress in real-time without having to write a script, use dcfldd the forensic dd (dcfldd can port to 2 different outputs as well.)

sudo apt-get install dcfldd

(shamelessly stolen from an article on unbutu.com)

Solution 4

I assume from your post that you are on Linux.

See this article : Verify a burned CD/DVD image on Linux.

The main idea is simple :

cat iso-file.iso | md5sum
dd if=/dev/hdc | md5sum

Solution 5

On Windows, install VCdControlTool.exe and WinMerge (remember to add it to system path, there's a specific checkbox in the installer).

Insert DVD, usually mounted on d:

Mount the .iso with VCdControlTool.exe, e.g. on z:

From cmd, run:

winmergeu.exe /r d:\ z:\

It might take a while.

Caveat: WinMerge runs out of memory with big files.

Share:
18,878

Related videos on Youtube

Svish
Author by

Svish

Software Developer, Geek, HSP, SDA, ..., open, honest, careful, perfectionist, ... Currently into indoor rowing and rock climbing, just to mention something non-computer-related... Not the best at bragging about myself... so... not sure what more to write... 🤔

Updated on September 17, 2022

Comments

  • Svish
    Svish over 1 year

    I have an ISO file and a DVD burned from that ISO file. Is there a way I can validate that the DVD contains the same as the ISO file and that nothing is wrong with the DVD?

    I have the tools available on the System Rescue CD.

    • Admin
      Admin over 13 years
      it suprises me that a rescue cd doesn't have an md5sum or shaXsum utility.
    • Admin
      Admin over 13 years
      @aking1012: It does! Several of them actually. I just don't know how to use them to compare an ISO with a DVD :p
    • Admin
      Admin over 13 years
      okay I just didn't see it on the included utilities list in the link, perhaps I overlooked it...in that case harrymc should get the check unless you specifically request a shasum
    • Admin
      Admin over 13 years
      What disc burning software do you use? Most of them have a 'verify burn' option that compares the ISO/Disc checksums.
    • Admin
      Admin over 13 years
      @wez, That I know. Thing is this is a DVD i burned a while ago and I think it might have gotten buggy or something. I was able to install my OS from it back then, but now it is giving me lots of trouble. Could be my hardware going bad too, but I'd just like to rule out a faulty install disk :)
    • Admin
      Admin almost 2 years
  • Gilles 'SO- stop being evil'
    Gilles 'SO- stop being evil' over 13 years
    Useless use of cat and useless use of dd. Simpler (and indistinguishable speedwise): <iso-file.iso md5sum, </dev/hdc md5sum. But suboptimal for a one-shot comparison.
  • bmaupin
    bmaupin over 11 years
    worked great for me, but I had to use cmp -n: cmp -n 123456789 /dev/dvd /path/to/foo.iso
  • Gilles 'SO- stop being evil'
    Gilles 'SO- stop being evil' over 11 years
    @bmaupin That was a typo, I've fixed it. Thanks for the notice.
  • Mario Vlad
    Mario Vlad about 11 years
    I just created this account to say thanks! I wanted to check if a written disk with windows xp was identical to the iso of it and this method worked great.
  • Jonathon
    Jonathon about 3 years
    Will this work for disc images what show up blank because they are not designed to be read by windows?
  • Synetech
    Synetech about 3 years
    @Jonathon, it should; OSFMount is pretty versatile and can handle various disc formats. That said, you need to be able to access the files on the disc and Windows doesn't natively support many file-systems like HPFS, ext4, etc. Ext2 Volume Manager can mount ext2 images to be read in Windows.