Understanding the bin, sbin, usr/bin , usr/sbin split

Christopher Barry christopher.barry at rackwareinc.com
Mon Dec 27 04:11:37 UTC 2010


On Mon, 2010-12-27 at 03:26 +0100, Denys Vlasenko wrote:
> On Thursday 09 December 2010 16:45, Rob Landley wrote:
> > The /bin vs /usr/bin split (and all the others) is an artifact of this, a 
> > 1970's implementation detail that got carried forward for decades by 
> > bureaucrats who never question _why_ they're doing things.  It stopped making 
> > any sense before Linux was ever invented, for multiple reasons:
> ...
> 
> > I'm pretty sure the busybox install just puts binaries wherever other versions 
> > of those binaries have historically gone.  There's no actual REASON for any of 
> > it anymore.  Personally, I symlink /bin /sbin and /lib to their /usr 
> > equivalents on systems I put together.  Embedded guys try to understand and 
> > simplify...
> 
> Another simplification:
> 
> I symlink [/usr]/sbin to bin. If a program shouldn't be runnable by a non-root,
> it can easily be arranged by suitable mode in the binary. No need to have
> separate directory for that.
> 

Actually, there are other good historical reasons, and they have nothing
to do with Bureaucrats :) Disks were very expensive. The core system
binaries were located in /bin and /sbin. /usr and /home were often nfs
mounted from a central location housing non-core binaries, manuals,
source trees, user data and other shared stuff.

This had the benefit of a single upgrade point for non-core binaries,
and source and user's homes were accessible from everywhere;
convenience /and/ less disk usage all around. Even today, good admins
partition their local disks to put /usr (and definitely /tmp) on a
separate slice, or even on another disk. To touch on your earlier
comment, the initramfs rarely (if ever) mounts anything but /.

Also the PATH can be tailored for users vs admin, setting perms is
simpler, etc.

That, and stuffing tons of non-core things in /bin or /sbin is sloppy in
my opinion. For an embedded appliance, does it still make sense? I guess
it's debatable, but if it has a need for non-core binaries, I'd say
yeah, why not? It avoids the mess, and non-core files that historically
have been in /usr should probably remain there. And if you're accessing
them via a symlink, what's the big deal anyway? If it's NIX, why not
just keep it consistent? Are you saving any space by doing this?

Carrying your point to it's logical conclusion Rob, maybe you should
*really* simplify and just eliminate directories altogether. Who needs
'em!? They only clutter stuff up anyway, and for no good reason. Just
dump everything right in / and make all those annoying historical
directories just symlinks to / or each other. Then you've got everything
handy in a single place. And, as an added bonus, you can even save some
space by deleting the cd command.

:)

-C




More information about the busybox mailing list