Linux History – How Did /var/lib Get Its Name?

historylinux

The Linux Filesystem Hierarchy Standard says that /var/lib "holds state information pertaining to an application or the system."

FreeBSD doesn't mention /var/lib in hier(7). The closest thing I can find is /var/db ("miscellaneous automatically generated system-specific database files"), which seems like a more descriptive name.

Where did /var/lib come from, and how did it get its name? I don't see the connection between /var/lib and libraries. Or does lib stand for something else in this case? Is it Linux-specific, or is this a System V vs BSD difference?

Best Answer

The LHFS also says about /var as a whole:

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

And this is the link to the past for /var/lib: "once" there were files in /usr/lib that were written - and those now should be put into the /var structure - to /var/lib (probably to find them easier if you once were used to look for them in /usr/lib? )

BTW, /var/db from BSD is also mentioned in the LHFS, those files are put into /var/lib/misc in the LHFS.

Related Question