Ask / Submit
40

Use alternative file systems for SD card

asked 2014-01-04 00:28:21 +0300

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

updated 2014-12-05 22:30:30 +0300

pulsar gravatar image

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]

edit retag flag offensive close delete

Comments

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 )edit
1

I 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 )edit
2

Perhaps 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 )edit
5

Does 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 )edit
1

I 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

2 Answers

Sort by » oldest newest most voted
7

answered 2014-01-04 13:53:20 +0300

aegis gravatar image

The main problem is always going to be compatibility with Windows, Mac and consumer electronics like cameras and TVs which rely on following the sd card standards (eg. exFAT is a mandatory part of the SDxc standard).

If you're happy to throw that out of the window then you can use any filesystem.

I would probably be one of those people who didn't swap their cards much also but for the fact I'm on a Mac and currently Sailfish and OSX MTP support over USB is broken so I'm swapping it a LOT.

Sailfish also has no DLNA or Airplay support so there's no way other than removing the card and sticking it in my Bravia TV or Marantz media center to play content from my phone.

Ditching FAT opens up a whole lot of other issues. Giving users the choice is still important.

edit flag offensive delete publish link more

Comments

wouldn't DLNA and airplay support be pretty easy to do in develmode?

AL13N ( 2014-01-04 16:23:19 +0300 )edit
1

@aegis also, you should really add this to complications and not as an answer

AL13N ( 2014-01-04 16:24:32 +0300 )edit
2

To be honest, I found myself sharing SD cards very often ... when they were fullsize SD cards. µSD are much more annoying to swap, not to mention that I feel as if the slot on the Jolla is going to break at any moment.

javispedro ( 2014-01-04 16:35:14 +0300 )edit
3

Also, I'd center on getting OSX's MTP support fixed. Bringing back USB Mass Storage on the Jolla means we have to reintroduce hacks like those in the N9, e.g. "This application can't be used when the device is connected"

javispedro ( 2014-01-04 16:36:25 +0300 )edit

oops, yes that should have been a comment not an answer. I was typing on my Jolla and must have hit the wrong link. Then again, maybe “Choice” is the answer.

aegis ( 2014-01-04 18:55:03 +0300 )edit
1

answered 2014-11-14 17:50:43 +0300

GreatEmerald gravatar image

Now that issue #1112 has been fixed, EXT4 and Btrfs cards are automounted fine.

Well, mostly – you need to create the Btrfs partition with the mkfs.btrfs option -O ^extref or else it won't mount (that feature isn't supported on the Jolla but is default for new partitions).

edit flag offensive delete publish link more

Comments

Ehrm what? btrfs mounts just fine without any additional options. What card are you talking about? What was on there before? Did you format /dev/mmcblk1p1?

chemist ( 2014-12-05 12:59:43 +0300 )edit

The current Jolla kernel does not support the extref Btrfs feature due to its age. Current btrfs-progs have it enabled by default. If you don't disable that feature at mkfs time, the Jolla dmesg will say BTRFS: couldn't mount because of unsupported optional features (40).Also see this.

GreatEmerald ( 2014-12-05 15:03:09 +0300 )edit

You formatted to btrfs on another computer? I did on the device.

chemist ( 2014-12-05 16:41:19 +0300 )edit
1

Yes, of course on another computer (running openSUSE 13.2, FIY). The Jolla itself is probably shipping an older or modified btrfs-progs that doesn't have that feature enabled.

GreatEmerald ( 2014-12-05 16:58:36 +0300 )edit
Login/Signup to Answer

Question tools

Follow
12 followers

Stats

Asked: 2014-01-04 00:28:21 +0300

Seen: 4,774 times

Last updated: Dec 05 '14