Filesystem Hierarchy Standard

From LQWiki
Jump to navigation Jump to search

The Filesystem Hierarchy Standard or FHS specifies a directory structure for UNIX-like systems. It was orginially created to ease development of software that needs to run on different Linux distributions and other UNIX-like systems. It defines the common UNIX-like directories and for which they are supposed to be used. It also defines a couple extra Linux specific directories.

One of the goals of the FHS is separation of shareable and unshareable on one hand and separation of static and variable files on the other. The rationale behind it is ease of mounting (read only), backup.

shareable unshareable
static /usr
/opt
/etc
/boot
variable /var/mail
/var/spool/news
/var/run
/var/lock
  • "Shareable" files are files that ar note host-specific and thus may be stored and used on different hosts. Examples are files in /home and /var/www. On the contrary, "unshareable" files are for use on one specific host and are (by definition) not shareable. Examples are the files in /etc and /var/lock.
  • "Static" files are files that can change only by means of user/system admistrator intervention. These include user data, binaries, libraries, documentation. "Variable" files are files that are controlled by the system (lock files, spool files) and are not static by definition.

External links