2020-02-14
Unix's /usr
split and standards (and practice)
In Rob Landley about the /usr split, Rob
Landley doesn't have very good things to say about how the split
between /bin
and /usr/bin
(and various other directories) has
continued to exist, especially in various standards. One of my views
on this is that the split continuing to exist was always inevitable,
regardless of why the split existed and what reasons people might
have for preserving it (such as diskless workstations benefiting
from it).
As far as standards go, Unix standards have pretty much always been
mostly documentation standards, codifying
existing practice with relatively little invention of new things.
The people trying to create Unix standards are not in a position
to mandate that existing Unixes change their practices and setup,
and existing Unixes have demonstrated that they will just ignore
attempts to do so. Writing a Unix filesystem hierarchy standard
that tried to do away with /bin
and mandated that /usr
was on
the root filesystem would have been a great way to it to fail.
(POSIX attempted to mandate some changes in the 1990s, and Unix
vendors promptly exiled commands implementing those changes off to
obscure subdirectories in /usr
. Part of this is because being
backward compatible is the path of least resistance and fewest
complaints from customers.)
For actual Unixes in practice, conforming to the historical weight of
existing other Unixes (including their own past releases) has always
been the easiest way. There are countless people and scripts and so on
that expect to find some things in /bin
and some things in /usr/bin
and so on, and the less you disrupt all of that the easier your life
is. Inventing new filesystem layouts and pushing for them takes work;
any Unix has a finite amount of work it can do and must carefully budget
where that work goes. Reforming the filesystem layout is rarely a good
use of limited time and work, partly because the returns on it are so
low (and people will argue with you, which is its own time sink).
(Totally reinventing Unix from the ground up has been tried, by the people arguably in the best position possible to do it, and the results did not take the world by storm. Plan 9 from Bell Labs still has its fans and some of its ideas have leaked out to mainstream Unix, but that's about it.)
The modern irony about the whole issue is that recent versions of
Linux distributions are increasingly requiring /usr
to be on the
root filesystem and merging /bin
, /lib
, and so on into the /usr
versions, but this has been accomplished by the 800 pound gorilla
of systemd, which many people are not happy about in general. The
monkey's paw hopes
you're happy with sort of achieving the end of this split.
(A clean end to the split would be to remove one or the other of
/bin
and /usr/bin
, and similarly for the other duplicated
directories.)
The /bin
versus /usr
split and diskless workstations
I was recently reading Rob Landley about the /usr split (via, which can
be summarized as being not very enthused about the split between
/bin
and /usr/bin
, and how long it lasted. I have some opinions
on this as a whole, but today I want to note that one factor in
keeping this split going is diskless workstations and the issue of
/etc
.
Unix traditionally puts a number of machine specific pieces of
information in /etc
, especially the machine's hostname and its
IP address and basic network configuration. A straightforward
implementation of a diskless Unix machine needs to preserve this,
meaning that you need a machine-specific /etc
and that it has to
be available very early (because it will be used to bootstrap a lot
of the rest of the system). The simplest way to provide a machine
specific /etc
is to have a machine specific root filesystem, and
for obvious reasons you want this to be as small as possible.
This means not including /usr
(and later /var
) in this diskless
root filesystem, which means that you need a place in the root
filesystem to put enough programs to boot the system and NFS mount
the rest of your filesystems. That place might as well be /bin
(and later /sbin
).
This isn't the only way to do diskless Unix machines, but it's the
one that involves the least changes from a normal Unix setup. All
you need is some way to get the root filesystem (NFS) mounted, which
can be quite hacky since it's a very special case, and then everything
else is normal. An /etc
that isn't machine specific and where the
machine specific information is set up and communicated in some other
way requires significantly more divergence from standard Unix, all of
which you will have to write and maintain. And diskless Unix machines
remained reasonably popular for quite some time for various reasons.
(There is potentially quite a lot of machine specific information
in /etc
. Although it was common for diskless Unix machines to all
be the same, you could want to run different daemons on some of
them, have custom crontabs set up, only allow some people to log
in to certain workstations, or all sorts of other differences. And
of course all of these potential customizations were spread over
random files in /etc
, not centralized into some configuration
store that you could just provide an instance of. In the grand Unix
tradition, /etc
was the configuration store.)