読者です 読者をやめる 読者になる 読者になる

めもぶろぐ

お勉強したこと、趣味なんかを適当に書いてます。。。

FHS Chapter 3. The Root Filesystem

3.1. Purpose

The content of the root filesystem must be adequate to boot, restore, recover, and/or repair the system.

  • 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 paritions or filesystems.
  • 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.
  • To restore a system, those utilities needed to restore from system backups*on floppy, tape, etc.( must be present on the root filesystem.
Rationale

The primary concern used to balance these considerations, which favor placing many things on the root filesystem, is the goal of keepng root as small as reasonably possible. for several reasons, it is desirable to keep the root filesystem small:

  • It is occasionally mounted from ver small media.
  • The root filesystem contains many system-specific configuration files. Possible examples include a kernel that is specificallyfic 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.
  • While you may have the root filesystem on a large partition, and may be able to fill it to your hearts 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 you assumption into a problem for a large number of users.
  • Disk errors that corrupt data on the root filesystem are greater problem than errors on any other partition. A small root filesystem is less prone*1 to corruption as the result of systemic crash.

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.

Rationale

There are several reasons why creating a new subdirectory of the root filesystem is prohibited:

  • It demands space on a root partition which the system administrator may want kept small and simple for either performance or security reasons.
  • It evades whatever dishpline the system administrator may have set up for distributing standard file hierarchies across mountable volumes.

Distributions should not create new directories in the root hierarchy without extremely carful consideration of the consequences including for application portability.

3.2 Requirements

Directory Description
bin Essential commands binaries
boot static files of the boot loader
dev device files
etc Host-specific system configuration
lib Essential shared libraries and kernel modules
media mount point for remove able media
mnt mount point for mounting a filesystem temporaryily
opt Add-on application software packages
sbin Essential system binaries
srv Data for services provided by this system
tmp temporary files
usr Secondary hierarchy
var variable data

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.

*1:likely to or liable to suffer from, do, or experience something, typically something regrettable or unwelcome: years of logging had left the mountains prone to mudslides. | he is prone to jump to conclusions. lying flat, especially face downward: i was lying prone on a foam mattress.

広告を非表示にする