Red Hat Software is committed to the Linux File System Standard, a collaborative document that defines the names and locations of many files and directories. We will continue to track the standard to keep Red Hat compliant.
While compliance with the standard means many things, the two most important are compatibility with other compliant systems, and the ability to mount the /usr partition read-only. The /usr partition contains common executables and is not meant to be changed by users. Because of this, the /usr partition can be mounted from the CD-ROM or from another machine via read-only NFS. The current Linux Filesystem Standard (FSSTND) document is the authoritative reference to any FSSTND compliant filesystem, but the standard leaves many areas undefined or extensible. In this section we provide an overview of the standard and a description of the parts of the filesystem not covered by the standard.
The complete standard can be viewed at:
http://www.pathname.com/fhs/
The directories and files noted here are a small subset of those specified by the FSSTND document. Check the latest FSSTND document for the most up-to-date and complete information.
The X11 and skel directories should be subdirectories of /etc:
/etc |- X11 +- skel
The X11 directory is for X11 configuration files such as XF86Config. The skel directory is for ``skeleton'' user files, which are files used to populate a home directory when a user is first created.
``/sbin typically contains files essential for booting the system in addition to the binaries in /bin. Anything executed after /usr is known to be mounted (when there are no problems) should be placed in /usr/sbin. Local-only system administration binaries should be placed into /usr/local/sbin.''
At a minimum, the following programs should be in /sbin:
clock, getty, init, update, mkswap, swapon, swapoff, halt, reboot, shutdown, fdisk, fsck.*, mkfs.*, lilo, arp, ifconfig, route
/usr |- X11R6 |- bin |- dict |- doc |- etc |- games |- include |- info |- lib |- local |- man |- sbin |- share +- src
The X11R6 directory is for the X Window System (XFree86 on Red Hat Linux), bin is for executables, doc is for random non-man-page documentation, etc is for site-wide configuration files, include is for C header files, info is for GNU info files, lib is for libraries, man is for man pages, sbin is for system administration binaries (those that do not belong in /sbin), and src is for source code.
``The /usr/local hierarchy is for use by the system administrator when installing software locally. It needs to be safe from being overwritten when the system software is updated. It may be used for programs and data that are shareable amongst a group of machines, but not found in /usr.''
The /usr/local directory is similar in structure to the /usr directory. It has the following subdirectories, which are similar in purpose to those in the /usr directory:
/usr/local |- bin |- doc |- etc |- games |- include |- info |- lib |- man |- sbin +- src
``... variable data files. This includes spool directories and files, administrative and logging data, and transient and temporary files.''
The following directories should be subdirectories of /var:
/var |- log |- catman |- lib |- local |- named |- nis |- preserve |- run |- lock |- tmp +- spool |- at |- cron |- lpd |- mail |- mqueue |- rwho |- smail |- uucp +- news
System log files such as wtmp and lastlog go in /var/log. The /var/lib directory also contains the RPM system databases. Formatted man pages go in /var/catman, and lock files go in /var/lock. The /var/spool directory has subdirectories for various systems that need to store data files.
In Red Hat Linux, the intended use for /usr/local is slightly different from that specified by the FSSTND. The FSSTND says that /usr/local should be where you store software that is to remain safe from system software upgrades. Since system upgrades from Red Hat Software are done safely with the RPM system and GnoRPM, you don't need to protect files by putting them in /usr/local. Instead, we recommend you use /usr/local for software that is local to your machine.
For instance, let's say you have mounted /usr via read-only NFS from beavis. If there is a package or program you would like to install, but you are not allowed to write to beavis, you should install it under /usr/local. Later perhaps, if you've managed to convince the system administrator of beavis to install the program on /usr, you can uninstall it from /usr/local.