Whole document tree
    

Whole document tree

Filesystem Hierarchy Standard - 2 The Filesystem

Filesystem Hierarchy Standard

2 The Filesystem

The UNIX filesystem is characterized by:

  • A hierarchical structure
  • Consistent treatment of file data
  • Protection of file data

This standard assumes that the operating system underlying an FHS-compliant file system supports the same basic security features found in most UNIX filesystems. Note that this standard does not attempt to agree in every possible respect with any particular UNIX system's implementation. However, many aspects of this standard are based on ideas found in UNIX and other UNIX-like systems.

This is after careful consideration of other factors, including:

  • Traditional and well-considered practices in UNIX-like systems.
  • The implementation of other filesystem structures
  • Applicable standards

It is possible to define two independent categories of files: shareable vs. unshareable and variable vs. static.

Shareable data is that which can be shared between several different hosts; unshareable is that which must be specific to a particular host. For example, user home directories are shareable data, but device lock files are not.

Static data includes binaries, libraries, documentation, and anything that does not change without system administrator intervention; variable data is anything else that does change without system administrator intervention.

For ease of backup, administration, and file-sharing on heterogenous networks of systems with different architectures and operating systems, it is desirable that there be a simple and easily understandable mapping from directories (especially directories considered as potential mount points) to the type of data they contain.

Throughout this document, and in any well-planned filesystem, an understanding of this basic principle will help organize the structure and lend it additional consistency.

The distinction between shareable and unshareable data is needed for several reasons:

  • In a networked environment (i.e., more than one host at a site), there is a good deal of data that can be shared between different hosts to save space and ease the task of maintenance.
  • In a networked environment, certain files contain information specific to a single host. Therefore these filesystems cannot be shared (without taking special measures).
  • Historical implementations of UNIX-like filesystems interspersed shareable and unshareable data in the same hierarchy, making it difficult to share large portions of the filesystem.

The "shareable" distinction can be used to support, for example:

  • A /usr partition (or components of /usr) mounted (read-only) through the network (using NFS).
  • A /usr partition (or components of /usr) mounted from read-only media. A CD-ROM is one copy of many identical ones distributed to other users by the postal mail system and other methods. It can thus be regarded as a read-only filesystem shared with other FHS-compliant systems by some kind of "network".

The "static" versus "variable" distinction affects the filesystem in two major ways:

  • Since / contains both variable and static data, it needs to be mounted read-write.
  • Since the traditional /usr contains both variable and static data, and since we may want to mount it read-only (see above), it is necessary to provide a method to have /usr mounted read-only. This is done through the creation of a /var hierarchy that is mounted read-write (or is a part of another read-write partition, such as /), taking over much of the /usr partition's traditional functionality.

Here is a summarizing chart. This chart is only an example for a common FHS-compliant system, other chart layouts are possible within FHS-compliance.

shareable
unshareable
static

/usr
/opt
/etc
/boot
variable

/var/mail
/var/spool/news
/var/run
/var/lock

Table 2.1


Previous:
Conformance with this Document
Next: The Root Directory
Up: Table of Contents

Translated by troff2html v1.4 on 13 January 2001 by Daniel Quinlan