This is part of the talk “UNIX archeology” I gave at OpenFest 2023.
In modern contexts, /usr is essential for housing the majority of user utilities and applications. This includes system-wide software and files like standard programs, libraries, documentation, and much more. Unlike the root filesystem, which contains the minimum necessary for booting and repairing the system, /usr provides the bulk of the operating system’s functionality.
However, have you ever thought why do we have seemingly duplicated with / directories in there? For instance, there is /bin and /usr/bin, /lib and /usr/lib, and lately we’ve started symlinking one to another. Surely, we could’ve just avoided the need to have them both in the first place. But why are they there?
/usr is the second major section of the filesystem. /usr is shareable, read-only data. That means that /usr should be shareable between various FHS-compliant hosts and must not be written to. Any information that is host-specific or varies with time is stored elsewhere.
Large software packages must not use a direct subdirectory under the /usr hierarchy.
Actually, we only found out that we could mount /usr in read-only mode and even re-use it between a bunch of machines, decades after /usr was part of Unix.
no space left on device
Unix was created on a PDP-7 machine in 1969 and later migrated (which included rewriting a bunch of things, but that’s a story for another time) to the much more powerful PDP-11 , which had one RK05 disk pack (1.5MB):
Arnold Reinhold | CC-BY-SA
That was all. The entire / of Unix was on one of those drives, less than 1.5MB.
Eventually it grew, with its userbase, and they needed another one. It was
mounted into /usr in order to contain user home directories. There were
/usr/ken, /usr/dmr, /usr/bwk, etc. However, multiple users were writing useful
tools which they wanted to share and thus /usr/bin has been created. Eventually
man pages started getting into shape, fonts started being interesting, people
experimented with graphics and they all meant to be shared. The law was that
nothing on that drive should be crucial for the machine to boot. For instance,
you could not place the
mount command in there, because something had to
mount /usr in the first place. This limitation no longer exists thanks to
initrd and initramfs.
Eventually, this drive grew bigger as well and they needed a 3rd one. It was mounted into /home and all of the home directories have been moved there, leaving /usr only for shareable files. That meant whole 3MB solely for the operating system. Hell, yeah!
And then we just kinda gone with it. Once Unix was made (not quite) generally available and the idea to split the OS into multiple drives was still legit. This was no longer the case only decades later. Why going through a revolution for that? Instead, people just made up rules and conventions on how to deal with /usr.