ctseawa: me, in profile (Default)
ctseawa ([personal profile] ctseawa) wrote2023-03-01 09:44 am

long technobable about early Unix filesystem partitioning

(I posted this to my mastodon account then realized that it should be here since it's long-form.)

The discussion of historical Unix file system layout recently came up in a chat so I thought I'd share it here as well. I started in 1985, so can't speak to what came earlier than that. This is based on memory so should not be considered authoritative.

In BSD 4.2 we had / (aka 'root), SWAP, /tmp, /usr, /usr/local (optional, perhaps), and some place for user home directories like /users or /homes. (Or, if you were broken, /mnt). If you had multiple drives user homes frequently went on one of them instead.

There were binaries in /etc (ifconfig being the main one I remember, might also have been shells), as well as /bin & /sbin (which were on /) and /usr/bin & /usr/sbin. /sbin was for things like fsck(8) which weren't for "ordinary users".

On-disk layout was usually something like /, SWAP, /usr, ... The idea was to make / and SWAP as fast as possible (they were on the speediest part of the disk) then put the rest where it could be useful.

There were fun things like /usr/tmp and /usr/log that were writable, so just about every filesystem on the host was RW.

We kept /tmp separate so it couldn't fill / and break things. Likewise /usr was separate because of /usr/tmp and /usr/log having the potential to fill up and break things.

The big thing: disks were small, expensive, and slow so the stuff in / was *just enough* to boot the host. /sbin and /bin had important binaries you'd need to start the system and fix things if mounts failed (e.g. fsck(8)) but nothing else - that all went into /usr/bin.

Eventually Sun wanted to do the "diskless node" thing so they created /var and moved all the writable filesystems out of /usr which could then be common to all hosts.

Over time, as disks got cheaper and larger, someone moved everything out of /bin into /usr/bin, leaving a link behind for us Old Farts.

Then someone else didn't like the idea of /usr/local so created /opt (I think that's Sun's fault as well but won't swear to it).

So we wound up with /, SWAP, /usr (later /usr just became part of /), /var, /homes-type-filesystem, /tmp, /opt, and optional filesystems like /usr/local.

I hope this top-of-the-head recollection was sufficiently understandable and at least slightly interesting.

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org