Aufs

From Gentoo Wiki
Jump to:navigation Jump to:search
As of 2020-12-29, the information in this article has been deprecated. It may or may not be relevant for contemporary usage. Handle with care!
Resources
Warning
sys-kernel/aufs-sources was removed from gentoo.git as of this comment in 2020-12-29.

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.

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

Emerge the pre-patched (sys-kernel/aufs-sources) package. This will install another set of kernel sources that have had the Aufs4 patches applied. The new sources will show up in /usr/src using a aufs suffixed name scheme.

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

root #emerge --ask sys-kernel/aufs-sources

After the emerge process is finished, list the available sources:

root #eselect kernel list
  [1]   linux-4.14.91-gentoo
  [2]   linux-4.14.91-aufs

Use eselect to set the symlink to the aufs kernel sources:

root #eselect kernel set 2

Kernel

KERNEL Enabling support for Aufs
File systems  --->
   Miscellaneous filesystems  --->
      [*] Aufs (Advanced multi layered unification filesystem) support
            Maximum number of branches (127)  --->
      [*]   Detect direct branch access (bypassing aufs)
              method (fsnotify)  --->
      [ ]   NFS-exportable aufs
      [*]   support for XATTR/EA (including Security Labels)
      [*]   File-based Hierarchical Storage Management
      [ ]   Readdir in userspace
      [ ]   Workaround for rename(2)-ing a directory
      [ ]   Show whiteouts
      [*]   Ramfs (initramfs/rootfs) as an aufs branch
      [ ]   Debug aufs

After the features have been set, build the kernel following the kernel configuration guide.

Configuration

In order to manage aufs, the sys-fs/aufs-util package is needed.

root #emerge --ask sys-fs/aufs-util

Usage

Check man aufs

See also

  • UnionFS - The original union filesystem.
  • OverlayFS — an in-kernel attempt at providing union file system capabilities on Linux.