2

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.

  • Applications generally install to specific locations (ie. directories), though the method an app is installed will have some say (eg. snaps will install to a different location to deb/apt packaged). You can place specific directories on different drives - thus achieve what you're after (ie. force all snaps to one drive; force all to specific locations via say /usr going to one drive, or if I wanted just libreoffice, I'd just have /usr/bin/libreoffice mounted from a different location.. ie. you can setup what you want manually. – guiverc Feb 06 '20 at 03:07
  • could I just mount the SSD partition to /usr? Thats what i understood from the answer on the other thread I put in my question description. – Gustavo Henrique Foss Neves Feb 06 '20 at 03:17
  • You gave no release details - so if your install was Ubuntu Core 18 for example, the result would be minimal. It can vary on release, what packaging apps are installed via etc. Snaps for example don't install to /usr/ – guiverc Feb 06 '20 at 03:24
  • so apps have dependencies, which in a perspective is the code, external to the app package that is needed to run an app. Im running ubuntu 18.04.4 lts, which I read from about in system settings. So snaps are packaged as they are to overcome problems like mine? – Gustavo Henrique Foss Neves Feb 06 '20 at 03:58
  • No my point was snaps install to /snap; thus changes will made to where /usr/ is located will have no impact on snapped packages. Some system apps will also use other locations, the packager will decide where it goes. The best solution for you will depend on your usage, I would start by exploring your existing system and where your programs have installed themselves. You gave no details on what applications, how they're packaged (deb, snap, appimage, flatpak etc) or compiled from source.. – guiverc Feb 06 '20 at 04:09
  • "How could I have linux on the internal SSD being able to have its apps files installed on the external SSD?" is a nonsense question - the Ubuntu OS is several thousand interconnected apps, and the line between OS and separate application is purely imaginary. The problem is one of perspective - you imagine Ubuntu to be a discrete OS like Windows, which is simply incorrect. Sticking to that invalid concept will spin you round in circles and get you confused. Use Ubuntu the way it is intended to be used, and you will find life much easier. – user535733 Feb 06 '20 at 04:28
  • If its a nonsense question could you please help me reformulate it? If you dont have the time or if you are thinking I should read about a specific subject on this could you please help me out just figuring out the topic to read. I need a lead. I dont understand where the app is installed and how it relates to the OS to be executed... I have installed all kinds of packaged software. Im familiar with the snap and deb packages at least. I think i will read about linux filesystem... Didnt Linux Foundation standardize filesystem hierarchy??? Its confusing – Gustavo Henrique Foss Neves Feb 06 '20 at 05:52

1 Answers1

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.

Rinzwind
  • 299,756
  • Thank you very much, your answer was simple to understand. From reading on the internet I was beginning to assume snaps and flatpaks were the closest analogy to the more well known microsoft installation packages. It feels weird how one becomes so used to the filesystem structure of the better known commercial operating systems. – Gustavo Henrique Foss Neves Feb 06 '20 at 19:59