Andrew Lentvorski wrote: > Gus Wirth wrote: >> Consider the cache on the hard drive. One of the boasting points of hard >> drive manufacturers is the size of the RAM cache for the drive. What >> isn't specified is how that cache behaves under a power loss. Does it >> try and write itself to the disk? Does it just dump everything? Even if >> the operating system has done a perfect job in syncing memory to disk, >> it still hasn't really been written out until the drive itself flushes >> its own cache. And you have no control over that. > > I don't believe that this is true. The FreeBSD guys actually went > around and around with the disk manufacturers about this back when they > moved from 512byte sectors to 4096byte sectors. > > There apparently are commands to bypass write caches as well as tell the > truth about sector sizes (both very important in terms of atomicity).
The command for controlling the hard drive write cache is hdparm. It's been a long time since I had to play with hard drive settings so this looks like a more recent change. To turn off the write cache you would do: # hdparm -W 0 /dev/sda By default, my system comes up with the write cache on. I guess I'll need to do some testing to see if it makes any performance difference. Theoretically, my system should be more reliable if I turn the write cache off because it removes something outside the scope of kernel control. But I think Chris should be the one to test this extensively since he seems to be the one that is always having problems. Gus -- [email protected] http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list
