Use alternative file systems for SD card
asked 2014-01-04 00:28:21 +0300
This post is a wiki. Anyone with karma >75 is welcome to improve it.
Few people seem to swap µSD cards these days, and USB mass storage, the last remaining reason for "user-visible" storage to be using FAT, is a goner.
It's time to ditch FAT, exFAT and similar trash, and embrace the pletora of filesystems the stock kernel configuration on the Jolla device has to offer: ext4, fat, btrfs, and .. btrfs.
Ideas
Format µSD entirely (supperfloppy style) as a btrfs volume and create subvolumes for MyDocs (/media/...) , Aliendalvik garbage (/mnt/sdcard), the Debian/Maemo chroot (cough cough), etc. Manually add /media/sdcard as an indexing root for Tracker in gsettings (not much different from what the stock system does).
Use µSD to extend main/root btrfs volume, so that the extra space just becomes available magically to the phone, no need to fiddle with directories and mount points! But if you then decide to remove the SD card you need to reflash your device. WindowsPhone7 did exactly this, so don't act surprised.
Use µSD to btrfs balance (raid1) main/root btrfs volume (equal partitions of the 16GB), so that backup is useful if your phone becomes dead. Then, the additional space can be used to eg have this aliendalvik garbage.
LVM, but lvm-tools is missing on the device! Anything but yet another MBR-style partition table.
[your idea here, or in the comments below]
Complications
/usr/sbin/mount-sd.sh recognizes supperfloppies, but hardcodes "uid=$x,gid=$x" parameters preventing automatic mounting of most POSIXy filesystems. One option is to kill it (rm /etc/udev/rules.d/90-mount-sd.rules) and hardcode the partitions/mounts into /etc/fstab (or in systemd mount/unit files so that they won't get overwritten during SSU). Alternatively, the mount-sd.sh script can be made smarter using additional information from the udev probe results (e.g. ID_FS_TYPE)..How to handle SD removal when doing any of the weird things above?
Tracker. Why does tracker-sd-indexing.sh set "index-removable-devices" to yes but also manually add the SD card mountpoint to the indexed directory list? Supposedly, even without udisks, the standard GIO "unix" mount monitor should recognize stuff under /run/media/$USER. (But from reading the source code possibly not in /run/media/$UID -- why does Sailfish do this?).[your problem here]
I agree with btrfs or ext* (ext2 is said to be better for flash than ext4, but I am not an expert when it comes to cheap flash-cards). LVM is IMHO overkill: bad things happen to memory-cards and mobile devices, and we should not make it more complex than needed for users to do data recovery.
Cmdr_Zod ( 2014-01-04 00:47:23 +0300 )editI say no, did you forget major compatiblity, i can't read the uSD card anywhere except on Sailfish ? it acceptable only as an option because private use is almost for share except professional case require more security
redge73 ( 2014-01-04 01:16:55 +0300 )editPerhaps an easy, on-device method of re-partitioning of the card to allow for an initial FAT partition that can be shared and swapped between devices, and one or more partitions formatted with the more robust file systems available to the Jolla. This would allow for multiple operating systems too.
qole ( 2014-01-04 01:33:15 +0300 )editDoes anyone still really "share" the µSD with any other device? And by that I mean, physically remove it from the Jolla device? (any other "sharing" is independent of the card's filesystem) I certainly don't -- but if you do, then my thesis (Few people seem to swap µSD cards these days) is wrong.
javispedro ( 2014-01-04 01:56:13 +0300 )editI think your thesis is correct, but if you throw a bone to the naysayers, it will be harder to argue against this idea :)
qole ( 2014-01-04 02:14:23 +0300 )edit