/usr/opt instead of /opt?

/usr/opt instead of /opt?

guy keren guy.choo.keren at gmail.com
Fri Mar 9 11:31:29 IST 2012


On 03/09/2012 10:31 AM, Oleg Goldshmidt wrote:
> 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/
>


historically, you wanted / to be as small as possible, in order to make 
it easy to:

1. share other directories between directories (i.e. /usr is supposed to 
be constant and without any host-specific data, so you could mount it 
off NFS).

2. making it possible to fsck the partition as fast as possible after 
problematic shutdowns.

3. handle limitations in partition sizes of different devices (as well 
as physical disk sizes).

for a hope PC, point #1 is irrelevant. for a journaled file-system, 
point #2 is much less important. and with today's disks - point #3 is 
not so important either.

plus, the only sane way to have the data partitioned, is to install the 
operating system on top of LVM - where you can easily resize things.

once i realized this - stopped using separate partitions. today i don't 
even use a /boot partition on a PC - the problems with the location of 
the boot loader currently belong to the past.

on my hope PC, there is a single / partition of ~450GB. no hassles with 
a too small partition.

--guy



More information about the Linux-il mailing list