Ubuntu: Comparing two DVDs


How to compare two DVDs? I mean really a binary comparison?

The problem: I have two DVDs containing a program, which should be the same. But I suspect one DVD to be modified. The sizes of the files and folders are the same, which does not mean that the content should be the same.


Try VBinDiff (Visual Binary Diff)

VBinDiff (Visual Binary Diff) displays files in hexadecimal and ASCII (or EBCDIC). It can also display two files at once, and highlight the differences between them. Unlike diff, it works well with large files (up to 4 GB).

The single-file mode was inspired by the LIST utility of 4DOS and friends. While less provides a good line-oriented display, it has no equivalent to LIST’s hex display. (True, you can pipe the file through hexdump, but that’s incredibly inefficient on multi-gigabyte files.)VBindiff

To download and more info visit VBindiff, and Github


You could use regular cmp.

If the DVD is meant to be a perfect 1:1 copy (absolutely identical), you could compare the ISOs.

cmp dvd1.iso dvd2.iso  

Otherwise on a file by file basis

cd /mnt/cdrom1  find -type f -exec cmp {} /mnt/cdrom2/{} \;  

Both commands will only print something (filename and byte offset) if there are any differences. It's a byte-by-byte comparison, no checksums involved. Note that the method with find here doesn't detect surplus files on cdrom2, I assume you have already ruled that out.


Try this:

  1. Insert and mount the first DVD
  2. Open a Terminal
  3. Type cd ${PATH_OF_YOUR_DVD_MOUNT_POINT} (replacing ${PATH_OF_YOUR_DVD_MOUNT_POINT} with the path of the DVD mount point)
  4. Type find . -type f -exec md5sum \{\} \; >/tmp/md5sums.txt and wait until it finishes (may take a while)
  5. Type cd to return to the home directory
  6. Unmount and eject your DVD
  7. Insert and mount the second DVD
  8. Again type cd ${PATH_OF_YOUR_DVD_MOUNT_POINT} (replacing the mount point of the second DVD this time)
  9. Type md5sum --check --quiet /tmp/md5sums.txt and observe the output

You will get a list of files which were NOT binarily equivalent.

NOTE: Added correction from user Germar which for some reason was no accept in peer review.


Insert DVD into drive and wait until Ubuntu auto-mounts it then go into directory where DVD is mounted:

$ cd /media/barbara/mydvd  

Create a checksum file that contains checksums of all files on DVD:

$ find . -type f -print0 | xargs -0 sha1sum > /tmp/mydvd.sha1  

Note, that above command properly handle filenames with spaces. Next, replace the DVD with the second one, and check against just created checksums:

$ sha1sum -c /tmp/myiso.sha1  

If there is difference, sha1sum will print an error message about it.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »