[TUHS] /bin vs /sbin

Warner Losh imp at bsdimp.com
Wed Jul 22 04:15:26 AEST 2020


On Tue, Jul 21, 2020 at 11:56 AM Grant Taylor via TUHS <tuhs at minnie.tuhs.org>
wrote:

> One of the things that I've noticed in my explorations into the H.J. Lu
> bootable root disks is that some of them predate the /sbin split in Linux.
>
> One of them has exactly one file in /sbin and other commands spread
> across /bin, /usr/bin, and /etc.  The single file in /sbin is sln.
>
> To me, this makes it fairly self evident that /sbin was originally for
> statically linked binaries.  At least in Linux.
>

The root disks date from a time before Linux had shared libraries, I
thought, though I've not looked at HJ Lu's disks in a very, very long time.
And I stopped looking very early on once I had my system bootstrapped... I
do recall going through some pain to bootstrap shared libraries on my
system...


> Does anyone have any history of /sbin from other traditional Unixes?
> I'd be quite interested in learning more.
>

/sbin has never been for static binaries in BSD land. It's always for
system admin binaries that used to live in /etc. They moved to /sbin or
/usr/sbin. This split is due to historically tiny / filesystems and the
need to have just enough binaries on them to check and mount /usr later in
boot. It dates from 4.3-RENO. There were no shared libraries in BSD at the
time (though I think contemporaneous Sun systems had them, which is where
Linux got its first a.out shared library scheme from (kinda, sorta, more
inspired by with some code snatched from gcc/binutils SunOS compat impl,
but with more limitations)).


> I also noticed that (at least) one of the early versions of the H.J. Lu
> disks had root's home directory in /usr/root.
>
> I seem to recall that one version used an atypical of /users vs /usr.
> Which as I understand it, goes back to the original / vs /usr split in
> Unix, before /home became a thing.
>

Early days this was actually quite common. You put your users under
/usr/foo because there weren't many of them, and you'd save a inode lookup
over /usr/users/foo and you didn't need a separate filesystem for your
users. I saw it more on 'small' systems with limited number of users rather
than big, university systems with student populations on them (which needed
a separate filesystem to hold all the user content, even with draconian
quota limits).

Warner


> --
> Grant. . . .
> unix || die
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20200721/277f1db9/attachment.htm>


More information about the TUHS mailing list