Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Filesystem Hierarchy Standard
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== FHS compliance == Most [[Linux distribution]]s follow the Filesystem Hierarchy Standard and declare it their own policy to maintain FHS compliance.<ref>[[Red Hat]] reference guide on [https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html-single/Storage_Administration_Guide/index.html#s1-filesystem-fhs file system structure].</ref><ref>[[SuSE Linux]] Enterprise Server Administration, Novell authorized courseware, by Jason W. Eckert, Novell; Course Technology, 2006; {{ISBN|1-4188-3731-8}}, {{ISBN|978-1-4188-3731-0}}.</ref><ref>[[Debian]] policy on [https://www.debian.org/doc/debian-policy/#file-system-hierarchy FHS compliance].</ref><ref>[[Ubuntu]] [https://help.ubuntu.com/community/LinuxFilesystemTreeOverview Linux File system Tree Overview]{{snd}} Community Ubuntu Documentation.</ref> [[GoboLinux]]<ref>{{cite web | title = The Unix tree rethought: an introduction to GoboLinux | url = http://www.gobolinux.org/?page=k5 | author = Hisham Muhammad | date = 9 May 2003 | access-date = 2016-10-04}}</ref> and [[NixOS]]<ref>{{cite conference |last1=Dolstra |first1=E. |last2=LΓΆh |first2=A. |url=https://nixos.org/~eelco/pubs/nixos-icfp2008-final.pdf |title=NixOS: A Purely Functional Linux Distribution |conference-url=http://www.icfpconference.org/icfp2008/ |conference=ICFP 2008: 13th ACM SIGPLAN International Conference on Functional Programming |pages=367β378 |location=Victoria, British Columbia, Canada |date=September 2008}}</ref> provide examples of intentionally non-compliant filesystem implementations. Some distributions generally follow the standard but deviate from it in some areas. The FHS is a "trailing standard", and so documents common practices at a point in time. Of course, times change, and distribution goals and needs call for experimentation. Some common deviations include: * Modern Linux distributions include a <code>/sys</code> directory as a [[virtual filesystem]] ([[sysfs]], comparable to <code>/proc</code>, which is a [[procfs]]), which stores and allows modification of the devices connected to the system,<ref>{{cite web |title=5.3 About the /sys Virtual File System |url=http://docs.oracle.com/cd/E37670_01/E41138/html/ol_sysfs.html |website=docs.oracle.com |publisher=Oracle |access-date=8 July 2016 |archive-url=https://web.archive.org/web/20160708193213/https://docs.oracle.com/cd/E37670_01/E41138/html/ol_sysfs.html |archive-date=8 July 2016}}</ref> whereas many traditional [[Unix-like]] operating systems use <code>/sys</code> as a [[symbolic link]] to the [[Kernel (operating system)|kernel]] source tree.<ref>{{cite book |last1=Lehey |first1=Greg |title=The Complete FreeBSD: Documentation from the Source |date=May 2003 |publisher=O'Reilly Media, Incorporated |isbn=9780596005160 |pages=188, 609 |edition=Fourth |url=https://books.google.com/books?id=7Y5kfaRmtKUC}}</ref> * Many modern Unix-like systems (such as [[FreeBSD]] and [[OpenBSD]]) via their [[Ports collection|ports systems]] install third-party packages into <code>/usr/local</code>, while keeping code considered part of the operating system in <code>/usr</code>. * Some Linux distributions no longer differentiate between <code>/lib</code> and <code>/usr/lib</code> and have <code>/lib</code> symlinked to <code>/usr/lib</code>.<ref>{{cite web |author1=Allan McRae |title=Arch Linux β News: The /lib directory becomes a symlink |url=https://www.archlinux.org/news/the-lib-directory-becomes-a-symlink/ |website=archlinux.org |access-date=14 December 2019 |archive-url=https://web.archive.org/web/20140909234433/https://www.archlinux.org/news/the-lib-directory-becomes-a-symlink/ |archive-date=9 September 2014 |url-status=live}}</ref> * Some Linux distributions no longer differentiate between <code>/bin</code> and <code>/usr/bin</code> and between <code>/sbin</code> and <code>/usr/sbin</code>. They may symlink <code>/bin</code> to <code>/usr/bin</code> and <code>/sbin</code> to <code>/usr/sbin</code>. Other distributions choose to consolidate all four, symlinking them to <code>/usr/bin</code>.<ref>{{cite web |author1=Allan McRae |title=Arch Linux β News: Binaries move to /usr/bin requiring update intervention |url=https://www.archlinux.org/news/binaries-move-to-usrbin-requiring-update-intervention/ |website=archlinux.org |access-date=15 December 2019 |archive-url=https://web.archive.org/web/20140910093202/https://www.archlinux.org/news/binaries-move-to-usrbin-requiring-update-intervention/ |archive-date=10 September 2014 |url-status=live}}</ref> Modern Linux distributions include a <code>/run</code> directory as a [[temporary filesystem]] ([[tmpfs]]), which stores volatile runtime data, following the FHS version 3.0. According to the FHS version 2.3, such data were stored in <code>/var/run</code>, but this was a problem in some cases because this directory is not always available at early boot. As a result, these programs have had to resort to trickery, such as using <code>/dev/.udev</code>, <code>/dev/.mdadm</code>, <code>/dev/.systemd</code> or <code>/dev/.mount</code> directories, even though the device directory is not intended for such data.<ref>{{cite mailing list |url=https://www.mail-archive.com/devel@lists.fedoraproject.org/msg23576.html |title=What's this /run directory doing on my system and where does it come from? |author=Lennart Poettering |date=30 March 2011 |mailing-list=devel@lists.fedoraproject.org}}</ref> Among other advantages, this makes the system easier to use normally with the root filesystem mounted read-only. For example, below are the changes [[Debian]] made in its 2013 Wheezy release:<ref>{{cite web |url=http://wiki.debian.org/ReleaseGoals/RunDirectory |title=ReleaseGoalsRunDirectory |website=Debian Wiki}}</ref> * <code>/dev/.*</code> β <code>/run/*</code> * <code>/dev/shm</code> β <code>/run/shm</code> * <code>/dev/shm/*</code> β <code>/run/*</code> * <code>/etc/*</code> (writeable files) β <code>/run/* </code> * <code>/lib/init/rw</code> β <code>/run</code> * <code>/var/lock</code> β <code>/run/lock</code> * <code>/var/run</code> β <code>/run</code> * <code>/tmp</code> β <code>/run/tmp</code>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)