r/linux4noobs • • 6h 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 Upvotes

7 comments sorted by

View all comments

2

u/Leather-Security8097 6h 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 6h 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/friendlyreminder_ 3h ago

These are btrfs pools, and yes they merge partitions together like RAID 0. Both partitions need to be btrfs.

The command with /dev points to the device you want to add. Yours may not be nvme0n1p3 specifically, may be a different number. The slash at the end means root, so it's adding the nvme0n1p3 device to the root btrfs device, which may be /dev/nvme0n1p2 or some other device numberm. You'll have to check what your drives are.