Chapter 5. The /var Hierarchy

Table of Contents

5.1. Purpose
5.2. Requirements
5.3. Specific Options
5.4. /var/account : Process accounting logs (optional)
5.4.1. Purpose
5.5. /var/cache : Application cache data
5.5.1. Purpose
5.5.2. Specific Options
5.5.3. /var/cache/fonts : Locally-generated fonts (optional)
5.5.4. /var/cache/man : Locally-formatted manual pages (optional)
5.6. /var/crash : System crash dumps (optional)
5.6.1. Purpose
5.7. /var/games : Variable game data (optional)
5.7.1. Purpose
5.8. /var/lib : Variable state information
5.8.1. Purpose
5.8.2. Requirements
5.8.3. Specific Options
5.8.4. /var/lib/<editor> : Editor backup files and state (optional)
5.8.5. /var/lib/color : Color management information (optional)
5.8.6. /var/lib/hwclock : State directory for hwclock (optional)
5.8.7. /var/lib/misc : Miscellaneous variable data
5.9. /var/lock : Lock files
5.9.1. Purpose
5.10. /var/log : Log files and directories
5.10.1. Purpose
5.10.2. Specific Options
5.11. /var/mail : User mailbox files (optional)
5.11.1. Purpose
5.12. /var/opt : Variable data for /opt
5.12.1. Purpose
5.13. /var/run : Run-time variable data
5.13.1. Purpose
5.13.2. Requirements
5.14. /var/spool : Application spool data
5.14.1. Purpose
5.14.2. Specific Options
5.14.3. /var/spool/lpd : Line-printer daemon print queues (optional)
5.14.4. /var/spool/rwho : Rwhod files (optional)
5.15. /var/tmp : Temporary files preserved between system reboots
5.15.1. Purpose
5.16. /var/yp : Network Information Service (NIS) database files (optional)
5.16.1. Purpose

5.1. Purpose

/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 must 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 must 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.