OverlayFS
{{short description|Linux filesystem}}
{{Infobox filesystem
| name = OverlayFS
| full_name = Overlay File System
| developer = Miklos Szeredi, open-source community
| introduction_os =
| introduction_date =
| partition_id =
| directory_struct =
| file_struct =
| bad_blocks_struct =
| max_filename_size =
| max_files_no =
| max_volume_size =
| max_file_size =
| filename_character_set =
| dates_recorded =
| date_range =
| date_resolution =
| forks_streams =
| attributes =
| file_system_permissions = POSIX
| compression =
| encryption =
| OS = Linux, FreeBSD and NetBSD{{cn|date=August 2024|reason=see Talk:OverlayFS#BSD?}}
}}
OverlayFS is a union mount filesystem implementation for Linux. It combines multiple different underlying mount points into one, resulting in a 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.
History
The need and specification of a kernel mode Linux union mount filesystem was identified in late 2009.{{Cite web
| title = Unioning file systems: Architecture, features, and design choices
| last = Aurora
| first = Valerie
| website = LWN.net
| date = March 18, 2009
| access-date = 2018-01-17
| url = https://lwn.net/Articles/324291/
}} The initial RFC patchset of OverlayFS was submitted by Miklos Szeredi in 2010.{{Cite web
| title = Another union filesystem approach
| last = Edge
| first = Jake
| website = LWN.net
| date = September 1, 2010
| access-date = 2018-01-17
| url = https://lwn.net/Articles/403012/
}} By 2011, OpenWrt had already adopted it for their use.{{Cite web
| title = Debating overlayfs
| last = Corbet
| first = Jonathan
| website = LWN.net
| date = June 15, 2011
| access-date = 2018-01-17
| url = https://lwn.net/Articles/447650/
}}
It was merged into the Linux kernel mainline in 2014, in kernel version 3.18.{{cite web | url= https://github.com/torvalds/linux/commit/e9be9d5e76e34872f0c37d72e25bc27fe9e2c54c | title= OverlayFS commit to Linux| website= GitHub}}{{cite web | url= https://www.phoronix.com/scan.php?page=news_item&px=MTc5OTc | title= OverlayFS Proposed For The Linux 3.18 Kernel}} It was improved in version 4.0, bringing improvements necessary for e.g. the {{mono|overlay2}} storage driver in Docker.{{Cite news|url=https://docs.docker.com/engine/userguide/storagedriver/selectadriver/|title=Select a storage driver - Docker|date=2016-12-06|work=archive.is|access-date=2017-06-05|url-status=bot: unknown|archive-url=https://archive.today/20161206132431/https://docs.docker.com/engine/userguide/storagedriver/selectadriver/|archive-date=2016-12-06}}
While most Live CD linux distributions used Aufs as of November 2016, Slackware used overlayfs for its live CD.{{Cite web|url=http://docs.slackware.com/slackware:liveslak|title=slackware:liveslak - SlackDocs|website=docs.slackware.com|language=en|access-date=2017-06-05}}
Implementation
Here is an example of usage of OverlayFS, as part of {{mono|profile-sync-daemon}} for web browser profiles.
Filesystem 1024-blocks Used Available Capacity Mounted on
overlaid 337284 274960 62324 82% /run/user/1000/psd/vulcansphere-chromium
overlaid 337284 274960 62324 82% /run/user/1000/psd/vulcansphere-firefox-fwl7ugb8.default
overlaid 337284 274960 62324 82% /run/user/1000/psd/vulcansphere-firefox-17y0wmxk.default-release
The main mechanics of OverlayFS relate to the merging of directory access when both filesystems present a directory for the same name. Otherwise, OverlayFS presents the object, if any, yielded by one or the other, with the "upper" filesystem taking precedence. Unlike some other overlay filesystems, the directory subtrees being merged by OverlayFS do not necessarily have to be from distinct filesystems.{{cite web
|url= https://www.kernel.org/doc/html/latest/filesystems/overlayfs.html?highlight=overlayfs
|title=OverlayFS documentation|publisher= kernel.org
}}
OverlayFS supports whiteouts and opaque directories in the upper filesystem to allow file and directory deletion.
OverlayFS does not support renaming files without performing a full copy-up of the file; however, renaming directories in an upper filesystem has limited support.
OverlayFS does not support merging changes from an upper filesystem to a lower filesystem.
See also
References
{{reflist}}
External links
- [https://www.kernel.org/doc/html/latest/filesystems/overlayfs.html?highlight=overlayfs OverlayFS documentation]
{{File systems}}
{{Linux}}
{{Linux kernel}}
Category:Free special-purpose file systems
Category:Linux kernel features
Category:Special-purpose file systems supported by the Linux kernel