1

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.

4 Answers 4

0

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

2
  • Hello Mitch, thanks for the answer. But if the files are modified in that way that md5sum is the same.. I guess it will not work?
    – Barbara
    Sep 4, 2013 at 21:06
  • If the md5sum matches the files are exactly the same. Only permissions and times could be different. Okay, there is a theoretical chance to hit a hash-collision but I think you can ignore that.
    – Germar
    Sep 4, 2013 at 21:56
0

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.

1
  • Thank you for the answer, I guess that is the easy way to do it with the iso-files :)
    – Barbara
    Sep 4, 2013 at 21:26
0

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.

2
  • Command from point 4 will fail on filenames that contain spaces.
    – user280493
    Jun 15, 2014 at 12:34
  • 1
    @MikołajBartnicki This works fine, even for filenames containing spaces. For each found file, find's -exec action substitutes its path as a single word (i.e., without word splitting) in place of {}. Even if the name contains whitespace, it's passed to the command being executed (which in this case is md5sum) as a single argument. Here's what it looks like, in action, handling a directory with file foo bar without a hitch. Sep 7, 2014 at 20:44
0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .