Whole document tree
    

Whole document tree

Filesystem Hierarchy Standard - 5 The /var Hierarchy

Filesystem Hierarchy Standard

5 The /var Hierarchy

"/var"
account
cache
crash
games
lib
lock
log
mail
opt
run
spool
tmp
yp
"Variable data"
Process accounting logs (if supported)
Application cache data
System crash dumps (if supported)
Variable game data
Variable state information
Lock files
Log files and directories
User mailbox files
Variable data for /opt
Data relevant to running processes
Application spool data
Temporary files preserved between system reboots
Network Information Service (NIS) database files

Tree 5.1

/var contains variable data files. This includes spool directories and files, administrative and logging data, and transient and temporary files.

Some portions of /var are not shareable between different systems. For instance, /var/log, /var/lock, and /var/run. Other portions may be shared, notably /var/mail, /var/cache/man, /var/cache/fonts, and /var/spool/news.

/var is specified here in order to make it possible to mount /usr read-only. Everything that once went into /usr that is written to during system operation (as opposed to installation and software maintenance) must be in /var.

If /var cannot be made a separate partition, it is often preferable to move /var out of the root partition and into the /usr partition. (This is sometimes done to reduce the size of the root partition or when space runs low in the root partition.) However, /var should not be linked to /usr because this makes separation of /usr and /var more difficult and is likely to create a naming conflict. Instead, link /var to /usr/var.

Applications should generally not add directories to the top level of /var. Such directories should only be added if they have some system-wide implication, and in consultation with the FHS mailing list.

The cache, lock, log, run, spool, lib, and tmp directories must be included and used in all distributions; the account, crash, games, mail, and yp directories must be included and used if the corresponding applications or features are provided in the distribution.

Several directories are `reserved' in the sense that they should not be used arbitrarily by some new application, since they would conflict with historical and/or local practice. They are:


    /var/backups
    /var/cron
    /var/lib
    /var/local
    /var/msgs
    /var/preserve

Previous:
/usr/src : Source code
Next: /var/account : Process accounting logs (if supported)
Up: Table of Contents

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