This answer and email message indicate that something called "OverlayFS" is available in Ubuntu 11.10 and will forcefully replace aufs in Ubuntu 12.04.
How do I use it? Where is its documentation?
|
This answer and email message indicate that something called "OverlayFS" is available in Ubuntu 11.10 and will forcefully replace aufs in Ubuntu 12.04. How do I use it? Where is its documentation? |
||||
|
Edit: Since writing this answer, some things have changed in overlayfs, namely the addition of a required parameter I finally managed to find it. I found references to it in the kernel source, but for some reason it doesn't appear in the git tree on kernel.org. But! If you pull the Ubuntu kernel source like this: As the actual help documentation is more of a "how it works" instead of a "how to mount with it," here's a brief rundown (there is one example in the kernel documentation):
Where [mount options] can be:
One thing that confused me at first, so I should probably clarify, is that mounting an overlayfs does not actually mount a filesystem. I was trying to mount a squashfs filesystem using an overlayfs mount, but that's not how it works. You must first mount the (in my case squashfs) filesystem to an arbitrary directory, then use overlayfs to merge the mount point (a directory) and another directory onto a tertiary directory (the overlayfs mount point)(edit: this "tertiary" directory can actually be the upperdir= directory). The tertiary directory is where you will see the merged filesystems (or directory trees - it's flexible). Example 1, overlaying the root filesystemI've been working on an Ubuntu hybrid boot disk where the base Ubuntu system exists as filesystem.squashfs and I have files called ubuntu.overlay kubuntu.overlay xubuntu.overlay and lubuntu.overlay. The .overlay files are base installs of said systems with the contents of filesystem.squashfs pruned (to save space). Then I modified the init scripts to overlay the correct distro's .overlay file (from a boot parameter) using overlayfs and the above options and it works like a charm! These are the lines that I used in my init scripts (once all variables are translated):
Note that filesystem.squashfs above is a directory created by casper, not a file. These three statements create an Example 2, transparent merging of two directoriesIn the process of re-building my live USB for each release, I use OverlayFS to save a bunch of time. I start off with a directory called ubuntu-base which contains the contents of the ubuntu-core image which is the most basic install. I will then create directories called ubuntu, kubuntu, lubuntu, and xubuntu. Then, I use OverlayFS to make the files from the ubuntu-base show up in the individual directories. I would use something like this:
This makes the files from ubuntu-base show up in the kubuntu folder. Then, I can |
|||||||||||||||||||||
|
|
From https://www.kernel.org/doc/Documentation/filesystems/overlayfs.txt:
|
|||||
|
|
I have extended these artikels to include a Script for overlayfs that sets up a read-only root fs.
Hope it helps. |
|||||
|
mount -t overlayfs -o rw,uppderdir=x,lowerdir=y overlayfs /mount/point. Beyond that I'm clueless. I'm tinkering with it in a live system, but I haven't managed to get it to to work yet. I wish I could find out exactly what "upperdir" and "lowerdir" mean. I've found nothing. – Chuck R Mar 2 '12 at 16:17