6

I imagine it is some kind of comparison between the original files and the files that have been burned on the disc, but does anybody know how it is really done at a low level?

I mean, does it create a hash of the source and destination content and then compares them? If it is so, does it store the hash of the burned content in RAM? Or does it save it in a temporary file on the hard drive? Is there a log file of what is going on?

Just curious to know exactly how this feature works :) And I am referring to Windows Image Burner.

2
  • 2
    those are implementational details (the specific hash algorithm, where the result is stored, etc), so unless you are talking about a specific application, its impossible to tell. Apr 16, 2014 at 16:14
  • It compares the file on the disk to the source file.
    – Ramhound
    Apr 16, 2014 at 16:20

2 Answers 2

12

Check out these MSDN pages on windows API for the IBurnVerification interface, and the IMAPI_BURN_VERIFICATION_LEVEL enum.

For data disks, it looks like in quick mode it doesn't checksum the entire disk, just a selection of sectors. It then makes sure that the API calls READ_DISC_INFO and READ_TRACK_INFO succeed against the new disk.

For full verification, it performs the above checks, and then does a full checksum on the last session on the new disk, against a checksum computed on the memory stream being burned. The checksums have to be stored in ram, but they are likely short lived values. Note that the comparison is against the disk image in RAM, not the source media itself, so if the source data did not read correctly, it will be written incorrectly. Verification will not detect this.

For music disks, it focuses on checking READ_TRACK_INFO and the disk Table of Contents, but does not perform a Checksum calculation. There is no full verification mode for music.

6

Frank nicely explained the Windows-specific verification. I’ll give a more general answer.

What does Verify disc after burning actually do to verify the data?

I mean, does it create a hash of the source and destination content and then compares them? If it is so, does it store the hash of the burned content in RAM? Or does it save it in a temporary file on the hard drive? Is there a log file of what is going on?

That is certainly one way that a comparison can be implemented: hash one file (hopefully with a sufficiently large—read low chance of collision algorithm), repeat for the other, and compare hashes. If that is how a verification is implemented, then you will be able to see the drive-LED flash for a while, then the CD/DVD-LED flash for a while.

Another way to implement the verification is to read a block of one file, then the same block from the other file, compare them, then repeat until the end of the file is reached. In this case, you will see the LEDs of the two drives alternating back and forth.

Of course, if the the hard-drive and optical drive don't have LEDs, then it won’t be as obvious, but you can still see it with something like ProcessMonitor because it will log a series of reads from one, then the other either in a single, big burst each or alternating, small bursts.

I imagine it is some kind of comparison between the original files and the files that have been burned on the disc, but does anybody know how it is really done at a low level?

Actually, all it really does is to flush the drive cache so that the comparison function is reading the data from the actual disc instead of from the memory cache. Obviously this is a critical step because if the verification is done from cache, then it does not represent what is actually on the disc, so corruption can easily slip through.

You can see whether a comparison is done from the drive or from the cache in RAM by how fast it occurs. If you manually do a simple comparison (e.g., with WinDiff or WinMerge or by hashing them with a hashing tool), you will notice that the comparison happens much faster than expected because it is reading the files from memory cache. You must flush the cache to force it to read from the actual disc. For optical drives (and other removable media like flash-drives and memory-cards, simply ejecting the drive is enough to flush the cache, but for hard-drives, it is not nearly as simple (though usually that doesn’t matter because the new copy is the one you want to test).

4
  • Also, it can help to verify the contents of newly burned media by reading it from a different drive than the one that burned it. Just in case it caches, or in case it has no problem reading data that is just a little skewed (as it is only skewed because it wrote it that way).
    – Shadow Man
    Apr 17, 2014 at 1:55
  • One thing I noted about the windows approach, is that all the source CRC/checksum calculations are performed on the memory stream of the image being written, not the source disk. I guess they assume GIGO, and that if the file can't be read right in the first place, it can't be written right. Oddly enough though, in past I've used Nero to copy a disk that windows won't read correctly, to a new CD, which worked! I guess nero does it differently than windows. I imagine the MS approach does allow them to use the same process for verifying iso's and other disk images. Apr 17, 2014 at 2:05
  • @ShadowCreeper, ejecting the drive takes care of the cache, but I see what you mean about the drive-bias. Worse, if that were the case, then it would apply to everything you burn with it, so if it were a mis-aligned drive, then one could burn many discs before discovering the error. :-(
    – Synetech
    Apr 17, 2014 at 21:22
  • @FrankThomas, I suspect that with Windows, the priority is performance, so they just make an effort to be quick as opposed to careful. I, for one, prefer ImgBurn.
    – Synetech
    Apr 17, 2014 at 21:24

You must log in to answer this question.

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