Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Acording to the FHS, the directories /lib and /usr/lib are both for libraries (libraries used in /sbin and user libraries, respectively).

But what about the /var/lib folder? Following the same logic this folder should have something like "variable libraries" (that sounds strange) but it actually holds data generated and maintained by running programs, or as defined by the wikipedia article:

State information. Persistent data modified by programs as they run, e.g., databases, packaging system metadata, etc.

From a fresh view, it makes more sense to put database data and served files under /srv instead of /var/lib

share|improve this question
We didn't write the standard. Well, most of us anyway. – Michael Hampton Oct 18 '12 at 17:08

This is explained in the commit to the new 3.0 version:

Specifically, /srv/ is for served, file-system structured data, /var/lib/ is for locally-consumed data. Apache will serve out of /srv as it's filesystem hierarchical. MySQL serves out of /var/lib since only mysqld accesses it and it is not filesystem hierarchical.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.