Re: Write-through the hard disk cache to persistent media (+)



SATA drives don't support per-request write through flag. Only SCSI drives
do that. Fot ATA/SATA you can only disable it completely.

"Mejedi" <Mejedi@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:D11471E3-54EA-4492-8DB5-4612AB9E37E1@xxxxxxxxxxxxxxxx
Is there a reliable method to ensure that data is commited to physical
media
when writing files?

MSDN says:
CreateFile

FILE_FLAG_WRITE_THROUGH
Instructs the system to write through any intermediate cache and go
directly to disk.
If FILE_FLAG_NO_BUFFERING is not also specified, so that system caching
is in effect,
then the data is written to the system cache, but is flushed to disk
without delay.

If FILE_FLAG_NO_BUFFERING is also specified, so that system caching is
not in effect,
then the data is immediately flushed to disk without going through the
system cache.
The operating system also requests a write-through the hard disk cache to
persistent
media. However, not all hardware supports this write-through capability.

I try to get the described behaviour (i.e. FFNB|FFWT to ensure data is
actually stored on plates) but something strange happens. I have a small
test
program that writes a preallocated contigous 100MB file (the same file for
all runs) in 32KB blocks sequentially and collects timing data with
QPF+QPC.
IO is done synchronously, OS is WinXP Sp2, using 7200 RPM SATA WD drive.

If write caching is enabled I get these results (timing in microsecs).
They
don't change whether FFWT flag is set or not.
631
551
581
744
655
538
560
558
668
556
835
544
546
553
503
512
507
...

If write caching is disabled (with a checkbox in Control Panel) I get
these
results. Again nothing changes when FFWT is set.
13211
8754
8701
9023
8562
8763
8777
8789
8736
8787
8782
8782
8784
8788
8779
8749
8768
...

I expect to get the results similar to second ones when running with write
cache enabled and oppening file with FFWT|FFNB. I guess that timing ways
less
than rotational delay witnesses that no write-through HDD cache actually
happens.

Is there a reliable method to ensure that data is commited to physical
media
when writing files?


.



Relevant Pages

  • Re: DVD RAM?
    ... I have read that DVD RAM is a much more reliable media for important ... DVD RAM but pressumably use the type 4 cartridge with the disk ... would be Pioneer or Plasmon (not sure if Plasmon made drives or just ... and the stated reliability drops dramatically for the formats ...
    (comp.sys.ibm.pc.hardware.storage)
  • Re: Deleting data from a HP 3000 disk drives
    ... >> Purging information is a media sanitization process that protects ... > Unless your ATA disk has a firmware secure wipe function, ... > sight of everything but the drives firmware, ...
    (comp.sys.hp.mpe)
  • Re: DVD RAM?
    ... I have read that DVD RAM is a much more reliable media for important ... However I cant seem to see any drives that take the media ... like just another disk without kluges such as packet-writing. ... The chemistry of DVD-RAM and of DVD-RW is the same. ...
    (comp.sys.ibm.pc.hardware.storage)
  • Re: Deleting data from a HP 3000 disk drives
    ... For Media Sanitization": ... Clearing information is a level of media sanitization ... sight of everything but the drives firmware, ... to do an easy data extraction off an "accidentally" erased disk. ...
    (comp.sys.hp.mpe)
  • Re: JPEG fading and Sensor size
    ... drive -- and cosmic rays coming from the sun. ... larger media such as DVDs and 5.25 inch floppy disks ... Back in the old days when disk drives were ...
    (rec.photo.digital)

Loading