Log-Structured File System
Hard Drive Recovery - Log-Structured File System
A log-structured filesystem is a file system design introduced by John K. Ousterhout and Fred Douglis in 1988 for yielding high write throughput. In log-structured filesystem, all updates to data and metadata are written sequentially to a continuous stream, called a log.
Conventional file systems usually lay out files with great care for spatial locality and make in-place changes to their data structures in order to perform well on magnetic disks, which tend to seek relatively slowly. This design will no longer be effective because the increasing memory demands on modern computers would lead to I/O becoming write-heavy as reads would be mostly satisfied from memory cache.
A log-structured file system addresses this issue by treating its storage as a circular log and writes sequentially to the head of the log, maximizing the write throughput on magnetic media by avoiding costly seeks. There are several benefits to this approach, as the writes create multiple, chronologically advancing versions of both file data and meta-data. It also makes recovery from crashes simpler. Upon its next mount, the file system does not need to walk all its data structures to fix any inconsistencies, but can reconstruct its state from the last consistent point in the log.
Implementations
The first log-structured file system was implemented for the Sprite operating system in 1992. Other important implementations include BSD-LFS for 4.4BSD, NILFS for Linux, LinLogFS and LFS for Linux, LogFS, a scalable flash filesystem for Linux, and ULFS, a is a user-level log-structured file system using FUSE.


