sunnuntai 7. elokuuta 2016

File save safety: the reason


Some time ago I wrote about saving a file in a way which wouldn't lose previously saved data if saving fails. I said that I don't know what actually happened to the phone then; everything behaved like disk was full but df indicated it wasn't; I still had about 3GB free on internal storage.

Well, yesterday it happened again, and I got message about it mentioning app registry. That was enough for me to chase the rabbit down the hole in search for answers. As it turns out, Jolla phone uses btrfs as main file system, and it seems that btrfs is .. fragile .. whenever disk gets more than halfway full (and getting catastrophically worse when getting nearer to full), especially when dealing with small-ish devices (like 16GB Jolla has as internal storage). Typical tools, like df - indicate plenty of space available but btrfs has its own internal mechanism for allocation and disk actually is "full", resulting inability to write new files. Well, fsck.

So, not exactly great choice for phone storage, as people tend to have their devices full of all kinds of things. No idea why that was chosen, really, as I haven't seen any explanation for that. But at least there is microSD slot that can be used as storage for media, which tends to be the biggest consumer of space anyway.

Fortunately there are tools to mitigate the situation (btrfs-balancer and others) already installed on phone. Unfortunately those need things to be done from command line. While Jolla has terminal built in, the problem is that I don't expect most people to be able to do that. Or even be willing to do that, really.

I guess there is some very good feature in btrfs that is the reason for developers choosing it over more typical filesystems, but at this point it would have to be some mind-blowingly great reason to counter failure of this kind. Not cool, Jolla devs, not cool at all.




Ei kommentteja:

Lähetä kommentti