We have moved to a new Sailfish OS Forum. Please start new discussions there.
5

Why did Jolla choose btrfs? [answered]

asked 2015-05-15 09:15:39 +0300

this post is marked as community wiki

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

updated 2015-05-15 20:40:20 +0300

rdmo gravatar image

Well, I was reading an old lwn article on BTRFS and was wondering although many of Linux distros are yet to default to this FS, Jolla chose it. I am sure there are valid technical advantages but will be good to know some of the rationale. Is it more suited for mobile device? Am bit of Linux n00b, so please be kind.

I came across this http://events.linuxfoundation.org/sites/events/files/slides/ELC2014.pdf but since it is a slide not very comprehensive text is available.

Any references will be useful too. Thanks.

edit retag flag offensive reopen delete

The question has been closed for the following reason "the question is answered, an answer was accepted" by anandrkris
close date 2016-02-03 07:02:59.072900

Comments

3

Because it was one of the most difficult options, and they wanted to show that Sailfish OS can handle just about anything?

simo ( 2015-05-15 11:57:47 +0300 )edit

and also its users :-)

g7 ( 2015-05-15 12:55:22 +0300 )edit

4 Answers

Sort by » oldest newest most voted
5

answered 2015-05-15 15:04:32 +0300

MartinK gravatar image

BTRFS was selected most probably due to support for multiple backing block devices (the Jolla smartphone storage has a ton of small partitions by default) and snapshot support. The general trend of future proofing by using as cutting edge stuff as possible might have also played a role (systemd, wayland, etc.).

But modern LVM has no issues with using many different backing devices and can do CoW snapshots just like btrfs, but #unlike with btrfs with a much lower chance of loosing all your data, as it is used widely for critical enterprise data storage. :)

LVM also does not force you to use a specific filesystem, which means that it can #unlike btrfs host a swap partition, LUKS, FAT32 for mass-storage export, XFS, thin-pool for Docker, etc.

Recent LVM has many new interesting features, such as built in caching and RAID support, so you can do stuff like:

  • setup RAID1 LV with extents on both internal NAND and uSD - if either the NAND or uSD dies, your data is still safe and your reads should be faster as long as both work fine :)
  • setup a "fast" RAID0 LV with extents on the internal NAND and uSD card
  • setup LVM cache for the uSD card with a LV on the NAND acting as a "fast" caching device for a "slow" LV on uSD
edit flag offensive delete publish link more

Comments

Does it have block-level check-summing? I really would like block-level check-summing, I have quite a few files that have gotten bit-errors over the years. It seems phone's NANDs and µSDs are no where near as reliable as simple SATA drives.

00prometheus ( 2015-05-15 16:50:23 +0300 )edit
1

Thanks MartinK for the answer. I will try to read more and digest all of this :)

anandrkris ( 2015-05-15 19:41:48 +0300 )edit
5

answered 2015-05-15 18:27:23 +0300

max gravatar image

SailfishOS uses Mer and Mer is based on MeeGo. MeeGo made it fliesystem choice in 2010 https://lwn.net/Articles/387196/

In my opinion Btrfs was the right choice at this time and still is the right choice for a mobile device.

edit flag offensive delete publish link more

Comments

3

I don't think btrfs got much better since 2010. ;-)

Or at least there is still a significant amount of worrying issues constantly being reported on the btrfs mailing list even after 6 years of being in the Kernel.

MartinK ( 2015-05-16 03:10:07 +0300 )edit
4

answered 2015-05-15 09:51:50 +0300

g7 gravatar image

Not a Jolla dev, but I guess one of the reasons (perhaps the major?) they chose btrfs is the snapshot feature.

The factory reset feature simply resets the "factory snapshot" of the device (and that's why when resetting the version is taken back to the one the device shipped with).

Btrfs isn't the only filesystem that does that though, you can roughly achieve the same with ext4 + LVM (which I think it will be used in the tablet).

edit flag offensive delete publish link more

Comments

Doesn't this mean that they are stuck with the btrfs since they don't have any other way to do factory reset? What about user backups, are they done the same way using snapshots? IF yes then they cannot change the filesystem anymore. Consumer has to learn how to btrfs balance. Maybe Jolla could automate balance operation, and force run it periodically.

alloj ( 2015-05-15 13:00:57 +0300 )edit
6

On the Jolla phone, yes we are stuck with btrfs. Unless of course they release flashable images, but that won't happen due to the Qualcomm blobs in them that can't be redistributed.

On the Jolla tablet, AFAIK they are switching to ext4 + LVM (that offers snapshots too) so no btrfs there.

The latest upgrade (1.1.4) automatically performs the balance Tuesdays mornings at 3 AM (if a charger is connected). I guess they are working to make a balance also before a system upgrade to avoid bricking devices (if they haven't already implemented that in the latest upgrade).

g7 ( 2015-05-15 13:17:21 +0300 )edit
2

User backups don't depend on btrfs snapshots, they are saved to ~/.vault if I'm not mistaken.

g7 ( 2015-05-15 13:20:59 +0300 )edit

@g7 do you have any source for the ext4+LVM info?

tad ( 2015-05-15 19:44:38 +0300 )edit

@tad initrd-helpers is being ported to support lvmtools. In particular, a new script that handles the factory reset operation using lvmtools appeared recently in that very same branch.

g7 ( 2015-05-15 20:02:56 +0300 )edit
4

answered 2015-05-15 10:29:09 +0300

r0kk3rz gravatar image

Because it seemed like a good idea at the time.

Although from my discussion with a few Jolla Devs its a decision that they perhaps regret and would do differently. I would be very surprised if the Jolla Tablet comes with btrfs as its main file system.

edit flag offensive delete publish link more

Comments

4

Slide 11 in below presentation says "we'd choose it again next time" :) http://events.linuxfoundation.org/sites/events/files/slides/ELC2014.pdf

anandrkris ( 2015-05-15 12:14:40 +0300 )edit

Question tools

Follow
3 followers

Stats

Asked: 2015-05-15 09:15:39 +0300

Seen: 1,615 times

Last updated: May 15 '15