The /bin versus /usr split and diskless workstations

February 14, 2020

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


Comments on this page:

By Greg A. Woods at 2020-02-25 17:48:53:

For diskless workstations the / (and /etc) issue that helps perpetuate having a separate /usr partition is partly due to the inability to mount onto a filesystem that's read-only.

I experimented with solving this issue as far back as in the SunOS-4 days, and again in the early NetBSD days (i.e. in the 1990s). However I never really had enough motivation to actually go all the way and figure out how to make it possible (and secure) to mount the root partition read-only and still be able to mount a read/write /etc (and other) partition(s). After all the only diskless workstations I ever really managed were my own desktop and test systems, and that never amounted to more than about three at a time.

I did modify the NetBSD kernel to separately mount /etc if it was specified in the bootparams or bootp reply though, and I still have up-to-date patches for that part.

Written on 14 February 2020.
« You can't delegate a ZFS administration permission to delete only snapshots
Unix's /usr split and standards (and practice) »

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

Last modified: Fri Feb 14 00:42:31 2020
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.