You can control the balance between performance and robustness on either
a global or per-file basis.
- Specifying the O_SYNC bit when opening
a file causes all I/O operations on that file (both data and
metadata) to be performed synchronously.
The
fsync()
and
sync()
functions let you flush the filesystem write-behind cache on
demand; otherwise, any dirty data is flushed from cache under the
control of the global blk delwri= option (the default is
two seconds—see
io-blk.so
in the Utilities Reference).
- You control the global configuration with the commit= option, either to io-blk.so as
an option to apply to all filesystems, or via the
mount
command as an option to apply to a single instance of a mounted filesystem). The
levels are none, low,
medium, and high,
which differ in the degree in which metadata is written synchronously versus
asynchronously, or even time-delayed.
Note: At any level less robust
than the default (that is, medium), the filesystem
doesn't guarantee the same level of integrity following an unexpected power loss,
because multiple-block updates might not be ordered correctly.