Librem Phone - SD Card Supported File Systems

I currently have an Android phone, but I pre-ordered a Librem phone. However, I ran into some issues with the SD card file system support on Android and would like Purism to think about SD card and supported file systems for the Librem Phone. Next I will provide a use case based on my experience with Android. The indent is, that Purism can do a better job implementing SD card file system support on the Librem Phone.

My objective was to have Wikipedia offline on my phone. The reason being I need Wikipedia quite a lot while travelling to lookup different things I encounter (airports, cities, trains, buses, museums, historical sites etc.). The issue is, that I often do not have a great internet connection or no internet connection at all, while travelling. Additionally, internet packages for the phone can be really expensive.

My idea was to simply download and install the entire Wikipedia (without videos) on my phone. Today, SD cards are cheap and offer a lot of storage. My plan was:

  • buy a SD card with a lot of storage
  • download Wikipedia
  • install an application to read the Wikipedia

I came across the Kiwix project, which offers the entire Wikipedia and other projects as compressed ZIM files. In addition, a Kiwix reader for Android can be found on F-Droid.

I started to execute my plan:

  1. I downloaded the English Wikipedia (84 GB) via torrent.
  2. Bought a SD card with a total capacity of around 250 GB
  3. Formatted the SD card using the F2FS file system.

The last point was when the trouble started. Yes, my phone accepted the F2FS supported card, with an error I ignored at first. I use Linage OS 16, which supports F2FS in the kernel, no problem here.

Then I decided to first run a test with a music file and a PDF file, just to see if it works. I copied them over from my laptop on to my SD card (using SD card reader on my laptop). I was able to see the files, but when I tried to open them I got an error. The error was that the file path does not exist. I ran the same test with NTFS, ext4 and exFAT. No success, always the same behaviour. I even used smaller SD cards (32 GB and 64 GB), just to make sure there is no issue with my 250 GB SD card.

Frustrated with the negative results I decided to format the SD card via Android, instead of using GParted or GNOME Disks on my laptop. The result was that Android uses FAT32 by default. The issue with FAT32 is, the maximum file size is limited to 4 GB. Therefore, there is no chance for me to copy over a 84 GB file. Regardless, I tried it and got the expected result. The copy process simply stopped at 4 GB.

Keep in mind that FAT32 was used first introduced in Windows 95 (year: 1996). How can such an file system be used for SD cards in 2019. We have several better alternatives. In addition, my internal phone storage is formatted using ext4.

The only issue with file systems such as ext4 and F2FS is, they use a permission system. However, a solution would be to simply change the file permissions/owner to the phone user, every time the SD card is inserted in the phone. Maybe there is a better solution.

My request to Purism is, please allow to use external SD card formatted with a more modern file system. A file system which can handle files bigger than 4 GB and supports Unicode names. I really want to have the offline Wikipedia on my future Librem phone.

2 Likes

hello ! do you have a link for that ? maybe also edit OP.

1 Like

@reC you can find all downloads here: https://wiki.kiwix.org/wiki/Content_in_all_languages

3 Likes

Librem 5 will run a GNU/Linux system, not a Java virtual machine running over the Linux Kernel like Android, you’ll be able to use any format you can use in any other GNU/Linux system

6 Likes

isnt is a issue of your card reader ?

maybe try to copy to the SD card from your phone?

Maybe you can also format it to f2fs on android if you have su on it. you can download f2fs-tools here https://packages.debian.org/sid/f2fs-tools, choose your phone’s architecture for it, use mkfs.f2fs to format your card.

1 Like

For a workaround I think you can use a usb storage device to replace the SD card, and use usb OTG to read from it. Lineage support it, and probably librem 5 will.

1 Like

No, uzanto is right. There is no issue and no need for a workaround. Any FS supported by PureOS should work just fine without Purism needing to invest time.
That’s just one of the benefits of using a standard Linux based system.
Even a graphical formatting tool has already been demonstrated.

6 Likes

“for a workaround” I mean for a workaround of balduin’s current phone and its linage os.

Btw, linage os DOES support F2FS, it even supports using F2FS as rootfs. This post IS probably related to a hardware issue of SD cards that might probably affect PureOS as well. This kind of things is more than common on people’s daily use of SD cards.

Actually, I would rather suggest that “avoid SD cards, they sucks”.

2 Likes

wait is this the same offline wikipedia as the regular wikipedia that we all know and love ?

it says “kiwix” what is this ?

1 Like

@yw662 yes, F2FS is supported by Lineage OS. However, the apps which I tried where unable to read the file “wrong path” or “error no file”. I could invest a lot more time into it, but I expect to get my Librem phone in 2019 or 2020.

Furthermore, my main point was: Purism should do a better job and make it easy to use a or several proper file systems for external SD cards.
The hardest part is probably to make sure, that if you copy files from your computer to your SD card, that the files get the right permission once you insert your SD card back into your phone.
Otherwise the user will have to adjust the permissions on the phone. It would be better for the user experience if this would be done automatically or semi-automatically.

For my use case they would have been perfect. SD cards are cheap and have a lot of storage.

1 Like

Yes, the same Wikipedia. You can decide if you want to have only text or include images as well, when you download it from the Kiwix website.

Additionally, I assume the reader will display pages a little different compared to your browser.

1 Like

Given that this is Wikipedia (i.e. public content and not confidential) wouldn’t you just make the permissions ugo=rx on all files and then it doesn’t matter what user or group ownership is on any file? To ensure correct permissions without doing anything, you may need to check your umask before copying the files on. However I admit that I haven’t played with F2FS so maybe there is something specific going on. Would it work if you used an ext4 file system instead?

2 Likes