UFS logging is the process of storing transactions (changes that make up a complete UFS operation) in a log before the transactions are applied to the UFS file system. Once a transaction is stored, the transaction can later be applied to the file system later.
At reboot, the system discards incomplete transactions, but applies the transactions for completed operations. The file system remains consistent because only completed transactions are ever applied. This consistency remains even when a system crashes, which normally interrupts system calls and introduces inconsistencies into a UFS file system.
UFS logging provides two advantages:
Prevents file systems from becoming inconsistent, therefore eliminating the need to run the fsck command. And, because fsck checking can be bypassed, UFS logging reduces the time required to reboot a system if it crashes, or after an unclean halt (see What the fsck Command Checks and Tries to Repair for details on unclean halts).
UFS logging can significantly reduce the boot time on systems with large file systems, which usually take a long time to read and verify with the fsck command.
The log created by UFS logging is continually flushed as it fills up. The log is flushed when the file system is unmounted or as a result of the lockfs -f command.
UFS logging is not enabled by default. To enable UFS logging, you must specify the -o logging option with the mount command in the /etc/vfstab file or when you mount the file system manually. The log is allocated from free blocks on the file system, and it is sized at approximately 1 Mbyte per 1 Gbyte of file system, up to a maximum of 64 Mbytes. Logging can be enabled on any UFS file system, including the root (/) file system. Also, the fsdb command now has new debugging commands to support UFS logging.