How to flush cdrom cache after changing disks

T

Tuco

I am looking for a way to force Windows to flush or invalidate a disk cache
after a CD/DVD has been swapped. (I'm assuming, by the results discussed
below, that Windows uses such a cache.

Background info: I often need to make multiple copies of a CD that our to be
sent out. As part of a verification process, I have begun to include a MD5
checksum file for the files on the CD. (This is a result from others having
problems with some of the copies). Suppose I have more than one copy of a CD.
I have noticed thatverifying the first copy of a CD (using the MD5 sums)
takes X amount of time. Then, when verifying the remaining CDs, the
verification time can be much less than X. I began to wonder if Windows may
not necessarily be reading all the contents of remaining copies, because it
probably thinks that the "same" CD is still in the drive and using the
contents of disk cache when the files were read in from the first copy. Thus,
one may be told that the all the files have been verified when in fact they
haven't been. This problem was confirmed. I had two copies of a DVD. One
copy was good, while the second copy had one file that was bad. Each disk was
verified by rebooting the computer and using MD5 sums for verifying. (The
second disk failed the verification for one file). Then, after rebooting the
computer, copy 1 was verified. Copy 2 was then inserted add passed the
verification process when it should not have.

After some searching, I found a post titled "How to flush the CD-ROM Cache
in Windows XP " (http://bitrazor.com/content/misc/cdromflush.php). I tried
following this procedure when swapping disk in the case I mentioned above
where I know I have one good and one bad copy. However I still got an
incorrect verification stating that copy 2 passed.

So, is there a procedure to force windows to invalidate its CD-ROM cache
when changing CDs.
 
U

Uwe Sieber

Check out if the 'insert notification' is activated. When
deactivated XP does not see the change.
http://www.uwe-sieber.de/files/autorunsettings.zip


If you validate using a self written software, just read
the data using the CreateFile flag FILE_FLAG_NO_BUFFERING.
This completely bypasses the cache and is usually faster.


Uwe
 
T

Tuco

After reading the text file in the mentioned zip file and apply some changes,
I am still not getting correct results. Here are two registry settings (that
I think are pertintant) before I made the original post.

HKLM\SYSTEM\CurrentControlSet\Services\Cdrom: 0
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoDriveAutoRun: 0x000000FF

I then made the changes such that

HKLM\SYSTEM\CurrentControlSet\Services\Cdrom: 1
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoDriveAutoRun: 0x00000000

Rebooted the machine then did my MD5 check on the affected file on the good
cd followed by the bad cd. The bad CD still passed the verification test. So
what other registry settings do I need to look at.
 
U

Uwe Sieber

The only setting in question is the value AutoRun under
HKLM\SYSTEM\CurrentControlSet\Services\Cdrom which in
fact control the insert notification. If this does not
help then use a software which bypasses the file cache.
I've made a file copy and a file compare tool which do
so:
http://www.uwe-sieber.de/files/ffc.zip
http://www.uwe-sieber.de/files/fcb.zip

It's unfinished software, proof of concept only.

You could compare the files on CD with files on harddisk.

Or get a MD5 tool with source code an modify it to
read unbuffered.


Uwe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top