Is it possible to have apps installed on a separate drive from where the OS is installed?

Is it possible to have apps installed on a separate drive from where the OS is installed?

I feel like a failure for not being able to find the answer on the internet. There must have been someone in history of internet asking this. But I couldnt, so here we go:

I have an old macbook air with macOS and ubuntu installed on the same hard drive. This macbook has 64GB internal SSD so little for my engineering work, I need heavy apps installed on the machine, so I bought a 512GB nvme SSD to have this extra space for apps and personal files obviously.

How could I have linux on the internal SSD being able to have its apps files installed on the external SSD?

I think the question would be how to have the root for all the system libraries in the internal SSD and app binaries on external SSD? Please correct me if Im wrong and please give the most information I want to learn linux. Maybe Im a hard head for informatics.

Installing apps on separate hard drive This answer is poor and I think doesnt relate directly to my problem as I need /usr to be on a diferent drive? If my terminology is wrong please correct me.

答案1

If you want that kind of setup you need to stick with snap and flatpak versions of software (IOT). Some software already will be installed using snap. Ubuntu is heading the way you want it to go.

The old method of installing software in Linux is a method with the least overhead. So if more than 1 piece of software needs a package only the 1st install will need to install that package and the other installations happily will share it. In Windows each piece of software will also install its own parts independent of other software.

Our method saves disk space but that also means we scatter files across different directories making it very difficult to sandbox software.

could I just mount the SSD partition to /usr?

That used to be the way to do this BUT it is not enough. MySQL stores its database by default in /var/. Apache user /var/ for its default directory. /etc/ is used to store settings. And so on. There is no nice method to restore a /usr/ into a new installation or to use it across different Linux installations so it looks nice to do but there is nothing to benefit from a /usr/ partition.

相关内容