Klaus Knopper answers your Linux questions
Ask Klaus!
Overlay Partitions
Question: Klaus: Knoppix 7.0.5 has a new experimental feature, allowing an overlay on a separate partition of a USB flash disk. Can you explain how it works?
Answer: Most Live distros use a (ram)disk overlay nowadays to allow virtual write access to files on a read-only medium. Before overlay filesystems like UnionFS and Aufs came into existence, you had to copy all directories that needed to be writable for configuration and storage of intermediate data (e.g., subdirectories of /var, /home, and /etc) to the ramdisk, and create symlinks on the ramdisk back to the read-only parts located on CD or DVD to keep RAM usage down.
An overlay, which is a stacking virtual filesystem, works with layers of directories; the "upper" ones are transparent (i.e., invisible) to the lower ones if they don't contain the data being searched for. Every time a file is accessed in read mode, the directory stack is searched from top to bottom for the file. The first directory layer containing the named file wins, and the file is opened from there. When writing to a file, only the top directory layer is accessed, and there the file is created or copied (Figure 1).
[...]
Buy this article as PDF
(incl. VAT)
