$_ CLI In Depth
Learning progress 0%
case disks mounts archives

System Deep-Dive: The Overlay Root of This Course's Machine

5 min read Module 12: Disks, Mounts & Archives Updated Dec 5, 2026
Cheat Sheet
0:00 / 3:19

Start from the disk

At the bottom of the stack is a block device named wda. It is a small read-only image of about 24 MiB, and the kernel reports its read-only flag in /sys/block/wda/ro. The image is formatted with a read-only filesystem designed for compressed, static content, which keeps the download small. Because the device is marked read-only in the kernel, no process in the lab can write to the image, not even root.

Reading the device from the lab is safe and useful. The first step of any system investigation is to confirm what the hardware layer reports, before you look at any filesystem built on top of it.

BASH2 lines
lsblk -d -o NAME,SIZE,RO,TYPE
cat /sys/block/wda/ro

The image is mounted as a lower layer

The image is mounted read-only at a path inside the guest. lsblk shows that mount point in its last column, as a location under /run. That directory is not part of the directory tree you use. It is a staging area that the setup code uses to assemble the root. The overlay refers to it as a lower layer, which is the read-only part of the stack.

The lower layer holds the operating system files, such as the programs in /bin and /usr. Because it is read-only, those files cannot be changed by any program running in the lab, and that is what makes the lab repeatable. Every reload starts from the same image.

The writable layer lives in memory

On top of the lower layer sits a writable upper layer. Anything you create or change through the root, including the files in /workspace, lands in the upper layer. Because that layer is part of a tmpfs, it lives in memory and disappears when the page reloads. The tmpfs is a separate mount that the setup code combines with the image.

The combined result is an overlay filesystem mounted at /. Reads of a file consult the upper layer first and then the lower image. A write to a lower file copies it up into memory first. A delete of a lower file adds a whiteout, a marker that hides the file while leaving the image untouched.

Reading the stack from the lab

You can see the stack from inside the shell. The mount table shows the overlay at the root and the tmpfs at /tmp. The options of the overlay name its lower and upper directories, which correspond to the layers described above.

BASH2 lines
findmnt -n -o TARGET,SOURCE,FSTYPE /
awk '$2 == "/tmp" { print $2, $3 }' /proc/mounts

The first command reports the overlay at /. The second reports the tmpfs at /tmp. The two mounts have different lifetimes, and that difference is the reason some paths survive a session and others do not.

Note

The exact directory names inside the overlay options are internal to the setup and may change between releases of the course. The principle does not change: a read-only image, a writable memory layer, and one merged root.

The assembly happens early in the boot of the guest, before your shell starts. The setup mounts the image read-only, creates the memory-backed upper layer, and mounts the overlay at the root. Only after those mounts exist do the login processes start. Each step is a mount operation, which is why the mount table is the best place to read the design of the system.

What this means for your work

A stateless root is a useful model for real systems too. Container images and some appliances use the same idea, with a read-only base and a thin writable layer. The lesson for you is practical. Before you trust a file path, check which mount holds it. A file in /workspace is safe for the session. A file in /tmp is memory only. A file that came with the image is read-only, and an edit to it is a copy-up that vanishes on reload.

The same reasoning applies to disk-full errors. The overlay size is bounded by the memory available to the tmpfs, so writing a large file can fill the root even though the image is nearly empty. df -P /workspace reports that bound, and du can show which of your files are using it.

Hands-on: trace one file through the layers

Create a file in /workspace and follow its path through the stack: the directory belongs to the root overlay, the mount is overlay, and the write landed in the writable layer. The commands below collect all three facts with no changes to the system.

BASH3 lines
echo layered > stack-demo.txt
findmnt -n -o TARGET,FSTYPE -T stack-demo.txt
df -P stack-demo.txt | tail -1 | awk '{ print $1, $6 }'

Each command answers one question: which mount holds the file, which type it is, and which filesystem the storage reports. Together they describe the machine you are using, which is an overlay built from a read-only image and a memory-backed upper layer.

The overlay root: layers, copy-up and whiteouts

Visualizer

The root filesystem here is two layers merged into one view. Reads fall through to the read-only layer, writes go to a RAM layer, and deletes leave a marker.

1 / 4
Root filesystem /
uppertmpfs: read-write, in RAM
lowererofs on /dev/wda: read-only

The root / is an overlay of two layers. The upper layer is a tmpfs in RAM and takes all writes. The lower layer is a read-only image. You see the merged result.

findmnt /
Check yourself Question 1 of 4
Concept Check The lab's lower layer recall

What does the lab use as its read-only lower layer?

Recap & Key Takeaways

The lab root is an overlay that merges a read-only disk image, which is the lower layer, with a writable memory layer, which is the upper layer.
A file you create in /workspace lives in the upper layer and is lost on reload, while the image itself cannot be changed by any process in the lab.
findmnt and /proc/mounts show the overlay at / and the tmpfs at /tmp, and together they explain which paths survive a session.
The same model of a read-only base with a thin writable layer is used by containers and by stateless appliances.
Was this lesson helpful? Spot an issue or have a suggestion? Let us know on GitHub.
Report an issue