FHS ( Filesystem Hierarchy Standard , "the standard file system hierarchy") - a standard that unifies the location of files and directories with a general purpose in the UNIX file system. Currently, most UNIX-like systems to one degree or another follow these rules. For example, a regular user database is always stored in the /etc/passwd .
| Fhs | |
|---|---|
| Creator | |
| Published | |
| Latest version | |
| Official site | |
The current version of the standard is 3.0, announced on June 3, 2015.
To get help about the directory system used in the OS, the hier command or the man hier command sometimes exists.
Content
Basic Information
The process of developing a standard file system hierarchy began in August 1993 with attempts to streamline the directory and file structure in the GNU / Linux operating system. On February 14, 1994, FSSTND ( Filesystem Standard ), the GNU / Linux-specific file system standard, was released. Subsequent versions were released on October 9, 1994 and March 28, 1995.
In early 1996, the BSD development community joined in the development of a new version of FSSTND with the goal of developing a standard suitable for all UNIX-like operating systems. The name of the standard was changed to Filesystem Hierarchy Standard .
FHS is supported by the Free Standards Group , a nonprofit organization that includes major software and hardware developers such as HP , Red Hat , IBM, and Dell . However, the majority of distribution developers, including those who are part of the Free Standards Group, do not fully follow the standard. In particular, paths specially created by the group, such as /srv , are almost never used. Some Linux systems reject FHS and follow their own standard, such as GoboLinux .
Since FHS began as an initiative of the Linux community, other UNIX and UNIX-like operating systems completely ignore it in favor of their own systems, which are sometimes quite widespread. For example, Mac OS X uses names such as /Library/ , /Applications/ and /Users/ along with traditional UNIX hierarchy names.
Directory Structure
In FHS, all files and directories are inside the root directory, even if they are located on different physical media. However, some of the directories may only be present if certain software is installed, such as, for example, the X Window System . Most of these directories exist on all UNIX-like operating systems and are used in a similar way.
| Catalog | Description |
|---|---|
/ | The root directory containing the entire file hierarchy. |
| Basic utilities required both in single-user mode and during normal work for all users (for example: cat , ls , cp ). |
| Boot files (including bootloader , kernel , initrd , System.map files). Often submitted to a separate section . |
| Main device files (e.g. /dev/null , /dev/zero ). |
| System - wide configuration files (the name comes from lat. Et cetera ). |
| Configuration files for /opt . |
| X Window System version 11 configuration files . |
| SGML configuration files. |
| XML configuration files. |
| Contains home directories of users , which in turn contain personal settings and user data. Often posted on a separate section. |
| The main libraries required for running programs from /bin and /sbin . |
| Mount points for removable media such as CD-ROM , DVD-ROM (first described in FHS-2.3 ). |
| Contains temporarily mounted file systems . |
| Additional software . |
| A virtual file system representing the state of the kernel of the operating system and running processes as files . |
| The root user home directory. |
| Information about the system from the moment of its loading, including data necessary for the work of daemons (pid-files, UNIX-sockets, etc.) [1] . |
| The main system programs for administering and configuring the system, for example, init , iptables , ifconfig . |
| Data for the services provided by the system (for example, www or ftp). |
| Contains information about devices, drivers, as well as some kernel properties. [2] |
| Temporary files (see also /var/tmp ). |
| Secondary hierarchy for user data. Contains most user applications and utilities used in multi-user mode. It can be mounted on a read-only network and be shared by several machines [3] . |
| Additional programs for all users that are not necessary in single-user mode. |
| Standard header files . |
| Libraries for programs located in /usr/bin and /usr/sbin . |
| Tertiary hierarchy for data specific to a given host. Usually contains subdirectories such as bin , lib , share [4] . |
| Additional system programs (such as daemons of various network services). |
| Architecture-independent shared data. |
| Source codes (for example, here are the source codes of the kernel). |
| Modifiable files, such as log files , temporary mail files, spooler files. |
| Application cache Such data is generated locally as a result of resource-intensive computing or I / O. An application must be able to regenerate this data. These files can be deleted without data loss. |
| Status Information. Permanent data changed by programs in the process of work (for example, databases, metadata of a package manager, etc.). |
| Lock files that indicate a busy resource. |
| Various log files . |
| User mailboxes. |
| The directory for storing information about the system from the time it was downloaded is currently out of date. It is allowed to make it a link to /run . The directory is left for backward compatibility with programs that still use the /var/run directory [5] . |
| Tasks that are waiting to be processed (for example, print queues, unread or unsent letters). |
| Location of user mailboxes (deprecated). |
| Temporary files that must be saved between reboots. |
Separation into system and user directories
Separation into system (for example, / etc , / bin ) and user directories is necessary for the following purposes.
- Simplify backup. System files are usually simply installed from the OS distribution and the most valuable are the user's personal files.
- Security. Usually, the user has write access only to the home directory, so if the worm starts, it will not be able to infect system files.
- Shared access from different OS:
- You can install multiple systems on one computer by assigning them one home directory;
- You can store system files on a separate server, and only the / home directory can be stored on a thin client ;
- it is possible to provide the employee access from any company computer by placing the / home directory on the server with the home directories of all employees.
The superuser’s home directory (root) is located in /root , and not in /home/root , since the superuser account is intended solely for administering the operating system. This helps to increase the reliability of the system: /root usually located on the same partition as the system, which allows maintenance and tuning of the operating system by mounting only the root partition.
Notes
- ↑ 3.15. / run: Run-time variable data . refspecs.linuxfoundation.org. Date of treatment March 19, 2018.
- ↑ / sys: Kernel and system information virtual filesystem . Filesystem Hierarchy Standard . Date of treatment June 4, 2017.
- ↑ Filesystem Hierarchy Standard
- ↑ Historically and strictly following the standard,
/usr/localis the repository of data that should be stored on the local host (as opposed to/usr, which can be mounted over the network). However, usually/usrrarely mounted remotely, and/usr/localmore often used to install software and data that are not part of the distribution (in this case/usrshould contain programs and data only from the standard distribution). Perhaps in the future the FHS standard will be changed to reflect this established situation. - ↑ 5.13. / var / run: Run-time variable data . refspecs.linuxfoundation.org. Date of treatment March 19, 2018.
Links
- Filesystem Hierarchy Standard Official Website
- Filesystem Hierarchy Standard 3.0, Linux Foundation (Eng.) (June 3, 2015)
- Filesystem Hierarchy Standard 2.3 (English) (January 29, 2004)
- What is each Linux directory or Linux OS directory structure for ?
- Standard for the directory structure of the file system (Russian)
- Chris Brown. Linux File System Tour // Linux Format . - 2007. - August ( No. 95 ). - S. 48-51 .