博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Union Mount
阅读量:4031 次
发布时间:2019-05-24

本文共 4630 字,大约阅读时间需要 15 分钟。

Union mount

From Wikipedia, the free encyclopedia

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

As an example application of union mounting, consider the need to update the information contained on a or . While a CD-ROM is not writable, one can overlay the CD's with a writable directory in a union mount. Then, updating files in the union directory will cause them to end up in the writable directory, giving the illusion that the CD-ROM's contents have been updated.

Contents

Implementations

Plan 9

Main article:

In the Plan 9 operating system from (mid-1980s onward), union mounting is a central concept, replacing several older conventions with union directories; for example, several directories containing , unioned together at a single /bin directory, replace the PATH variable for command lookup in the shell.

Plan 9 union semantics are greatly simplified compared to the implementations for -style operating systems: the union of two directories is simply the concatenation of their contents, so a directory listing of the union may display duplicate names. Also, no effort is made to recursively merge subdirectories, leading to an extremely simple implementation. Directories are unioned in a controllable order; u/name, where u is a union directory, denotes the file called name in the first constituent directory that contains such a file.

Unix and BSD

Unix/POSIX implementations of unions have different requirements from the Plan 9 implementation due to constraints in the traditional Unix file system behavior, which greatly complicates their implementation and often leads to compromises. Problems that union mounting on Unix-like operating systems encounters include:

  • Duplicate file names within a directory are not acceptable, since this would break applications' expectations of how a Unix file system works. Putting a logical, -like precedence ordering on the union's constituents partially solves this problem, but requires memory to record which files need to be skipped over during a directory listing (which is otherwise a nearly stateless operation).
  • Deletion requires special support: if files with the same name exists in several of the union directory's constituents, simply deleting it from one of the constituents causes a file from one of the others to reappear in its stead.
  • Insertion of a directory into the stack can cause incoherency in the 's file name cache.
  • Renaming a file within a single mounted file system (using the rename system call) should be an , but renaming within a union mount can require changes to multiple of the union's constituent directories. A possible solution is to disallow rename in such situations and require implementations to copy-and-delete instead.
  • Stable numbers for files, and () are hard to implement correctly.

Early attempts to add unioning to Unix filesystems included the 3-d filesystem (), the Translucent File Service in , (, 1988) An implementation of union mounting was added to the BSD version of Unix in version (1994), taking inspiration from these earlier attempts, Plan 9 and the stackable file systems in (Sun, 1994). 4.4BSD implements the stack-of-directories approach outlined above. Like in Plan 9, operations traverse this stack top-down to resolve names, but unlike in Plan 9, BSD union mounts are recursive, so that the contents of subdirectories appear merged in the union directory. Also unlike in the Plan 9 version, all layers except the top are read-only: modifying files in the union causes their contents to first be copied into the top layer of the stack, where the modifications are then applied. Deletion of files is implemented by writing a called a whiteout to the top directory, which has the effect of marking the file name as non-existent and hiding files with the same name in the lower layers of the stack. Whiteouts require support from the underlying file system.

Linux

Union mounting was implemented for Linux 0.99 in 1993; this initial implementation was called the Inheriting File System, but was abandoned by its developer because of its complexity. The next major implementation was , which grew out of the project at . An attempt to replace UnionFS, , was released in 2006, followed in 2009 by . Only in 2014 was this last union mount implementation added to the standard source code.

Similarly, offers a possibility to mount different filesystems distributed across a network, rather than being located on the same machine.

转载地址:http://snhbi.baihongyu.com/

你可能感兴趣的文章
Promise的基本使用
查看>>
android给文字加边框(修改不能居中的问题)
查看>>
coursesa课程 Python 3 programming 统计文件有多少单词
查看>>
coursesa课程 Python 3 programming 输出每一行句子的第三个单词
查看>>
coursesa课程 Python 3 programming Dictionary methods 字典的方法
查看>>
Returning a value from a function
查看>>
coursesa课程 Python 3 programming Functions can call other functions 函数调用另一个函数
查看>>
coursesa课程 Python 3 programming The while Statement
查看>>
course_2_assessment_6
查看>>
coursesa课程 Python 3 programming course_2_assessment_7 多参数函数练习题
查看>>
coursesa课程 Python 3 programming course_2_assessment_8 sorted练习题
查看>>
visca接口转RS-232C接口线序
查看>>
在unity中建立最小的shader(Minimal Shader)
查看>>
1.3 Debugging of Shaders (调试着色器)
查看>>
关于phpcms中模块_tag.class.php中的pc_tag()方法的含义
查看>>
vsftp 配置具有匿名登录也有系统用户登录,系统用户有管理权限,匿名只有下载权限。
查看>>
linux安装usb wifi接收器
查看>>
终于搞定CString和string之间转换的问题了
查看>>
用防火墙自动拦截攻击IP
查看>>
补充自动屏蔽攻击ip
查看>>