32 GB was too small even for 2017, and $2k is too much for twice the storage capacity. I just bought a large capacity microSD, and I am going to attempt to make this device usable, storage-wise as my next project. It is a painpoint that this is a project, and not something easily configurable in the GUI settings.
I will try to document the steps I am doing here, and if people have suggestions on how to accomplish it, or other advice, appreciate your contribution.
My goals are:
OS: Install ARM PureOS (ideally Crimson), with a single LUKS encryption password at boot that unlocks both the internal and external storage, to the Librem 5
Folders: Have the folders under the user mapped somehow to the microSD, such that when I click the folders on the sidepane of the files app (Documents/Downloads/Music/Pictures/Videos), it takes me to the microSD (so internal storage may be /user/shortcuts so that they donāt take up space there, while external may be /user/folders or something. Firefox & Torrents would be remapped to download there.
Flatpak Apps: Have flatpaks install by default to the external storage, with desktop shortcuts that appear in the app drawer
Waydroid: Install Waydroid on the internal storage for speed, but figure out a way to have apks movable to the external storage
App Binaries: Potentially have binaries install there too, including moving over existing programs, but is probably not a good idea to do, and thus not worth the effort considering the complexity & maintenance likely required on top of these not taking up too much space if most apps are installed via flatpak
At this point, I am obligated to remind you to externally back up your important files before performing any of these experimental procedures. The last resource requires the latest DAS U-Boot firmware image, which has been included in the above steps to flashing Crimson on the Librem 5.
I forgot all about these over the years, but I have been wanting to do this myself with a slightly different configuration.
Automatic Disk Decryption of microSD
I was able to accomplish this entirely via GUI in the Disks app.
Under SD Card Reader in Disks, format your disk to EXT4, and set it up with LUKS encryption; I used the same decryption password, but you donāt need to for this to work.
Select the EXT4 partition, click the gear icon, then Edit Mount Options
Select Mount at System Startup, and optionally Show in User Interface
Rotate your screen to landscape so you can access and click the OK button
Select the LUKS partition, click the gear icon, then Edit Encryption Options, and enter your login password to authenticate
Select Unlock at System Startup, and do the same screen rotation thing to click OK
Limitations: Currently there is a bug specifically on the Librem 5, where the microSD will become unreadable usually/always after coming out of suspend. The Librem 14 does not suffer from the same issue.
With the only exception that you replace microSD_EXT4_UUID with the UUID of your physical disk (not the LUKS encrypted UUID). This can be found in the Disks app.
Install your flatpak directory to this disk. In this case, we will be adding Flathub to it via command line. If you have a previous Flathub repo, remove it so that you can install to the microSD by default
This references the .conf file we created earlier, where it associates microSD with the location we want
Go to PureOS store, and all apps from flathub will install to your secondary disk. There is a limitation (I donāt recall with what specifically), where you cannot change it to display differently as System or User, to instead say microSD unfortunately, but so long as the only install of Flathub in this case is to the microSD, system installations should install there. However, if installing from the command line, you can reference this location by name, regardless of where you install your repo to manually install to it, or a different location.
They will automatically appear in your app drawer without any additional steps required.
You can double check it is installing to the right location by checking disk usage on disks, download a big app, and see if there is less space on the microSD. You can also check by looking at the microSD flatpak folder itself too, to see if your app installed there.
This can be repeated for the Purism Flatpaks too if you want, after removing and re-adding it.
Alternatives & Comments
In addition to what was linked above by FranklyFlawless, someone else mentioned that they just have the entire OS running from a microSD, which you could do as well. Then youād need to hold I think volume down as you boot, to get into that installation. The advantage of this, is it makes it easy to have a secondary OS on the eMMC in the phone that you can use if asked by prying eyes, and a secret one you can use encrypted with your real stuff on there. Iām sure there are other methods different, or that can be used in combination with this as well, such as with the SC.
I havenāt mapped the default Music/Documents/Photos/Videos folders to the microSD, but imagine this could be solved with a symbolic link.
I havenāt noticed any deal-breaking slowdowns from using Flatpaks from the microSD, but Iām sure they run a little slower from doing so, and maybe more noticable with Waydroid if you did the model where your OS is on the microSD. It is too complex a task to have Waydroid on the microSD without having the whole OS there too. The furthest I have gotten with Waydroid, is the ability to access folders on Linux, from the Android Java virtual OS. Perhaps there is a way to āInstall to microSDā from Android, such that APKs also install to your microSD. Havenāt explored it in detail yet.
In addition to the issue mentioned above with suspend on the Librem 5, which will either require frequent restarts or keeping your phone from going to suspend (we will need to wait for Purismās fix), there are also some other issues that I havenāt figured out yet, but might be doable:
Apps that look for flatpaks in their default install location (e.g. Flatseal, and others), donāt recognize the flatpaks installed already. Iām thinking maybe this can be solved with a symbolic link between the two directories so the OS thinks that they are in the default location, but this could equally cause different issues
Apps cannot access libsecret on the eMMC. This means apps like Authenticator, Flare, Fractal, Tuba, etcā¦ that rely on it, are unusable.
I donāt know how to solve these 2 issues yet, but if someone figured them out, please feel free to share (or correct my steps thus-far), with what solution youāve used.
I have tried following your steps but I am getting hung up at this:
purism@pureos:~$ flatpak remote-add --if-not-exists --installation=microSD flathubhttps://dl.flathub.org/repo/flathub.flatpakrepo error: Creating repo: mkdirat: No such file or directory purism@pureos:~$
Nevermind, figured that out.
Now the problem is it wonāt allow me to install anything because of gpg issues.
purism@pureos:~$ flatpak install lugsole
Looking for matchesā¦
F: An error was encountered searching remote āflathubā for ālugsoleā: Unable to load summary from remote flathub: Signature made Tue 13 Feb 2024 16:19:15 MST using RSA key ID 562702E9E3ED7EE8
Can't check signature: public key not found
error: No remote refs found similar to ālugsoleā
purism@pureos:~$
I solved the flatpak issue by creating a symlink between where the OS expects flatpak to be, vs where they are on the microSD.
The OS tries to recreate the folders on the eMMC, so you have to delete them, then simlink immediately afterwards to avoid a conflict. This also seems to resolve the second issue as well, though it is possible it was solved in a different unrelated way such as a package update.