Good Morning;
Have had FreedomBox running for several days now, and it’s working splendid. My issue is that installing container apps; they are installed by default on the system hard drive - I wish to use attached storage drives, never my system drive. How do I move a container app?
I don’t think you can. Containerized simply means there are no dependencies or other software to install. They do however stick config files and data here and there on whatever drive they were set up to use.
You have to manually set up where the container and it’s data will go on initial container configuration.
At least that’s how I understand it.
1 Like
Really? One would think an app like FreedomBox would assume there are storage drives in addition to the system drive. For example Nextcloud, on FreedomBox installs as a container app. I’m pretty sure it didn’t give me the option to pick other mounted drives. Why would one install nextcloud on a system drive as opposed to RAID/or other mounted drives?! Hmm. Thanks for the response tho. Not a lot of traffic here, aye.
I haven’t found a setting in the FreedomBox UI for this either, but since the container apps run on Podman, one workaround that should work is moving Podman’s storage onto the data drive and bind-mounting it back, so the apps don’t need to know anything changed.
Roughly: take a backup first, stop the container app, then copy /var/lib/containers to a folder on the attached drive (rsync -aHAX keeps the ownership and SELinux/ACL bits intact). After that, rename the old folder, create an empty /var/lib/containers and add a bind mount line to /etc/fstab pointing it at the new location. Mount it, check the app starts, and only then delete the old copy.
The important bit is that the data drive has to be mounted before the containers start at boot, otherwise they’ll come up against an empty folder. With the bind mount listed in fstab after the drive’s own entry, systemd should sort out the order, but it’s worth rebooting once to confirm the app comes back with its data.
2 Likes
Thank-you for such a detailed message, really appreciate it. Unfortunately, I have moved on, since I didn’t know how to move it. I’m now using UnRaid. More control from the web interface.