Symantec logo

About enhanced data integrity modes

For most UNIX file systems, including VxFS, the default mode for writing to a file is delayed, or buffered, meaning that the data to be written is copied to the file system cache and later flushed to disk in a lazy fashion.

This provides much better performance than synchronously writing the data to disk. However, in the event of a system failure, data written shortly before the failure may be lost since it was not flushed to disk. In addition, if space was allocated to the file as part of the write request, and the corresponding data was not flushed to disk before the system failure occurred, uninitialized data can appear in the file.

For the most common type of write, delayed extending writes (a delayed write that increases the file size), VxFS avoids the problem of uninitialized data appearing in the file by waiting until the data has been flushed to disk before updating the new file size to disk. If a system failure occurs before the data has been flushed to disk, the file size has not yet been updated to be uninitialized data, thus no uninitialized data appears in the file. The unused blocks that were allocated are reclaimed.

The blkclear option and data integrity

In environments where performance is more important than absolute data integrity, the preceding situation is not of great concern. However, VxFS supports environments that emphasize data integrity by providing the mount -o blkclear option that ensures uninitialized data does not appear in a file.

The closesync option and data integrity

VxFS provides the mount -o mincache=closesync option, which is useful in desktop environments with users who are likely to shut off the power on machines without halting them first. In closesync mode, only files that are written during the system crash or shutdown can lose data. Any changes to a file are flushed to disk when the file is closed.

The log option and data integrity

File systems are typically asynchronous in that structural changes to the file system are not immediately written to disk, which provides better performance. However, recent changes made to a system can be lost if a system failure occurs. Specifically, attribute changes to files and recently created files may disappear.

The mount -o log intent logging option guarantees that all structural changes to the file system are logged to disk before the system call returns to the application. With this option, the rename(2) system call flushes the source file to disk to guarantee the persistence of the file data before renaming it. The rename() call is also guaranteed to be persistent when the system call returns. The changes to file system data and metadata caused by the fsync(2) and fdatasync(2) system calls are guaranteed to be persistent once the calls return.