UnionFS
Encyclopedia
UnionFS is a filesystem service for Linux
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

, FreeBSD
FreeBSD
FreeBSD is a free Unix-like operating system descended from AT&T UNIX via BSD UNIX. Although for legal reasons FreeBSD cannot be called “UNIX”, as the direct descendant of BSD UNIX , FreeBSD’s internals and system APIs are UNIX-compliant...

 and NetBSD
NetBSD
NetBSD is a freely available open source version of the Berkeley Software Distribution Unix operating system. It was the second open source BSD descendant to be formally released, after 386BSD, and continues to be actively developed. The NetBSD project is primarily focused on high quality design,...

 which implements a union mount
Union mount
A union mount is a mount that allows several filesystems to be mounted at one time, appearing to be one filesystem.Rather than mounting each filesystem at a different place in the directory hierarchy, a union mount overlays the filesystems, creating a unified hierarchy...

 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.

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 both read-only and 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 writeable, but without actually allowing writes to change the file system, also known as copy-on-write
Copy-on-write
Copy-on-write is an optimization strategy used in computer programming. The fundamental idea is that if multiple callers ask for resources which are initially indistinguishable, they can all be given pointers to the same resource...

. This may be desirable when the media is physically read-only, such as in the case of Live CD
Live CD
A live CD, live DVD, or live disc is a CD or DVD containing a bootable computer operating system. Live CDs are unique in that they have the ability to run a complete, modern operating system on a computer lacking mutable secondary storage, such as a hard disk drive...

s.

Uses

In Knoppix
Knoppix
Knoppix, or KNOPPIX , is an operating system based on Debian designed to be run directly from a CD / DVD or a USB key , one of the first of its kind for any operating system. Knoppix was developed by Linux consultant Klaus Knopper. When starting a program, it is loaded from the removable medium...

, a union between the file system on the CD-ROM
CD-ROM
A CD-ROM is a pre-pressed compact disc that contains data accessible to, but not writable by, a computer for data storage and music playback. The 1985 “Yellow Book” standard developed by Sony and Philips adapted the format to hold any form of binary data....

 or DVD
DVD
A DVD is an optical disc storage media format, invented and developed by Philips, Sony, Toshiba, and Panasonic in 1995. DVDs offer higher storage capacity than Compact Discs while having the same dimensions....

 and a file system contained in an image file called knoppix.img 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.

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 snapshot
Snapshot (computer storage)
In computer systems, a snapshot is the state of a system at a particular point in time. The term was coined as an analogy to that in photography. It can refer to an actual copy of the state of a system or to a capability provided by certain systems....

ting system.

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. Version 2.x is the smallest implementation of unioning for Linux, it is heavily tested and inspected by many kernel developers, and it is more efficient.

aufs
Aufs
aufs implements a union mount for Linux file systems.Developed by Junjiro Okajima in 2006 aufs is a complete rewriting of the earlier UnionFS...

 is an alternative version of unionfs, which began as a unionfs fork but became a different project. aufs version 1 is no longer maintained, since aufs2 is available.

UnionFsFuse is an independent project, implemented as an user space filesystem
Filesystem in Userspace
Filesystem in Userspace is a loadable kernel module for Unix-like computer operating systems that lets non-privileged users create their own file systems without editing kernel code...

 program, instead of a kernel module or patch. Like UnionFS, it supports copy-on-write and read-only or read-write branches.

Plan 9 from Bell Labs
Plan 9 from Bell Labs
Plan 9 from Bell Labs is a distributed operating system. It was developed primarily for research purposes as the successor to Unix by the Computing Sciences Research Center at Bell Labs between the mid-1980s and 2002...

 operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...

 uses union mount
Union mount
A union mount is a mount that allows several filesystems to be mounted at one time, appearing to be one filesystem.Rather than mounting each filesystem at a different place in the directory hierarchy, a union mount overlays the filesystems, creating a unified hierarchy...

s extensively to build custom namespaces
Namespace (computer science)
A namespace is an abstract container or environment created to hold a logical grouping of unique identifiers or symbols . An identifier defined in a namespace is associated only with that namespace. The same identifier can be independently defined in multiple namespaces...

 per user/processes. The same concept, implemented as "union mount
Union mount
A union mount is a mount that allows several filesystems to be mounted at one time, appearing to be one filesystem.Rather than mounting each filesystem at a different place in the directory hierarchy, a union mount overlays the filesystems, creating a unified hierarchy...

", has also been available in BSD
Berkeley Software Distribution
Berkeley Software Distribution is a Unix operating system derivative developed and distributed by the Computer Systems Research Group of the University of California, Berkeley, from 1977 to 1995...

, since at least 1995.

The GNU Hurd
GNU Hurd
GNU Hurd is a free software Unix-like replacement for the Unix kernel, released under the GNU General Public License. It has been under development since 1990 by the GNU Project of the Free Software Foundation...

 has UnionFS. As of January 2008, it works, but results in a read-only mountpoint.

mhddfs works like UnionFS but permits balancing files over drives with the most free space available.

Sun Microsystems
Sun Microsystems
Sun Microsystems, Inc. was a company that sold :computers, computer components, :computer software, and :information technology services. Sun was founded on February 24, 1982...

 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
SunOS
SunOS is a version of the Unix operating system developed by Sun Microsystems for their workstation and server computer systems. The SunOS name is usually only used to refer to versions 1.0 to 4.1.4 of SunOS...

 3, circa 1986.

JailbreakMe
JailbreakMe
JailbreakMe is a series of jailbreaks for Apple's iOS mobile operating system that take advantage of flaws in the Safari browser on the device, providing an immediate one-step jailbreak unlike more common jailbreaks, such as Blackra1n and redsn0w, that require plugging the device into another...

 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.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK