/usr/opt instead of /opt?

/usr/opt instead of /opt?

Oleg Goldshmidt pub at goldshmidt.org
Fri Mar 9 10:31:40 IST 2012


Omer Zak <w1 at zak.co.il> writes:

> My current Linux system has a 15GB root partition, which has 6GB files.
> Turns out that that about 5.5GB are in the /opt directory.
> My /usr partition is 206GB, of which about 33GB are used.
>
> This led me to wonder why is it not recommended in the FSSTND[1] to
> deprecate /opt[2] and install its contents as /usr/opt (possibly with
> soft link from /opt to /usr/opt).

It's not about the name (or mount point), it's about whether /opt is a
separate partition.

Note that /opt is intended for software (and data) that is not a part
of the system/distro, is installed in a non-standard way, etc. This is
something you may want to keep intact, e.g., when you upgrade the base
system. So you should keep /opt (and /home, for that matter) on a
separate partition from root (that normally includes /usr) and allow
clobbering the latter (upgrading, reinstalling, etc) without touching
/opt.

You could mount an add-on partition as /usr/opt, of course, but what
would be the point in the context of your question? It is actually
more logical to have /opt than /usr/opt.

It is not clear to me what your partition scheme is. On the one hand,
you say that /opt is a part of /, on the other hand, it sounds like
you mounted /usr sepaately, not as a part of /. It is possible, of
course, though not very frequent - I'd say the opposite is more
common.

This last observation is relevant to Ari's response to your post. The
whole point of, say, /sbin is to have the basic system utilities
necessary for booting the system separate from /usr, and only when
everything is fine and /usr is mounted /usr/sbin and /usr/bin become
available. Nowadays /usr is seldom mounted separately, and the
direction is to disallow it completely (and, if I understand
correctly, to require /usr inside initramfs, I'll admit that I don't
completely understand the reasons)). This would obviate /bin and
/sbin.

However, /bin and /sbin are a part of the base system, just like
/usr. The case of /opt and /home is different. 

> [1] http://www.pathname.com/fhs/

-- 
Oleg Goldshmidt | pub at goldshmidt.org



More information about the Linux-il mailing list