Write barriers for journaling filesystems

Testing exercises with XFS, ext3, and power failure. I found advice to use write barriers. It appears that any journaling file system (XFS/Reiser/ext3) will benefit w.r.t. power failures. Almost all hard drives, IDE, SATA, USB, SCSI have a ~multimegabyte write cache nowadays.
"OK, enough theory. Do this: mount all of your filesystems with I/O barrier turned on. Something like this (example line from my /etc/fstab): /dev/sda5 / ext3 defaults,barrier=1 1 1" http://kerneltrap.org/node/6173#comment-193357
"Fortunately, you can have your cake and eat it too. The trick is to implement IO barriers using the CACHE FLUSH and/or FUA commands. That way you can have the performance and MTBF benefits of write-back caching while still having a safe fsync() (safe as in doesn't return before data is on the platters)." http://lwn.net/Articles/181393/
It seems like maybe a good default setting for journaled filesystems, especially on USB (which users often yank out...).
M
P.S. Update on ZFS. Apple will include it in their next OS release (mika: not as default/boot, still HFS+ for that). Also, Sun may release ZFS under GPLv3 "eventually." http://apple.slashdot.org/apple/06/12/18/1155226.shtml http://www.itweek.co.uk/vnunet/news/2172823/sun-kills-gpl3-rumours

(Fstab syntax)
you can speed up your file systems you know, just add the options below to your fstab entry
for Ext3: noatime,nodiratime,barrier=1 for XFS: noatime,nodiratime,barrier for ReiserFS3: notail,noatime,nodiratime,barrier=flush
http://linux.wordpress.com/2006/09/27/suse-102-ditching-reiserfs-as-it-defau...

On Sat, 20 Jan 2007 20:44:32 -0700, Mark wrote:
just add the options below to your fstab entry
Thanks a lot for sharing, Mark.
The more of this kind of "spam" the better. :-)
participants (2)
-
][
-
Mark