/bin /usr/bin /usr/local/bin etc

/bin /usr/bin /usr/local/bin etc

Post by Gerard Beekma » Mon, 15 Nov 1999 04:00:00



Hi,

Could somebody give me a reason why I shouldn't create one directory for binaries say /usr/bin, move all files from /bin and /usr/local/bin to /usr/bin and make /usr/bin and /usr/local/bin symlinks to /usr/bin (and the same thing for the /sbin /usr/sbin and /usr/local/sbin)?

I'm building my own 'distribution' from sources and it made me wonder why I should have three bin dirs in my case (there's no need for system dependant/independant seperation since this box  isn't on any network (other than Internet) and no other people besides me login to this box).

I'm sure there are several good reasons, but I wonder if they would apply to me in this case.

Thanks for any answer and if it's not a problem for you, i'd like to receive a response via email.

--
Thanks,
Gerard  Beekmans

 
 
 

/bin /usr/bin /usr/local/bin etc

Post by Thomas Zaj » Mon, 15 Nov 1999 04:00:00



> Could somebody give me a reason why I shouldn't create one directory
> for binaries say /usr/bin, move all files from /bin and /usr/local/bin
> to /usr/bin and make /usr/bin and /usr/local/bin symlinks to /usr/bin
> (and the same thing for the /sbin /usr/sbin and /usr/local/sbin)?
> [ ... ]

Suppose you move eg. /bin/mount to /usr/bin/mount - what will happen
if /usr is on a different partition than / (which is quite common)?
You'd need to mount /usr, but 'mount' itself resides on /usr. Chicken
and egg. Bad Idea[tm]. And that's just _one_ example ...

I'd _strongly_ suggest to (1) have a good look at the FHS v2.0 (Filesystem
Hierarchy Standard) at <http://www.pathname.com/fhs/>, and (2) fix your
line length (come on, I'm sure Pan can do better than this ;-).

HTH,
Thomas
--
=-------------------------------------------------------------------------=
- Thomas Zajic  <thomasDOTzajicATtelewebDOTat>  Linux-2.0.38/slrn-0.9.5.7 -
-  "It is not easy to cut through a human head with a hacksaw."  (M. C.)  -
=-------------------------------------------------------------------------=

 
 
 

/bin /usr/bin /usr/local/bin etc

Post by Peter Samuels » Mon, 15 Nov 1999 04:00:00


[Posted and mailed, per req]


Quote:> Could somebody give me a reason why I shouldn't create one directory
> for binaries say /usr/bin, move all files from /bin and
> /usr/local/bin to /usr/bin and make /usr/bin and /usr/local/bin
> symlinks to /usr/bin (and the same thing for the /sbin /usr/sbin and
> /usr/local/sbin)?

As Thomas already said, you should definitely read the FHS (Filesystem
Hierarchy Standard) at http://www.pathname.com/fhs/ .  And, if you want
to maintain compatibility with other distributions (i.e. third-party
software will know where to find things) you should try to follow it.

He also gave the primary reason: long Unix tradition separates out the
"/" filesytem from the "/usr" filesystem, and programs deemed essential
for system maintenance and so forth are usually put in /bin or /sbin so
that they will work without /usr being mounted.  (Exactly the same
applies to /lib and /usr/lib.)  Interestingly, AIX has only /lib and
/sbin, with /bin -> usr/bin.

If you read the FHS, you will note that it puts all directories which
need to be read-write in normal system operations outside the /usr
hierarchy; this makes it possible to mount /usr read-only, reducing
risk of filesystem corruption.  This is one good reason to separate /
and /usr.  There are others.

--
Peter Samuelson
<sampo.creighton.edu!psamuels>

 
 
 

/bin /usr/bin /usr/local/bin etc

Post by Nix » Mon, 22 Nov 1999 04:00:00



>                                 Interestingly, AIX has only /lib and
> /sbin, with /bin -> usr/bin.

This seems to be common on (newer?) SysV systems. SunOS has /bin ->
/usr/bin, and /lib -> /usr/lib; statically linked versions of things
like the shell are replicated in /sbin.

Urgh.

--
`If both of these are true, Unix98 ptys are fully operational, and
 ready to destroy unarmed planets.' --- Richard Gooch