Reference

Copy-on-Write

Copy-on-write (CoW) is a storage technique where a copy shares the original's data blocks until something changes; only modified blocks are written to new locations, so copies are cheap and changes never overwrite shared data in place.

APIs & internalsiOSiPadOSmacOS

Copy-on-Write

Also known as: cow filesystem, copy on write storage, copy on write filesystem

Copy-on-write (CoW) is a storage technique where a copy shares the original's data blocks until something changes; only modified blocks are written to new locations, so copies are cheap and changes never overwrite shared data in place.

  • Copies share data blocks until a write forces new blocks to be allocated for changed regions.
  • Powers APFS clones and snapshots, plus reflink copies on file systems like Btrfs.
  • Makes copies cheap but means summed file sizes can overstate true disk usage.

How copy-on-write works

When data is copied under copy-on-write, the system does not duplicate the underlying blocks. Both the original and the copy reference the same blocks, which are marked as shared. A write to either copy triggers allocation of fresh blocks for just the changed regions, after which that copy points at the new blocks while the other keeps the originals.

Modern file systems use this directly. APFS on iOS, iPadOS, and macOS exposes it through clonefile() and file duplication, and Linux file systems like Btrfs offer reflink copies. The same idea drives APFS snapshots and Time Machine local snapshots, which capture a point-in-time view by freezing shared blocks rather than copying everything.

Why it explains surprising storage

Copy-on-write is why duplicating a large file can seem instantaneous and free, and why a volume can hold more apparent data than its raw capacity. It is also why deleting one copy may free little space if blocks are still shared, and why a single edit to a big file can suddenly consume space as new blocks are allocated.

For storage cleanup this distinction is essential. Tools that just sum file sizes overstate what you can recover. A cleaner like Cleanor targets genuinely independent duplicates and stale caches, so reclaimable space reflects blocks that are truly freed rather than shared CoW data.

Related terms

Keep reading the reference.

Act on it

Guides and tools for this topic.