http://www.funtoo.org/index.php?title=The_Root_Filesystem&feed=atom&action=historyThe Root Filesystem - Revision history2015-08-03T00:32:33ZRevision history for this page on the wikiMediaWiki 1.25.1http://www.funtoo.org/index.php?title=The_Root_Filesystem&diff=474&oldid=prevMaaatt: Fixed the formatting on the "Specific Options" table (it was displaying all in one line)2014-01-15T19:04:03Z<p>Fixed the formatting on the &quot;Specific Options&quot; table (it was displaying all in one line)</p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 19:04, January 15, 2014</td>
</tr><tr><td colspan="2" class="diff-lineno" id="L67" >Line 67:</td>
<td colspan="2" class="diff-lineno">Line 67:</td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>The following directories, or symbolic links to directories, must be in /, if the corresponding subsystem is installed:</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>The following directories, or symbolic links to directories, must be in /, if the corresponding subsystem is installed:</div></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Directory Description</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">{|</ins></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>home User home directories (optional)</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">|-</ins></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>lib&lt;qual&gt; Alternate format essential shared libraries (optional)</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">!</ins>Directory<ins class="diffchange diffchange-inline">!!</ins>Description</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>root Home directory for the root user (optional)</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">|-</ins></div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">|</ins>home<ins class="diffchange diffchange-inline">||</ins>User home directories (optional)</div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">|-</ins></div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">|</ins>lib&lt;qual&gt;<ins class="diffchange diffchange-inline">||</ins>Alternate format essential shared libraries (optional)</div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">|-</ins></div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">|</ins>root<ins class="diffchange diffchange-inline">||</ins>Home directory for the root user (optional)</div></td></tr>
<tr><td colspan="2">&#160;</td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">|}</ins></div></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Each directory listed above is specified in detail in separate subsections below.</div></td><td class='diff-marker'>&#160;</td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Each directory listed above is specified in detail in separate subsections below.</div></td></tr>
</table>Maaatthttp://www.funtoo.org/index.php?title=The_Root_Filesystem&diff=473&oldid=prevBrantgurga: Split out the root filesystem section into its own page.2010-11-07T05:05:38Z<p>Split out the root filesystem section into its own page.</p>
<p><b>New page</b></p><div>The contents of the root filesystem must be adequate to boot, restore, recover, and/or repair the system.<br />
<br />
* To boot a system, enough must be present on the root partition to mount other filesystems. This includes utilities, configuration, boot loader information, and other essential start-up data. /usr, /opt, and /var are designed such that they may be located on other partitions or filesystems.<br />
* To enable recovery and/or repair of a system, those utilities needed by an experienced maintainer to diagnose and reconstruct a damaged system must be present on the root filesystem.<br />
* To restore a system, those utilities needed to restore from system backups (on floppy, tape, etc.) must be present on the root filesystem.<br />
<br />
Tip Rationale<br />
<br />
<br />
The primary concern used to balance these considerations, which favor placing many things on the root filesystem, is the goal of keeping root as small as reasonably possible. For several reasons, it is desirable to keep the root filesystem small:<br />
<br />
* It is occasionally mounted from very small media.<br />
* The root filesystem contains many system-specific configuration files. Possible examples include a kernel that is specific to the system, a specific hostname, etc. This means that the root filesystem isn't always shareable between networked systems. Keeping it small on servers in networked systems minimizes the amount of lost space for areas of unshareable files. It also allows workstations with smaller local hard drives.<br />
* While you may have the root filesystem on a large partition, and may be able to fill it to your heart's content, there will be people with smaller partitions. If you have more files installed, you may find incompatibilities with other systems using root filesystems on smaller partitions. If you are a developer then you may be turning your assumption into a problem for a large number of users.<br />
* Disk errors that corrupt data on the root filesystem are a greater problem than errors on any other partition. A small root filesystem is less prone to corruption as the result of a system crash.<br />
<br />
Applications must never create or require special files or subdirectories in the root directory. Other locations in the FHS hierarchy provide more than enough flexibility for any package.<br />
<br />
Tip Rationale<br />
<br />
<br />
There are several reasons why creating a new subdirectory of the root filesystem is prohibited:<br />
<br />
* It demands space on a root partition which the system administrator may want kept small and simple for either performance or security reasons.<br />
* It evades whatever discipline the system administrator may have set up for distributing standard file hierarchies across mountable volumes.<br />
<br />
Distributions should not create new directories in the root hierarchy without extremely careful consideration of the consequences including for application portability.<br />
<br />
== Requirements ==<br />
<br />
The following directories, or symbolic links to directories, are required in /.<br />
<br />
{|<br />
|-<br />
!Directory!!Description<br />
|-<br />
|bin||Essential command binaries<br />
|-<br />
|boot||Static files of the boot loader<br />
|-<br />
|dev||Device files<br />
|-<br />
|etc||Host-specific system configuration<br />
|-<br />
|lib||Essential shared libraries and kernel modules<br />
|-<br />
|media||Mount point for removeable media<br />
|-<br />
|mnt||Mount point for mounting a filesystem temporarily<br />
|-<br />
|opt||Add-on application software packages<br />
|-<br />
|sbin||Essential system binaries<br />
|-<br />
|srv||Data for services provided by this system<br />
|-<br />
|tmp||Temporary files<br />
|-<br />
|usr||Secondary hierarchy<br />
|-<br />
|var||Variable data<br />
|}<br />
<br />
Each directory listed above is specified in detail in separate subsections below. /usr and /var each have a complete section in this document due to the complexity of those directories.<br />
== Specific Options ==<br />
<br />
The following directories, or symbolic links to directories, must be in /, if the corresponding subsystem is installed:<br />
<br />
Directory Description<br />
home User home directories (optional)<br />
lib&lt;qual&gt; Alternate format essential shared libraries (optional)<br />
root Home directory for the root user (optional)<br />
<br />
Each directory listed above is specified in detail in separate subsections below.<br />
== /bin : Essential user command binaries (for use by all users) ==<br />
/bin contains commands that may be used by both the system administrator and by users, but which are required when no other filesystems are mounted (e.g. in single user mode). It may also contain commands which are used indirectly by scripts. &lt;ref&gt;Command binaries that are not essential enough to place into /bin must be placed in /usr/bin, instead. Items that are required only by non-root users (the X Window System, chsh, etc.) are generally not essential enough to be placed into the root partition.&lt;/ref&gt;<br />
<br />
=== Requirements ===<br />
<br />
There must be no subdirectories in /bin.<br />
<br />
The following commands, or symbolic links to commands, are required in /bin.<br />
<br />
Command Description<br />
cat Utility to concatenate files to standard output<br />
chgrp Utility to change file group ownership<br />
chmod Utility to change file access permissions<br />
chown Utility to change file owner and group<br />
cp Utility to copy files and directories<br />
date Utility to print or set the system data and time<br />
dd Utility to convert and copy a file<br />
df Utility to report filesystem disk space usage<br />
dmesg Utility to print or control the kernel message buffer<br />
echo Utility to display a line of text<br />
false Utility to do nothing, unsuccessfully<br />
hostname Utility to show or set the system's host name<br />
kill Utility to send signals to processes<br />
ln Utility to make links between files<br />
login Utility to begin a session on the system<br />
ls Utility to list directory contents<br />
mkdir Utility to make directories<br />
mknod Utility to make block or character special files<br />
more Utility to page through text<br />
mount Utility to mount a filesystem<br />
mv Utility to move/rename files<br />
ps Utility to report process status<br />
pwd Utility to print name of current working directory<br />
rm Utility to remove files or directories<br />
rmdir Utility to remove empty directories<br />
sed The `sed' stream editor<br />
sh The Bourne command shell<br />
stty Utility to change and print terminal line settings<br />
su Utility to change user ID<br />
sync Utility to flush filesystem buffers<br />
true Utility to do nothing, successfully<br />
umount Utility to unmount file systems<br />
uname Utility to print system information<br />
<br />
If /bin/sh is not a true Bourne shell, it must be a hard or symbolic link to the real shell command.<br />
<br />
The [ and test commands must be placed together in either /bin or /usr/bin.<br />
<br />
Tip Rationale<br />
<br />
<br />
For example bash behaves differently when called as sh or bash. The use of a symbolic link also allows users to easily see that /bin/sh is not a true Bourne shell.<br />
<br />
The requirement for the [ and test commands to be included as binaries (even if implemented internally by the shell) is shared with the POSIX.2 standard.<br />
=== Specific Options ===<br />
<br />
The following programs, or symbolic links to programs, must be in /bin if the corresponding subsystem is installed:<br />
<br />
Command Description<br />
csh The C shell (optional)<br />
ed The `ed' editor (optional)<br />
tar The tar archiving utility (optional)<br />
cpio The cpio archiving utility (optional)<br />
gzip The GNU compression utility (optional)<br />
gunzip The GNU uncompression utility (optional)<br />
zcat The GNU uncompression utility (optional)<br />
netstat The network statistics utility (optional)<br />
ping The ICMP network test utility (optional)<br />
<br />
If the gunzip and zcat programs exist, they must be symbolic or hard links to gzip. /bin/csh may be a symbolic link to /bin/tcsh or /usr/bin/tcsh.<br />
<br />
Tip Rationale<br />
<br />
<br />
The tar, gzip and cpio commands have been added to make restoration of a system possible (provided that / is intact).<br />
<br />
Conversely, if no restoration from the root partition is ever expected, then these binaries might be omitted (e.g., a ROM chip root, mounting /usr through NFS). If restoration of a system is planned through the network, then ftp or tftp (along with everything necessary to get an ftp connection) must be available on the root partition.<br />
== /boot : Static files of the boot loader ==<br />
This directory contains everything required for the boot process except configuration files not needed at boot time and the map installer. Thus /boot stores data that is used before the kernel begins executing user-mode programs. This may include saved master boot sectors and sector map files. &lt;ref&gt;Programs necessary to arrange for the boot loader to be able to boot a file must be placed in /sbin. Configuration files for boot loaders must be placed in /etc.<br />
<br />
The GRUB bootloader reads its configurations file before booting, so that must be placed in /boot. However, it is a configuration file, so should be in /etc. The answer here is a symbolic link such as /etc/grub/menu.lst -&gt; /boot/menu.lst.&lt;/ref&gt;<br />
<br />
=== Specific Options ===<br />
<br />
The operating system kernel must be located in either / or /boot. &lt;ref&gt;On some i386 machines, it may be necessary for /boot to be located on a separate partition located completely below cylinder 1024 of the boot device due to hardware constraints.<br />
<br />
Certain MIPS systems require a /boot partition that is a mounted MS-DOS filesystem or whatever other filesystem type is accessible for the firmware. This may result in restrictions with respect to usable filenames within /boot (only for affected systems).&lt;/ref&gt;<br />
== /dev : Device files ==<br />
<br />
The /dev directory is the location of special or device files.<br />
=== Specific Options ===<br />
<br />
If it is possible that devices in /dev will need to be manually created, /dev must contain a command named MAKEDEV, which can create devices as needed. It may also contain a MAKEDEV.local for any local devices.<br />
<br />
If required, MAKEDEV must have provisions for creating any device that may be found on the system, not just those that a particular implementation installs.<br />
== /etc : Host-specific system configuration ==<br />
<br />
The /etc hierarchy contains configuration files. A &quot;configuration file&quot; is a local file used to control the operation of a program; it must be static and cannot be an executable binary. &lt;ref&gt;The setup of command scripts invoked at boot time may resemble System V, BSD or other models. Further specification in this area may be added to a future version of this standard.&lt;/ref&gt;<br />
=== Requirements ===<br />
<br />
No binaries may be located under /etc. &lt;ref&gt;It is recommended that files be stored in subdirectories of /etc rather than directly in /etc.&lt;/ref&gt;<br />
<br />
The following directories, or symbolic links to directories are required in /etc:<br />
{|<br />
!Directory||Description<br />
|+<br />
|opt||Configuration for /opt<br />
|+<br />
|X11||Configuration for the X Window system (optional)<br />
|+<br />
|sgml||Configuration for SGML (optional)<br />
|+<br />
|xml||Configuration for XML (optional)<br />
|}<br />
<br />
=== Specific Options ===<br />
<br />
The following directories, or symbolic links to directories must be in /etc, if the corresponding subsystem is installed:<br />
<br />
Directory Description<br />
opt Configuration for /opt<br />
<br />
The following files, or symbolic links to files, must be in /etc if the corresponding subsystem is installed: &lt;ref&gt;Systems that use the shadow password suite will have additional configuration files in /etc (/etc/shadow and others) and programs in /usr/sbin (useradd, usermod, and others).&lt;/ref&gt;<br />
<br />
File Description<br />
csh.login Systemwide initialization file for C shell logins (optional)<br />
exports NFS filesystem access control list (optional)<br />
fstab Static information about filesystems (optional)<br />
ftpusers FTP daemon user access control list (optional)<br />
gateways File which lists gateways for routed (optional)<br />
gettydefs Speed and terminal settings used by getty (optional)<br />
group User group file (optional)<br />
host.conf Resolver configuration file (optional)<br />
hosts Static information about host names (optional)<br />
hosts.allow Host access file for TCP wrappers (optional)<br />
hosts.deny Host access file for TCP wrappers (optional)<br />
hosts.equiv List of trusted hosts for rlogin, rsh, rcp (optional)<br />
hosts.lpd List of trusted hosts for lpd (optional)<br />
inetd.conf Configuration file for inetd (optional)<br />
inittab Configuration file for init (optional)<br />
issue Pre-login message and identification file (optional)<br />
ld.so.conf List of extra directories to search for shared libraries (optional)<br />
motd Post-login message of the day file (optional)<br />
mtab Dynamic information about filesystems (optional)<br />
mtools.conf Configuration file for mtools (optional)<br />
networks Static information about network names (optional)<br />
passwd The password file (optional)<br />
printcap The lpd printer capability database (optional)<br />
profile Systemwide initialization file for sh shell logins (optional)<br />
protocols IP protocol listing (optional)<br />
resolv.conf Resolver configuration file (optional)<br />
rpc RPC protocol listing (optional)<br />
securetty TTY access control for root login (optional)<br />
services Port names for network services (optional)<br />
shells Pathnames of valid login shells (optional)<br />
syslog.conf Configuration file for syslogd (optional)<br />
<br />
mtab does not fit the static nature of /etc: it is excepted for historical reasons. &lt;ref&gt;On some Linux systems, this may be a symbolic link to /proc/mounts, in which case this exception is not required.&lt;/ref&gt;<br />
=== /etc/opt : Configuration files for /opt ===<br />
<br />
Host-specific configuration files for add-on application software packages must be installed within the directory /etc/opt/&lt;subdir&gt;, where &lt;subdir&gt; is the name of the subtree in /opt where the static data from that package is stored.<br />
==== Requirements ====<br />
<br />
No structure is imposed on the internal arrangement of /etc/opt/&lt;subdir&gt;.<br />
<br />
If a configuration file must reside in a different location in order for the package or system to function properly, it may be placed in a location other than /etc/opt/&lt;subdir&gt;.<br />
<br />
Tip Rationale<br />
<br />
<br />
Refer to the rationale for /opt.<br />
=== /etc/X11 : Configuration for the X Window System (optional) ===<br />
<br />
/etc/X11 is the location for all X11 host-specific configuration. This directory is necessary to allow local control if /usr is mounted read only.<br />
==== Specific Options ====<br />
<br />
The following files, or symbolic links to files, must be in /etc/X11 if the corresponding subsystem is installed:<br />
<br />
File Description<br />
Xconfig The configuration file for early versions of XFree86 (optional)<br />
XF86Config The configuration file for XFree86 versions 3 and 4 (optional)<br />
Xmodmap Global X11 keyboard modification file (optional)<br />
<br />
Subdirectories of /etc/X11 may include those for xdm and for any other programs (some window managers, for example) that need them. &lt;ref&gt;/etc/X11/xdm holds the configuration files for xdm. These are most of the files previously found in /usr/lib/X11/xdm. Some local variable data for xdm is stored in /var/lib/xdm.&lt;/ref&gt; We recommend that window managers with only one configuration file which is a default .*wmrc file must name it system.*wmrc (unless there is a widely-accepted alternative name) and not use a subdirectory. Any window manager subdirectories must be identically named to the actual window manager binary.<br />
=== /etc/sgml : Configuration files for SGML (optional) ===<br />
<br />
Generic configuration files defining high-level parameters of the SGML systems are installed here. Files with names *.conf indicate generic configuration files. File with names *.cat are the DTD-specific centralized catalogs, containing references to all other catalogs needed to use the given DTD. The super catalog file catalog references all the centralized catalogs.<br />
/etc/xml : Configuration files for XML (optional)<br />
Purpose<br />
<br />
Generic configuration files defining high-level parameters of the XML systems are installed here. Files with names *.conf indicate generic configuration files. The super catalog file catalog references all the centralized catalogs.<br />
== /home : User home directories (optional) ==<br />
<br />
/home is a fairly standard concept, but it is clearly a site-specific filesystem. &lt;ref&gt;Different people prefer to place user accounts in a variety of places. This section describes only a suggested placement for user home directories; nevertheless we recommend that all FHS-compliant distributions use this as the default location for home directories.<br />
<br />
On small systems, each user's directory is typically one of the many subdirectories of /home such as /home/smith, /home/torvalds, /home/operator, etc. On large systems (especially when the /home directories are shared amongst many hosts using NFS) it is useful to subdivide user home directories. Subdivision may be accomplished by using subdirectories such as /home/staff, /home/guests, /home/students, etc.&lt;/ref&gt; The setup will differ from host to host. Therefore, no program should rely on this location. &lt;ref&gt;If you want to find out a user's home directory, you should use the getpwent(3) library function rather than relying on /etc/passwd because user information may be stored remotely using systems such as NIS.&lt;/ref&gt;<br />
=== Requirements ===<br />
<br />
User specific configuration files for applications are stored in the user's home directory in a file that starts with the '.' character (a &quot;dot file&quot;). If an application needs to create more than one dot file then they should be placed in a subdirectory with a name starting with a '.' character, (a &quot;dot directory&quot;). In this case the configuration files should not start with the '.' character. &lt;ref&gt;It is recommended that apart from autosave and lock files programs should refrain from creating non dot files or directories in a home directory without user intervention.&lt;/ref&gt;<br />
== /lib : Essential shared libraries and kernel modules ==<br />
<br />
The /lib directory contains those shared library images needed to boot the system and run the commands in the root filesystem, ie. by binaries in /bin and /sbin. &lt;ref&gt;Shared libraries that are only necessary for binaries in /usr (such as any X Window binaries) must not be in /lib. Only the shared libraries required to run binaries in /bin and /sbin may be here. In particular, the library libm.so.* may also be placed in /usr/lib if it is not required by anything in /bin or /sbin.&lt;/ref&gt;<br />
=== Requirements ===<br />
<br />
At least one of each of the following filename patterns are required (they may be files, or symbolic links):<br />
<br />
File Description<br />
libc.so.* The dynamically-linked C library (optional)<br />
ld* The execution time linker/loader (optional)<br />
<br />
If a C preprocessor is installed, /lib/cpp must be a reference to it, for historical reasons. &lt;ref&gt;The usual placement of this binary is /usr/bin/cpp.&lt;/ref&gt;<br />
=== Specific Options ===<br />
<br />
The following directories, or symbolic links to directories, must be in /lib, if the corresponding subsystem is installed:<br />
<br />
Directory Description<br />
modules Loadable kernel modules (optional)<br />
<br />
== /lib&lt;qual&gt; : Alternate format essential shared libraries (optional) ==<br />
<br />
There may be one or more variants of the /lib directory on systems which support more than one binary format requiring separate libraries. &lt;ref&gt;This is commonly used for 64-bit or 32-bit support on systems which support multiple binary formats, but require libraries of the same name. In this case, /lib32 and /lib64 might be the library directories, and /lib a symlink to one of them.&lt;/ref&gt;<br />
=== Requirements ===<br />
<br />
If one or more of these directories exist, the requirements for their contents are the same as the normal /lib directory, except that /lib&lt;qual&gt;/cpp is not required. &lt;ref&gt;/lib&lt;qual&gt;/cpp is still permitted: this allows the case where /lib and /lib&lt;qual&gt; are the same (one is a symbolic link to the other).&lt;/ref&gt;<br />
== /media : Mount point for removeable media ==<br />
<br />
This directory contains subdirectories which are used as mount points for removeable media such as floppy disks, cdroms and zip disks.<br />
<br />
Tip Rationale<br />
<br />
<br />
Historically there have been a number of other different places used to mount removeable media such as /cdrom, /mnt or /mnt/cdrom. Placing the mount points for all removeable media directly in the root directory would potentially result in a large number of extra directories in /. Although the use of subdirectories in /mnt as a mount point has recently been common, it conflicts with a much older tradition of using /mnt directly as a temporary mount point.<br />
=== Specific Options ===<br />
<br />
The following directories, or symbolic links to directories, must be in /media, if the corresponding subsystem is installed:<br />
<br />
Directory Description<br />
floppy Floppy drive (optional)<br />
cdrom CD-ROM drive (optional)<br />
cdrecorder CD writer (optional)<br />
zip Zip drive (optional)<br />
<br />
On systems where more than one device exists for mounting a certain type of media, mount directories can be created by appending a digit to the name of those available above starting with '0', but the unqualified name must also exist. &lt;ref&gt;A compliant implementation with two CDROM drives might have /media/cdrom0 and /media/cdrom1 with /media/cdrom a symlink to either of these.&lt;/ref&gt;<br />
== /mnt : Mount point for a temporarily mounted filesystem ==<br />
<br />
This directory is provided so that the system administrator may temporarily mount a filesystem as needed. The content of this directory is a local issue and should not affect the manner in which any program is run.<br />
<br />
This directory must not be used by installation programs: a suitable temporary directory not in use by the system must be used instead.<br />
== /opt : Add-on application software packages ==<br />
<br />
/opt is reserved for the installation of add-on application software packages.<br />
<br />
A package to be installed in /opt must locate its static files in a separate /opt/&lt;package&gt; or /opt/&lt;provider&gt; directory tree, where &lt;package&gt; is a name that describes the software package and &lt;provider&gt; is the provider's LANANA registered name.<br />
=== Requirements ===<br />
<br />
Directory Description<br />
&lt;package&gt; Static package objects<br />
&lt;provider&gt; LANANA registered provider name<br />
<br />
The directories /opt/bin, /opt/doc, /opt/include, /opt/info, /opt/lib, and /opt/man are reserved for local system administrator use. Packages may provide &quot;front-end&quot; files intended to be placed in (by linking or copying) these reserved directories by the local system administrator, but must function normally in the absence of these reserved directories.<br />
<br />
Programs to be invoked by users must be located in the directory /opt/&lt;package&gt;/bin or under the /opt/&lt;provider&gt; hierarchy. If the package includes UNIX manual pages, they must be located in /opt/&lt;package&gt;/share/man or under the /opt/&lt;provider&gt; hierarchy, and the same substructure as /usr/share/man must be used.<br />
<br />
Package files that are variable (change in normal operation) must be installed in /var/opt. See the section on /var/opt for more information.<br />
<br />
Host-specific configuration files must be installed in /etc/opt. See the section on /etc for more information.<br />
<br />
No other package files may exist outside the /opt, /var/opt, and /etc/opt hierarchies except for those package files that must reside in specific locations within the filesystem tree in order to function properly. For example, device lock files must be placed in /var/lock and devices must be located in /dev.<br />
<br />
Distributions may install software in /opt, but must not modify or delete software installed by the local system administrator without the assent of the local system administrator.<br />
<br />
Tip Rationale<br />
<br />
<br />
The use of /opt for add-on software is a well-established practice in the UNIX community. The System V Application Binary Interface [AT&amp;T 1990], based on the System V Interface Definition (Third Edition), provides for an /opt structure very similar to the one defined here.<br />
<br />
The Intel Binary Compatibility Standard v. 2 (iBCS2) also provides a similar structure for /opt.<br />
<br />
Generally, all data required to support a package on a system must be present within /opt/&lt;package&gt;, including files intended to be copied into /etc/opt/&lt;package&gt; and /var/opt/&lt;package&gt; as well as reserved directories in /opt.<br />
<br />
The minor restrictions on distributions using /opt are necessary because conflicts are possible between distribution-installed and locally-installed software, especially in the case of fixed pathnames found in some binary software.<br />
<br />
The structure of the directories below /opt/&lt;provider&gt; is left up to the packager of the software, though it is recommended that packages are installed in /opt/&lt;provider&gt;/&lt;package&gt; and follow a similar structure to the guidelines for /opt/package. A valid reason for diverging from this structure is for support packages which may have files installed in /opt/&lt;provider&gt;/lib or /opt/&lt;provider&gt;/bin.<br />
== /root : Home directory for the root user (optional) ==<br />
<br />
The root account's home directory may be determined by developer or local preference, but this is the recommended default location. &lt;ref&gt;If the home directory of the root account is not stored on the root partition it will be necessary to make certain it will default to / if it can not be located.<br />
<br />
We recommend against using the root account for tasks that can be performed as an unprivileged user, and that it be used solely for system administration. For this reason, we recommend that subdirectories for mail and other applications not appear in the root account's home directory, and that mail for administration roles such as root, postmaster, and webmaster be forwarded to an appropriate user.&lt;/ref&gt;<br />
== /sbin : System binaries ==<br />
<br />
Utilities used for system administration (and other root-only commands) are stored in /sbin, /usr/sbin, and /usr/local/sbin. /sbin contains binaries essential for booting, restoring, recovering, and/or repairing the system in addition to the binaries in /bin. &lt;ref&gt;Originally, /sbin binaries were kept in /etc.&lt;/ref&gt; Programs executed after /usr is known to be mounted (when there are no problems) are generally placed into /usr/sbin. Locally-installed system administration programs should be placed into /usr/local/sbin. &lt;ref&gt;Deciding what things go into &quot;sbin&quot; directories is simple: if a normal (not a system administrator) user will ever run it directly, then it must be placed in one of the &quot;bin&quot; directories. Ordinary users should not have to place any of the sbin directories in their path.<br />
<br />
For example, files such as chfn which users only occasionally use must still be placed in /usr/bin. ping, although it is absolutely necessary for root (network recovery and diagnosis) is often used by users and must live in /bin for that reason.<br />
<br />
We recommend that users have read and execute permission for everything in /sbin except, perhaps, certain setuid and setgid programs. The division between /bin and /sbin was not created for security reasons or to prevent users from seeing the operating system, but to provide a good partition between binaries that everyone uses and ones that are primarily used for administration tasks. There is no inherent security advantage in making /sbin off-limits for users.&lt;/ref&gt;<br />
=== Requirements ===<br />
<br />
The following commands, or symbolic links to commands, are required in /sbin.<br />
<br />
Command Description<br />
shutdown Command to bring the system down.<br />
<br />
=== Specific Options ===<br />
<br />
The following files, or symbolic links to files, must be in /sbin if the corresponding subsystem is installed:<br />
<br />
Command Description<br />
fastboot Reboot the system without checking the disks (optional)<br />
fasthalt Stop the system without checking the disks (optional)<br />
fdisk Partition table manipulator (optional)<br />
fsck File system check and repair utility (optional)<br />
fsck.* File system check and repair utility for a specific filesystem (optional)<br />
getty The getty program (optional)<br />
halt Command to stop the system (optional)<br />
ifconfig Configure a network interface (optional)<br />
init Initial process (optional)<br />
mkfs Command to build a filesystem (optional)<br />
mkfs.* Command to build a specific filesystem (optional)<br />
mkswap Command to set up a swap area (optional)<br />
reboot Command to reboot the system (optional)<br />
route IP routing table utility (optional)<br />
swapon Enable paging and swapping (optional)<br />
swapoff Disable paging and swapping (optional)<br />
update Daemon to periodically flush filesystem buffers (optional)<br />
<br />
== /srv : Data for services provided by this system ==<br />
<br />
/srv contains site-specific data which is served by this system.<br />
<br />
Tip Rationale<br />
<br />
<br />
This main purpose of specifying this is so that users may find the location of the data files for particular service, and so that services which require a single tree for readonly data, writable data and scripts (such as cgi scripts) can be reasonably placed. Data that is only of interest to a specific user should go in that users' home directory.<br />
<br />
The methodology used to name subdirectories of /srv is unspecified as there is currently no consensus on how this should be done. One method for structuring data under /srv is by protocol, eg. ftp, rsync, www, and cvs. On large systems it can be useful to structure /srv by administrative context, such as /srv/physics/www, /srv/compsci/cvs, etc. This setup will differ from host to host. Therefore, no program should rely on a specific subdirectory structure of /srv existing or data necessarily being stored in /srv. However /srv should always exist on FHS compliant systems and should be used as the default location for such data.<br />
<br />
Distributions must take care not to remove locally placed files in these directories without administrator permission. &lt;ref&gt;This is particularly important as these areas will often contain both files initially installed by the distributor, and those added by the administrator.&lt;/ref&gt;<br />
<br />
== /tmp : Temporary files ==<br />
<br />
The /tmp directory must be made available for programs that require temporary files.<br />
<br />
Programs must not assume that any files or directories in /tmp are preserved between invocations of the program.<br />
<br />
Tip Rationale<br />
<br />
<br />
IEEE standard P1003.2 (POSIX, part 2) makes requirements that are similar to the above section.<br />
<br />
Although data stored in /tmp may be deleted in a site-specific manner, it is recommended that files and directories located in /tmp be deleted whenever the system is booted.<br />
<br />
FHS added this recommendation on the basis of historical precedent and common practice, but did not make it a requirement because system administration is not within the scope of this standard.<br />
<br />
= Notes =<br />
&lt;references/&gt;</div>Brantgurga