UnionFS

Last updated

Unionfs
Developer(s) Open Source Community
Full nameUnification File System
Features
File system
permissions
POSIX
Transparent
compression
No
Transparent
encryption
No (but can be provided at the block device level)
Other
Supported
operating systems
Linux, FreeBSD and NetBSD

Unionfs is a filesystem service for Linux, FreeBSD and NetBSD which implements a union mount for other file systems. It allows files and directories of separate file systems, known as branches, to be transparently overlaid, forming a single coherent file system. Contents of directories which have the same path within the merged branches will be seen together in a single merged directory, within the new, virtual filesystem.

Contents

When mounting branches, the priority of one branch over the other is specified. So when both branches contain a file with the same name, one gets priority over the other.

The different branches may be either read-only or read/write file systems, so that writes to the virtual, merged copy are directed to a specific real file system. This allows a file system to appear as writable, but without actually allowing writes to change the file system, also known as copy-on-write. This may be desirable when the media is physically read-only, such as in the case of Live CDs.

Unionfs was originally developed by Erez Zadok and his team at Stony Brook University. [1] [2] [3]

Uses

In Knoppix, a union between the file system on the CD-ROM or DVD and a file system contained in an image file called knoppix.img (knoppix-data.img for Knoppix 7) on a writable drive (such as a USB memory stick) can be made, where the writable drive has priority over the read-only filesystem. This allows the user to change any of the files on the system, with the new file stored in the image and transparently used instead of the one on the CD. [4]

Unionfs can also be used to create a single common template for a number of file systems, or for security reasons. It is sometimes used as an ad hoc snapshotting system.

Docker uses file systems inspired by Unionfs, such as Aufs, to layer Docker images. As actions are done to a base image, layers are created and documented, such that each layer fully describes how to recreate an action. This strategy enables Docker's lightweight images, as only layer updates need to be propagated (compared to full VMs, for example). [5]

UbuntuLTSP, the Linux Terminal Server Project implementation for Ubuntu, uses Unionfs when PXE booting thin or thick clients. [6]

Other implementations

Unionfs for Linux has two versions. Version 1.x is a standalone one that can be built as a module. Version 2.x is a newer, redesigned, and reimplemented one.

aufs is an alternative version of unionfs. [7]

overlayfs written by Miklos Szeredi has been used in OpenWRT and considered by Ubuntu and has been merged into the mainline Linux kernel on 26 October 2014 [8] after many years of development and discussion [9] for version 3.18 of the kernel.

unionfs-fuse is an independent project, implemented as a user space filesystem program, instead of a kernel module or patch. Like Unionfs, it supports copy-on-write and read-only or read–write branches. [10]

The Plan 9 from Bell Labs operating system uses union mounts extensively to build custom namespaces per user or processes.

Union mounts have also been available in BSD since at least 1995. [11]

The GNU Hurd has an implementation of Unionfs. [12] As of January 2008, it works, but results in a read-only mount-point.

mhddfs works like Unionfs but permits balancing files over drives with the most free space available. It is implemented as a user space filesystem.

mergerfs is a FUSE based union filesystem which offers multiple policies for accessing and writing files as well as other advanced features (xattrs, managing mixed RO and RW drives, link CoW, etc.). [13]

Sun Microsystems introduced the first implementation of a stacked, layered file system with copy-on-write, whiteouts (hiding files in lower layers from higher layers), etc. as the Translucent File Service in SunOS 3, circa 1986. [14]

JailbreakMe 3.0, a tool for jailbreaking iOS devices released in July 2011, uses unionfs techniques to speed up the installation process of the operating system modification. [15]

See also

Related Research Articles

XFS is a high-performance 64-bit journaling file system created by Silicon Graphics, Inc (SGI) in 1993. It was the default file system in SGI's IRIX operating system starting with its version 5.3. XFS was ported to the Linux kernel in 2001; as of June 2014, XFS is supported by most Linux distributions; Red Hat Enterprise Linux uses it as its default file system.

ext2, or second extended file system, is a file system for the Linux kernel. It was initially designed by French software developer Rémy Card as a replacement for the extended file system (ext). Having been designed according to the same principles as the Berkeley Fast File System from BSD, it was the first commercial-grade filesystem for Linux.

Linux has several filesystem drivers for the File Allocation Table (FAT) filesystem format. These are commonly known by the names used in the mount command to invoke particular drivers in the kernel: msdos, vfat, and umsdos.

<span class="mw-page-title-main">Live CD</span> Complete, bootable computer installation that runs directly from a CD-ROM

A live CD is a complete bootable computer installation including operating system which runs directly from a CD-ROM or similar storage device into a computer's memory, rather than loading from a hard disk drive. A live CD allows users to run an operating system for any purpose without installing it or making any changes to the computer's configuration. Live CDs can run on a computer without secondary storage, such as a hard disk drive, or with a corrupted hard disk drive or file system, allowing data recovery.

chroot is an operation on Unix and Unix-like operating systems that changes the apparent root directory for the current running process and its children. A program that is run in such a modified environment cannot name files outside the designated directory tree. The term "chroot" may refer to the chroot(2) system call or the chroot(8) wrapper program. The modified environment is called a chroot jail.

Filesystem in Userspace (FUSE) is a software interface for Unix and Unix-like computer operating systems that lets non-privileged users create their own file systems without editing kernel code. This is achieved by running file system code in user space while the FUSE module provides only a bridge to the actual kernel interfaces.

A versioning file system is any computer file system which allows a computer file to exist in several versions at the same time. Thus it is a form of revision control. Most common versioning file systems keep a number of old copies of the file. Some limit the number of changes per minute or per hour to avoid storing large numbers of trivial changes. Others instead take periodic snapshots whose contents can be accessed using methods similar as those for normal file access.

seccomp is a computer security facility in the Linux kernel. seccomp allows a process to make a one-way transition into a "secure" state where it cannot make any system calls except exit , sigreturn , read and write to already-open file descriptors. Should it attempt any other system calls, the kernel will either just log the event or terminate the process with SIGKILL or SIGSYS. In this sense, it does not virtualize the system's resources but isolates the process from them entirely.

OS-level virtualization is an operating system (OS) virtualization paradigm in which the kernel allows the existence of multiple isolated user space instances, called containers, zones, virtual private servers (OpenVZ), partitions, virtual environments (VEs), virtual kernels, or jails. Such instances may look like real computers from the point of view of programs running in them. A computer program running on an ordinary operating system can see all resources of that computer. However, programs running inside of a container can only see the container's contents and devices assigned to the container.

NILFS or NILFS2 is a log-structured file system implementation for the Linux kernel. It was developed by Nippon Telegraph and Telephone Corporation (NTT) CyberSpace Laboratories and a community from all over the world. NILFS was released under the terms of the GNU General Public License (GPL).

Squashfs is a compressed read-only file system for Linux. Squashfs compresses files, inodes and directories, and supports block sizes from 4 KiB up to 1 MiB for greater compression. Several compression algorithms are supported. Squashfs is also the name of free software, licensed under the GPL, for accessing Squashfs filesystems.

The following tables compare general and technical information for a number of file systems.

ext4 is a journaling file system for Linux, developed as the successor to ext3.

<span class="mw-page-title-main">NTFS-3G</span>

NTFS-3G is an open-source cross-platform implementation of the Microsoft Windows NTFS file system with read/write support. NTFS-3G often uses the FUSE file system interface, so it can run unmodified on many different operating systems. It is runnable on Linux, FreeBSD, NetBSD, OpenSolaris, illumos, BeOS, QNX, WinCE, Nucleus, VxWorks, Haiku, MorphOS, Minix, macOS and OpenBSD. It is licensed under the GNU General Public License. It is a partial fork of ntfsprogs and is under active maintenance and development.

In computer operating systems, union mounting is a way of combining multiple directories into one that appears to contain their combined contents. Union mounting is supported in Linux, BSD and several of its successors, and Plan 9, with similar but subtly different behavior.

aufs implements a union mount for Linux file systems. The name originally stood for AnotherUnionFS until version 2.

eCryptfs is a package of disk encryption software for Linux. Its implementation is a POSIX-compliant filesystem-level encryption layer, aiming to offer functionality similar to that of GnuPG at the operating system level, and has been part of the Linux kernel since version 2.6.19.

<span class="mw-page-title-main">OpenZFS</span> Open-source implementation of the ZFS file system

OpenZFS is an open-source implementation of the ZFS file system and volume manager initially developed by Sun Microsystems for the Solaris operating system and now maintained by the OpenZFS Project. It supports features like data compression, data deduplication, copy-on-write clones, snapshots, and RAID-Z. It also supports the creation of virtual devices, which allows for the creation of file systems that span multiple disks.

In computing, OverlayFS is a union mount filesystem implementation for Linux. It combines multiple different underlying mount points into one, resulting in single directory structure that contains underlying files and sub-directories from all sources. Common applications overlay a read/write partition over a read-only partition, such as with LiveCDs and IoT devices with limited flash memory write cycles.

References

  1. Wright, Charles P.; Zadok, Erez (December 2004). "Kernel Korner: Unionfs: Bringing Filesystems Together". Linux Journal. 2004 (128): 8. ISSN   1075-3583.
  2. "Git server of File systems and Storage Lab". Stony Brook University. Archived from the original on 17 June 2016. Retrieved 17 July 2017. Project: unionfs-3.9.y.git; Owner: Erez Zadok
  3. "File systems and Storage Lab: CS Department". Stony Brook University. Lab Coordinator and Principal Investigator: Prof. Erez Zadok
  4. Schulz, Werner P. (15 December 2016). "Hard drive Installation: UNIONFS". Knoppix . Retrieved 17 July 2017.
  5. "Docker overview: Union file systems". Docker, Inc. 13 July 2017. Retrieved 17 July 2017.
  6. Georgopoulos, Alkis (24 December 2010). "UbuntuLTSP/LTSPWithoutNFS" . Retrieved 17 July 2017.
  7. "aufs Homepage". 2 July 2017. Retrieved 17 July 2017.
  8. Torvalds, Linus (26 October 2014). "overlayfs merge + leak fix for d_splice_alias() failure exits" . Retrieved 17 July 2017.
  9. Corbet, Jonathan (15 June 2011). "Debating overlayfs" . Retrieved 17 July 2017.
  10. Podgorny, Radek (21 November 2016). "unionfs-fuse – A userspace unionfs implementation". GitHub . Retrieved 17 July 2017.
  11. Pendry, Jan-Simon; McKusick, Marshall Kirk (January 1995). "Union Mounts in 4.4BSD-Lite". USENIX 1995 Technical Conference Proceedings. Retrieved 17 July 2017.
  12. Schwinge, Thomas (26 February 2014). "unionfs". GNU Hurd . Retrieved 17 July 2017.
  13. "trapexit/mergerfs". GitHub. Retrieved 21 October 2018.
  14. Sun/Release 3.0. Vol. 1. Interleaf Technical Publishing. 1988. pp. 15‑1–18, 16‑1–19.
  15. Imran, Awais (19 June 2011). "Comex Working on Faster Jailbreaking Process for JailbreakMe 3.0; iPad 2 Jailbreak Coming Soon!". Redmond Pie. Retrieved 17 July 2017.