OverlayFS
Overview
OverlayFS is a union filesystem that stacks multiple directories into one view. Containers use it for image layers and copy-on-write filesystems.
Core Concepts
Lowerdir: read-only layers (image layers). Upperdir: writable layer for container changes. Workdir: internal scratch space required by OverlayFS. Merged: unified view presented to the container.
How Copy-on-Write Works
Reads come from the upper layer if present, otherwise from lower layers. Writes copy a file into the upper layer first (copy-up), then modify it. Deletions create whiteouts in the upper layer.
Container Notes
Layered images reduce storage and speed up pulls. Some filesystem features (e.g., hard links across layers) have limitations.