Moving flathub to sdcard and using a softlink

Is it possible to move flathub packages to the SD card and then use a softlink to maintain functionality? The point of this being freeing up significant space on the emmc.

something like:
mv /var/lib/flatpak /media/purism/sdcard/flatpak
ln -s /media/purism/sdcard/flatpak /var/lib/flatpak
flatpak refresh

Would something like this work?

3 Likes

I think it has been discussed before in this forum.

3 Likes

It was solved in: How to make flatpak or even system packages use SD card

6 Likes

The linked solution works but, if you don’t want to go about changing configuration, you can also reach the same by rsyncing the folder to the SD and then mapping via fstab, which is how I did it.

7 Likes

I am having issues with this. I got it kind of working but I still get errors were directories are not able to made or permissions set.

Has anyone been using this a lot? after installing something to the sdcard do you get a desktop file for it in the launcher?

1 Like

Maybe. I don’t use flatpaks. I will say that bind mounts are much better than directory softlinks … which can easily fail due to directory navigation issues. You can try it out ( sudo mount --bind /media/purism/sdcard/flatpak /var/lib/flatpak ) … and then add a line to your fstab where you have “bind” as one of your options:

/media/purism/sdcard/flatpak /var/lib/flatpak none defaults,bind 0 0

[ You might want to add arguments to the options (e.g. nofail) which allow the booting process to continue even if there is no sdcard …]

3 Likes

My method has been working for me for a few months already - I didn’t change the flatpak settings, just moved everything to the SD card via rsync and mounted via fstab.

The icons show on the desktop just fine.

2 Likes

could you detail what you did exactly?

1 Like