fs_async.5 (2010 09)
f
fs_async(5) fs_async(5)
(Tunable Kernel Parameters)
NAME
fs_async - enables write calls to return before write operation is complete
VALUES
Failsafe
0
Default
0
Allowed values
The allowed values are:
0 (use synchronous disk writes only), or
1 (allow asynchronous disk writes).
Specify a positive integer value,
0 or
1.
DESCRIPTION
fs_async specifies whether or not asynchronous writing of file system data structures to disk is
allowed.
Synchronous writes to disk make it easier to restore file system integrity if a system crash occurs while
file system data structures are being updated on the file system.
If asynchronous writes are selected, HP-UX file system semantics for NFS cluster environments are
preserved. In addition, files opened using
open() with the 0_SYNC flag (synchronous writing) will con-
tinue to be written synchronously when the asynchronous-writes feature has been configured into the ker-
nel.
Asynchronous writes to disk can improve file system performance significantly. However, asynchronous
writes can leave file system data structures in an inconsistent state in the event of a system crash. For
more information about when to select synchronous or asynchronous writing, see the following tutorial.
Restrictions on Changing
This tunable is static. Any changes to the value of this tunable will require system reboot before taking
effect.
Tutorial: What are Synchronous and Asynchronous Writes?
If a file is open for writing and data is being written to a file, the data is accumulated in buffers and
periodically written to disk. When an end-of-file condition occurs and the file is to be closed, any remain-
ing buffer contents are written to the disk, the inode is updated with file size and block pointer informa-
tion, and the file system’s list of free disk blocks is updated. To ensure maximum protection of file system
integrity, these operations are handled in a specific sequence that minimizes the risk of file system corr-
uption on the disk if a system crash or power failure occurs while writing to the disk. This sequential
update process is called synchronous writing .
HP-UX file systems store free space lists, blocks, inodes, and other file components in random and widely
separate locations on disk devices. This means that writing file information blocks in a particular
sequence requires additional time to move to the desired location on the disk before performing the write
operation. If a power failure or system crash occurs during this sequence, one or more blocks may not be
properly updated, leaving a potentially inconsistent file system. The fsck command is used to repair
such inconsistencies.
Asynchronous writing as it relates to the
fs_async kernel parameter allows the system to update file
system information on the disk in a more convenient (hence faster) sequence rather than in a more secure
(safer but slower) sequence, thus reducing search and move delays between writes. However, if a system
crash occurs while these operations are being performed, the risk of an inconsistent file system that can-
not be automatically repaired by fsck is significantly greater than with synchronous writes.
Consequences of a Crash
If only synchronous writing is used, all updates to directories, file inodes, free space lists, and so on are
handled in a sequence that is known to
fsck. If a crash occurs while updating any disk block in the
sequence, fsck can readily determine where the crash occurred and repair the missing update informa-
tion, probably without assistance from the system administrator.
HP-UX 11i Version 3: September 2010 − 1 − Hewlett-Packard Company 1