Pcornel
Storage · Filesystems

Copy-on-Write

Cheat sheet · https://pcornel.dk/topic.php?topic=3960

Back to the Topic

Answer

CoW filesystems allocate new extents for changed content rather than overwriting referenced blocks in place. This enables snapshots and checksummed tree updates but can increase fragmentation, metadata work and write amplification depending on workload.

Remember

  • CoW ≠ backup.
  • CoW snapshot ≠ independent copy.
  • Atomic metadata update ≠ application transaction consistency.
  • CoW ≠ guaranteed lower write amplification.

First checks

  • btrfs filesystem du <dir> — shared extents
  • zfs list -o name,used,refer — COW snapshot space
  • cp --reflink=always a b — reflink copy

Verify in this order

write → new block → pointer update → old block kept if referenced

Where it usually breaks

First mismatch in media/provider → controller/pool → logical object → path/protocol → filesystem/share/object namespace → consumer workload; preserve identity/pre-state before mutation.

Filesystems → Copy-on-Write filesystem map

Filesystem boundaryWhat to verifyProof limit
Identity / attachmentFilesystem type, source/backing object, mount/attachment target and effective optionsPresence or mount state alone does not prove consistency or lower-layer health
Capacity / metadataData space, metadata/inodes, quotas/reservations and filesystem stateFree bytes at one layer do not prove allocation can succeed end to end
Failure boundarySuccessful CoW update proves the filesystem preserved its update semantics for that change; it does not create an independent backup or guarantee optimal performance.Correlate filesystem evidence with the backing volume/path/backend before repair
AcceptanceHealthy evidence: allocation has headroom, CoW metadata is consistent, snapshot/space growth is understood and workload latency remains within expectations.Close only after the original path/workload and read-back check succeeds

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=3960

Confirmation

Confirm action

Continue?