Aufs

Aufs (Another Union File System) is an advanced multi-layered unification filesystem. Aufs was originally a re-design and re-implementation of the popular UnionFS, however after adding many new original ideas it became entirely separate from UnionFS. Aufs is considered a UnionFS alternative since it supports many of the same features.

Currently Aufs is in version 4.

Features

 * The ability to unite several directories into a single virtual filesystem. Calling the member directory as a branch;
 * Specification of the permission flags on each branch (readonly, readwrite, and whiteout-able);
 * Via upper writable branch, internal copyup and whiteout is possible (files and directories on the readonly branch are logically modifiable);
 * Dynamic branch manipulation (add, delete, etc.)

Installation
Users currently have two options in Gentoo to obtain support for Aufs in the kernel:


 * 1) Emerge the appropriate Aufs package. This could be either  or  This will download and install Aufs support to the existing kernel sources allowing the user to keep using the same (patched) sources. After the Aufs patch has been applied a re-configuration and re-compilation of the kernel (or at least the kernel modules) must be performed in order to obtain Aufs support. One caveat to this approach is that the Aufs patches can only be applied to a hardened-sources  kernel with specific options enabled. For most users the next option is a simpler choice.
 * 2) Emerge the pre-patched  package. This method will install another set of kernel sources that have had the Aufs3 patches applied. The new sources will show up in  using a X suffixed name scheme. Proceed to the relevant section below if this method has been chosen. The kernel will then need to be reconfigured and recompiled.

Search the net for anything older than the 3.x version. Why would anyone desire to use an older version?

From here on out, this article will suppose the second option was chosen. See the aufs-sources entry in the kernel overview for more information concerning the package.

Preparation
If hardened sources are not yet emerged on the system, do so presently:

After the process is finished, list the available sources:

Use to set the symlink to the hardened kernel sources:

Host Kernel
For the Aufs package not to complain upon install, quite a few features must be enabled in the kernel. Navigate to the kernel sources directory:

Using a method of choice, set the following options in the kernel to prepare for the Aufs patches:

If using hardened sources, also check the following:

After the features have been set, build the kernel:

Emerge Aufs
To install the Aufs patch-set onto hardened kernel sources run the following command:

Configuration
In order to work with Aufs, the package is needed; utilities are always necessary for Aufs. This packages should be pulled in when emerging. In the case that it is not, run:

Kernel configuration
Aufs must be enabled in the kernel.

Kernel configuration
When installing many issues are a result of an incorrect kernel configuration. Currently the ebuild does not helpfully provide messages instructing the user on which kernel features must be enabled for correct kernel configuration.

Reading the kernel configuration section above is one helpful method to determine which features are missing. Another method is to open the actual ebuild file and investigate. Although opening an ebuild may seem like a daunting task, it is really not difficult at all. Use a favorite pager or text editor, browse to the ebuild's directory ( is the default location for Portage's ebuilds), and open the ebuild file that failed to install the selected software version. Supposing was the selected ebuild:

Look in the  function for kernel variable names that may not be selected in the current kernel configuration. If missing features are found, then update the kernel sources accordingly.