The not so secret history of /var

March 12, 2009

Originally, Unix had no /var; what is currently put there went into /usr instead (with some of it going into /etc), so you had /usr/log, /usr/spool, /usr/tmp, and so on. Remnants of this era still linger on in /etc, where you still find a certain number of frequently updated data files like /etc/passwd.

(One might sensibly ask why Unix had both /tmp and /usr/tmp. My guess is that it goes back to the days before /usr, and so /tmp had to be retained when /usr was added but at the same time people wanted a bigger scratch space, so /usr/tmp was created.)

Then along came the idea of diskless workstations (I believe originally from Sun). Even back then, /usr was the biggest system filesystem, so no one was really enthused about the idea of each diskless system having its own copy. Since at this point symlinks had been introduced, people came up with the idea of moving everything writable from /usr into a new filesystem, /var, and leaving symlinks behind so that people and programs could continue to use old paths like /usr/tmp. This left /usr read-only and shareable among all of your diskless clients, which saved a lot of disk space.

(Indeed, a shared /usr and the accompanying disk space savings are probably what made diskless clients viable in the first place.)

Over the years since then, the symlinks have been progressively removed on many systems. But today you can still find them on some systems that especially value backwards compatibility, for example Solaris 10.

In addition to moving things from /usr to /var, a certain number of things were relocated from /etc to /var. Practically speaking this was much less important, since you needed a separate / filesystem for each diskless client anyways, but it did create a culture where system daemons shouldn't normally write to /etc to store PID files and so on.

Written on 12 March 2009.
« Checklists versus procedures
The problem with /var today »

Page tools: View Source, Add Comment.
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Thu Mar 12 00:57:10 2009
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.