AlgoMaster Logo

Copy-on-Write File Systems

Low Priority27 min readUpdated August 14, 2026

Suppose a service changes just 20 bytes in a large database file. A traditional file system may overwrite the existing block and update the related metadata.

A copy-on-write file system takes a different approach:

  1. Allocate new space.
  2. Write the changed block into that space.
  3. Write new metadata that points to it.
  4. Publish the new metadata tree.
  5. Reclaim the old version only when nothing still references it.

The old block is not modified while it remains part of the current persistent state.

In a copy-on-write, or CoW, file system, an update creates a new version of changed blocks and publishes that version through new references instead of overwriting the old reachable version in place.

This principle can provide crash-consistent tree updates, efficient snapshots, and block sharing. It also introduces extra allocation work, reference tracking, fragmentation, and write amplification.

This chapter follows copy-on-write updates through rooted metadata trees and commit publication, then examines recovery, snapshots, reflinks, shared-block ownership, checksums, reclamation, fragmentation, and write amplification.

Premium Content

Subscribe to unlock full access to this content and more premium articles.