David Brown wrote: > On Wed, Aug 20, 2008 at 08:52:03AM -0700, 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. > > If you have a modern linux kernel and the drive/controller path > supports write barriers you can do a lot to mitigate losses even with > a large cache. > > Basically, a well-designed filesystem inserts write barriers between > certain writes, and the drive will make sure that all writes before > barrier happen before those afterward. Unfortunately, most of the > filesystems seem to silently just not use barriers if they aren't > present (XFS complains loudly) even though their presence > significantly helps reliability on power loss.
So I wonder which (controllers &) drives support write barriers. How does one find out? The hdparm help and manpage seem silent about it. I suppose there might be some parm in /sys/block/sda (or?), but I can't see anything obviously relevant. I did find a lwn article about the subject (may, 2008) http://lwn.net/Articles/283161/ It includes this: """ So barriers are disabled by default because they have a serious impact on performance. And, beyond that, the fact is that people get away with running their filesystems without using barriers. Reports of ext3 filesystem corruption are few and far between. """ There's more good content in the article, for those who are interested. I will just report that mount -o remount,barrier=1 ... does seem to work on my 2.6.23.17-88.fc7. Maybe I'll try a couple of simpleminded performance checks when I get a chance. Regards, ..jim -- [email protected] http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list
