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.
lsblk -d -o NAME,SIZE,RO,TYPE
cat /sys/block/wda/roThe 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.
findmnt -n -o TARGET,SOURCE,FSTYPE /
awk '$2 == "/tmp" { print $2, $3 }' /proc/mountsThe 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.
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.
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.