How to install programs on different partitions?

Debian_SuperUser

Active Member
Joined
Mar 18, 2024
Messages
126
Reaction score
31
Credits
1,438
Can't believe I am getting this question now, but only because I am running out of space because of a Windows dual boot.

One thing that I think Windows does good is seamlessly browsing different partitions. All the accessible partitions are automatically mounted, they are right in front of your face in explorer, and just accessing different partitions is much easier on Windows. Installing programs to different partitions is also quite easy if the installer supports it.

On Linux though, there is more emphasis on the root partition, and other partitions have to be mounted in specific folders, and then there is permissions and all, like, its not that seamless. Upon that, I am just wondering now that how can I install packages through apt or pacman on different partitions? And is there a way to make this partition switching more seamless?
 


On Linux though, there is more emphasis on the root partition, and other partitions have to be mounted in specific folders, and then there is permissions and all, like, its not that seamless. Upon that, I am just wondering now that how can I install packages through apt or pacman on different partitions?
Which is great because on windowz you have no such freedom because M$ decides on behalf of users what's the default.

If you want to install to different partitions you need to partition your OS on multiple partitions and decide upfront the size of partitions.
Your problem is lack of drive space which can be solved by removing windowz and then repartition your OS.
 
If you want to install to different partitions you need to partition your OS on multiple partitions and decide upfront the size of partitions.
What do you mean by "partition your OS on multiple partitions"? Like having /bin on different partition, /home on different, like that? That might be a way but I want to mainly keep my programs on my root partition and only use the other partition when I am out of space.
 
What do you mean by "partition your OS on multiple partitions"? Like having /bin on different partition, /home on different, like that?
Yes, exactly.

That might be a way but I want to mainly keep my programs on my root partition and only use the other partition when I am out of space.
Here is a catch, Windows let's you install to non system partitions but if you happen to reinstall system those partitions will be useless and you'll need to reinstall everything on them.

Linux doesn't let you this but let's you install the OS to multiple partitions, when you reinstall system you can reuse those partitions and it will work just fine.

So in other words Windows let's you shoot yourself in the foot because your installed data will be useless in case of having to reinstall.

I don't think you can do what you want.
 
What do you mean by "partition your OS on multiple partitions"? Like having /bin on different partition, /home on different, like that?
Btw. you only need /home partition to be separated to retain personal data, the rest of system is better put on a single partition because if you reinstall system it's better to reinstall it completely.

To partition it further depends on your needs and might not be always useful.
 
@CaffeineAddict :-

I guess what the OP wants to do wouldn't be that easy for mainstream distros - especially if space is an issue! - but in 'Puppy', with the devolpment of our 'portable-apps' ecosystem you CAN (if you so wish) install stuff all over the place......and it just 'works'.

That's because through some clever use of the XDG protocol, we can 'trick' the app into thinking that its self-contained directory IS, in fact, the /home/user directory. Thus, all config stuff also gets written to that same directory.....which in turn has the distinct advantage of being able to locate & run the things from anywhere you want.

You're NOT limited to the 'standard', default locations for things.....meaning you can 'install' the 'portables' to a flash drive (which you can carry around in your pocket), and you can plug that into any 'Puppy' box, anywhere you have one set-up, and you just KNOW it'll function, OOTB. Which also has the added advantage of making any Puppy system unbelievably flexible.

I wish I could say they would run in any Linux distro, but some of the config stuff is, unfortunately, specific to 'our Pup's' rather unique way of doing things.


Mike. ;)
 
@CaffeineAddict

Also, the partition switching is still an annoying problem. Right now, I wanted to download a torrent file using transmission or aria2c on a different partition, then if I auto mount that partition in Ubuntu, which then gets mounted under /media/<username>/, I am running into many permission problems. Even in root, I am running in some problems for some reason. This makes it so difficult, I hate it. How do I mount a partition such that I don't have to worry for any permissions?
 
@CaffeineAddict

I just mounted that partition under my home directory, and it works fine. I think that this is probably not very safe, and that is why this is not the default way, but it is annoying about the permissions.
 
Also, the partition switching is still an annoying problem. Right now, I wanted to download a torrent file using transmission or aria2c on a different partition, then if I auto mount that partition in Ubuntu, which then gets mounted under /media/<username>/, I am running into many permission problems. Even in root, I am running in some problems for some reason. This makes it so difficult, I hate it. How do I mount a partition such that I don't have to worry for any permissions?
You can define partitions and mount points in /etc/fstab, for example you could add something like this.
Code:
/dev/sdc1 /mnt/Downloads ext4 defaults 1 2
That will make sure that partition will always mount on that location, the only you think you do have to is set the ownership and permissions for the files on the partition to your needs to match that of your user/group or whatever needs to read/write there.
 
Even in root, I am running in some problems for some reason. This makes it so difficult, I hate it. How do I mount a partition such that I don't have to worry for any permissions?
You probably want to modify permissions for "other" users, for ex if your partition is mounted at:
/media/<username>/<PartitionName> then:

Bash:
sudo chmod o=rwx -R /media/<username>/<PartitionName>

This will recursively allow every user do to what ever it wants to files and directories on that filesystem on the partition.

Just don't do this on your root partition or any sub-directory under root! it's OK for external drives or data drives.
 
You can define partitions and mount points in /etc/fstab, for example you could add something like this.
And if I remember correctly a graphical disks manager should also have the options for your to configure to add how you want to mount something, ie: Gnome disks.
 
@f33dm3bits @CaffeineAddict

Yes, thank you for helping me. But I still hate the fact that I need to these "advanced" things for something very basic task and that newbies wouldn't even be able to figure it out. Instead of setting the permissions and all that, I would just mount it in my home directory, but that might not be the best idea so I might improvise but I think that's how I will do it for now.
 
But I still hate the fact that I need to these "advanced" things for something very basic task
Mounting filesystems is considered something basic in Linux. In Windows when you add a disk and format it it automatically gets a drive name, in Linux that can work too but then it gets a location where you can't choose where you want it mounted, it will then auto-mount under /run/media/username/something. If you want to choose exactly where you want to mount it you will have to configure the mount manually, you can do that with a disk utility which is similar to the the Windows Disk manager.


I actually just tried it out and when you use a tool like Gnome Disk manager and you can choose where you want to to mount the filesystem and it will configure it to mount it as your user so you won't have to do anything with ownership or permissions. I've been using the command-line for so many things for so long I just find that easier that makes it that I don't know everything what is possible with some of the GUI tools. But try it for yourself.

Also Linux is different from Windows they don't work the same and have different concepts of doing things and things that are similar. You will have to learn to things differently and don't always compare the way Windows does things to the way Linux does it. They are two different operating systems, if you are looking for a new Windows just stick with Windows because you aren't going to find it with Linux.
 
Last edited:
But I still hate the fact that I need to these "advanced" things for something very basic task and that newbies wouldn't even be able to figure it out.
I was noob too but spent hours to understand fs permissions and how to use chmod, so in my case I don't understand why other newbies don't spend their time as well.
 
Mounting file systems in Linux is pretty easy. You just decide how big you want your partitions to be, create file systems on them, and specify them in /etc/fstab along with their options. I use a script at boot time to force Linux to get it right. That way each partition is mounted where and how I want it to be. I split things up into different file systems which has been a real benefit. When something goes wrong with just one of them the damage is isolated to that file system and doesn't screw up the root file system. It makes recovering a lot easier. I use 14 different Linux file systems, each using ext4. You can mount stuff just about anywhere you want to. It doesn't have to be mounted in /media/ or /cd/ or /dvd/ or whatever else. I created a handful of mount points to use. It did cause real problems when my /backup file system had trouble though. I had to restore that from a protected backup in cold storage. If you want a nice display to look at try using /usr/bin/df.

Signed,

Matthew Campbell
 
Maybe you should stick with windoze because it's so good.
1722730745432.gif
 
Ok, ignore this if it isn't germain to the thread, but. Is this thread about running out of room in /? Or, is it about difficulty mounting partitions?
If / is running out of room, then you need to resize partitions. Make / larger by making an adjacent partition smaller.
If it's about having trouble mounting a partition, I found it simple to do, with almost no research. And I'm sure no brainiac!
When I added a second SSD, I formatted it into two partitions, data01 and data02. Mounting them was very simple. In my home directory, I created 2 folders, data01 and data02. I opened disks, and the mount points for the new partitions were the two new folders.
I just don't know how it could be any easier. Am I missing something?
 
None of this make much sense: no matter of OS one can browse any partition is mounted. Nowadays Windows as well Linux have single partition with folders for root, Documents, Temp and so on by default unless user will make changes during installation wich by the way is not so easy in Windows. Of course one can start partition manager to check.

Next try to install any large software e.g. LibreOffice or MS Office in different partition, even folder. The installer is not asking where one wants to install executable. So I don't understand OP request as in Windows there is no choice.
In fact in Linux one can do this with some effort, in Windows, this is not possible.
Unless OP wants to change default Documents folder location... but first he needs to partition disk then he can move default Documents folder and then do some editing before this will work automatically. So by comparison all this is easier to do in Linux.
 


Top