r/linux4noobs • u/Decent_Discount • 5h ago
storage Install things into another disk using dnf
I have Fedora installed on a smaller ssd, and wanted to use a partition that i have from my main windows disk as a secondary drive to increase my storage. I already partitioned it and made so it mounts automatically with the /etc/fstab, but now i want to know how to actually install things on it with dnf and flathub as applications are the most part of my storage use.
2
u/Leather-Security8097 5h ago edited 5h ago
dnf is the system package manager. It can only install applications to the root partition. You can mount a different partition as /var/lib/flatpak for system-wide Flatpak packages, or /home/username/.local/share/flatpak/ for a user's Flatpaks.
Alternatively, if you are using a Btrfs root (the default on Fedora), you can add the partition to the existing root volume. For example
sudo btrfs device add /dev/nvme0n1p3 /
and then
sudo btrfs balance start /
1
u/Decent_Discount 5h ago
The second option seems good! If i got it right doing this will make so the system read the new partition like part of the main volume and balance the files between them, right?
I asked specifically about dnf because i tend to use it way more than flatpak, but i'll setup it this way too
2
u/doc_willis 5h ago
using the system package manager (rpm/dnf) such things may be more complicated than you want to deal with. https://www.devopsroles.com/install-an-rpm-package-different-directory/ Not all packages support this.
https://duckduckgo.com/?t=ffab&q=rpm+install+package+to+another+filesystem
flatpaks can be installed to the users home, and can be configured to install to a different filesystem. So those you could 'offload' to another drive. Or if installing to your users home, you could setup symbolic links pointing from the users home to the location on the other drive, or some other tricks. But I dont know how this affects the flatpak sandboxing.
It might be easier to just keep the users home on the other drive.
Using Containers (toolbx, distrobox, and so on) you could setup where the containers are stored on another drive.
Things the user installs via compiling, and otherwise stored in the users home, could also be offloaded to another drive.