Log-structured file system

This is an old revision of this page, as edited by 194.46.250.30 (talk) at 00:51, 19 December 2005 (Limited-life media). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
This is about the concept of a log-structured file system. For the NetBSD file system, see Log-structured File System.

A log-structured filesystem is a file system design first proposed by John K. Ousterhout and Fred Douglis.

Magnetic disks

Conventional filesystems tend to lay out files on disk with great care for spatial locality and make in-place changes to data structures on disk in order to perform well on magnetic disks, which tend to seek relatively slowly.

The design of a log-structured filesystems is based on the hypothesis that this will no longer be effective because ever-increasing memory sizes on modern computers would lead to disk I/O becoming write-heavy because disk reads would be almost always satisfied from memory cache.

To maximize write throughput, a log-structured file system treats the disk as a circular log and writes sequentially to the head of the log. This has the side effect of creating multiple, chronologically-advancing versions of both file data and meta-data. Thus, a log-structured file system is a journaling filesystem in that the entire file system is a journal.

Such filesystems:

  • May allow access to old versions of files, a feature sometimes called time-travel or snapshotting.
  • Recover quickly after crashes because no consistency checks are needed. Instead, the file system simply rolls forward from the last consistent point in the log.
  • Tend to have good write performance.

John K. Ousterhout and Mendel Rosenblum implemented the first log-structured file system for the Sprite operating system in 1992. An implementation by Margo Seltzer, the Log-structured File System, was added later to 4.4BSD, and thence was ported to NetBSD.

Limited-life media

More recently, log-structured file systems have been used on media like flash memory and CD-RW for entirely different reasons. These degrade slowly as they are written to and have a limited number of erase/write cycles.

A log-structured file system such as UDF or JFFS2 provides better wear levelling on such storage media because it does not update data structures in-place as frequently as conventional file systems do.

References