Image layers, writable state and copy-up 00:00:01 A one-byte edit copies a large file A new container changes one byte of a lookup table at startup. The disk suddenly holds another large file. Gia opens the image as a stack of transparent sheets. What the application edits and what the upper layer must store have different sizes. The fresh upper layer starts at zero. After the first data write it contains two hundred fifty-six binary megabytes of new data. A later edit to the copied file is quick, so timing the second edit would miss the expensive transition. A container image supplies read-only lower layers. OverlayFS presents them together with an upper writable layer. 00:00:40 Follow the first write into the upper layer Modifying a lower-layer file can require copying its data into that upper layer, depending on the operation and filesystem features. The merged file path looks unchanged even when the physical cost of the first write is substantial. A merged file path finds an unchanged file in the read-only lower layer. OverlayFS prepares an upper copy when the operation requires modifying file data. Later writes can target the existing private copy. Data kept only in its writable layer follows that layer’s lifetime. A separate volume has a different lifecycle. 00:01:17 Distinguish one changed byte from copied data If she rebuilds the image and edits that byte inside another fresh writable layer, should she expect the fast second-write timing? In this overlay configuration the first data modification copies the lower file into the writable upper layer. Separate the mutable field into a small independent file or a volume suited to it. Measure upper-layer growth and startup from a genuinely fresh instance. If later edits cost just as much, the steady-state storage path may dominate over the initial copy-up. 00:01:49 Repeat the first write on a fresh layer The replacement file adds one binary megabyte on first write in this example. Unchanged image data can be shared between containers. When a container modifies a lower file, a private upper copy may be required. Measure first-write cost separately. Gia repeats the cold start to verify the difference. The lower layer can remain shared when changes live in their own small object.