Score:3

Should apps be installed on the root partition?

cx flag

I've been having some problems with root partition getting filled up, and also being corrupted, leading to boot problems.

I've checked and saw that I have Matlab installed on it, which is big, and crashes quite often. I'm a bit surprised Matlab is installed in /usr/local/MATLAB? Now I see the PyCharm is installed also on the root partition, at /opt/pycharm. Also other apps, Chrome, etc.

It is small (64 GB) compared to user partition at /home (800 GB), but still apps are installed there. What's the root partition for? Where should the apps go?

marcelm avatar
cn flag
_"and also being corrupted"_ - It shouldn't get corrupted, no matter if apps live there or not. I'd worry more about corruption, and find out what the cause of that is. Also, my opinion: separated `/` and `/home` sucks, in part because of the problem you encounter.
Score:5
cn flag

The packager of applications controls what directories the packages install to, you control (at install) what drive/array each directory is located in.

The root (/) directory gets all directories that you haven't allocated specific drive/array/partitions to hold data in, which means the root directory should contain space for all additional packages you add to your system (package type also has a part to play in space requirements).

The installer should plan for this prior to installation (but partition sizes can be adjusted, or directories moved to other drive/array/partitions post-install too). Package rules can also vary on release; so don't assume for example a rule that exists in 20.04 (focal) is the same for 22.04 (jammy); rules are only changed when required to be changed, but they can change from one release to the next.

guiverc avatar
cn flag
prior comment copy/pasted (*with minor text changes due mostly to space for comment*) changes only.
Score:2
cn flag

As indicated in the other answers, apps installed using package managers or installation scripts are installed in fixed, conventional locations in the file system under root (/). This cannot be changed (read "not easily" in case of installation scripts.

Apart from enlarging your root partition, you easily could relocate some of the system data to another storage medium using symlinks. Especially these applications that are manually installed,i.e., not from the software center, could be relocated. This includes /opt and /usr/local/.

Preferably change the system from a root recovery prompt, although, for these particular system folders, it may still be safe to move these particular folders from a TTY, and even from a regular graphical terminal. Still, prefer at least to not log in and work from a TTY.

  • Boot your computer to the login screen

  • With Ctrl+Alt+F4, switch to a terminal console and log in there.

  • Make a directory under your home folder to host the extra system files:

    sudo mkdir /home/system
    

    (You choose the name to your liking).

  • Move your /opt and /usr/local directories

sudo mv /opt /home/system/
sudo mv /usr/local /home/system/
  • Create symlinks to these moved directories in the original place
ln -s /home/system/opt /opt
ln -s /home/system//usr/local /usr/local
  • Verify these two folders now are "restored" (the system sees them in the expected location even where the data physically live on another partition:
ls /opt /usr/local
  • Probably there is no need to reboot, but do it to be sure. Either go back to the login screen (Alt+F1 on standard Ubuntu, else could be Alt+F7) to restart, or type reboot.

Specific remark

You indicate your root partition is 60GB. This still is plenty for a partition solely used as the system partition. For you, there should be no need to move any system files out. So prefer to check what else is filling that partition, and eliminate that source of data. then you can leave any system data on the system partition.

Score:1
cn flag
raj

There are two different things: filesystem hierarchy and partitioning. The specific directories under the root directory (/), like /usr or /opt each have their purpose, defined by the Filesystem Hierarchy Standard (FHS). According to this standard, /usr and /opt are typical directories where applications are installed.

However, it is totally up to you on which partition each of these directories will be located. You can mount entire /usr (or only /usr/local), or /opt, or any other directory, on a separate partition. For example, on multi-user servers it is common to use separate partitions for /var and /tmp, to avoid crashing the server in case system logs fill up the /var partition or temporary files created by applications fill up the /tmp partition.

If you don't mount these directories on separate partitions, they are located on the same partition as their parent directory - that is, on the root partition.

Oskar Skog avatar
us flag
Note that "these days" you can't necessarily put `/usr` on a different partition as `/bin` and `/sbin` may be symlinks to `/usr/bin` and `/usr/sbin`. `/usr/local` should be fine though.
Score:1
cn flag

You can not control where most apps are installed. They go in var opt usr for example. If the root is getting filled it is too small. The min used to be recommended to be 25 gig but with the greater number of apps being snaps that number should be more like 40 gig now. As for being corrupted you are most likely referring to having zero free space. One of the most common reasons for running out of space in a single partition is creating many partitions in the first place. Unless you have a special reason for making many partitions you would have been better off letting the install make the partition.

guiverc avatar
cn flag
I'd work it a little more carefully. Rather than "The min used to be"; I know you mean minimum size requirement (*taken from [here](https://help.ubuntu.com/community/Installation/SystemRequirements) I believe*) but that may not be clear to reader(s). You should probably also include that (*or your reference*) too to help readers understand (*alas I'm no longer a fan of that link due to the edit with 8.6GB for an install without package changes or upgrades! edit*). The 40 comment I'd prefer if you made clear it's your opinion (*I find 25 too small for my usage too!*).
guiverc avatar
cn flag
FYI: I don't understand the downvote (*alas I often don't on this site*); it'd be clearer if the user commented why; thus why I've attempted to comment. Your final reasoning (*related to partitioning*) may also be unclear to readers, though I do understand what you're trying to say (*and I'd struggle to write it clearly too I fear*).
guiverc avatar
cn flag
s/work/word in my first comment sorry.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.