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

JP1301 (jolla 1) revival ? btrfs problems

asked 2019-09-27 11:13:56 +0300

alci gravatar image

Hi,

as my Xperia X died, I'm trying to reuse my Jolla1. I had to change the battery, and I even found one tagged as 'JP1301' compatible on Amzon (brand Patona).

Then I had to reset the device, and I'm in the process of upgrading the OS. No application is installed, the device has been freshly reset.

As I hit version 1.1.9.30 (Eineheminlampi), I'm asked to optimize the filesystem, but I get an error: not enough disk space... Looking at disk space usage (settings / about device / memory usage), I see that 11,27 GB are used by "Sailfish OS and other files". I have absolutely no data, nor application, on the phone.

How can I proceed with the upgrade ?

edit retag flag offensive close delete

5 Answers

Sort by » oldest newest most voted
2

answered 2019-09-27 11:36:03 +0300

Nova gravatar image

updated 2019-09-27 11:58:13 +0300

Have you tried running "btrfs-balancer balance" as root in terminal? (Enable developer mode)

Edit: I checked my J1, SF 3.1.0.11, "Sailfish OS and other files" = 3.2GB

edit flag offensive delete publish link more

Comments

1

My Jolla: SF 3.0.3.9 disk used 10 Gb disk free 3,7 Gb Sailfish and other 5,9 Gb Still get this below. Not sure why btrfs and actual used space don't match. [root@Sailfish nemo]# btrfs fi show Total devices 1 FS bytes used 9.17GiBbtrfdevid
1 size 13.75GiB used 13.75GiB path /dev/mmcblk0p28point>Btrfs v3.16lace device of a btrfs filesystem.

mSorvisto ( 2019-09-27 12:17:50 +0300 )edit
1

btrfs-balancer balance" gives me the same error: "Failed, Please free up more space and try again.'...

alci ( 2019-09-27 12:42:14 +0300 )edit

Re-reseted the device, and it seems it's working... Not sure, but I'm under the impression that it's not taking the same upgrade path, and I did not install 1.1.9.30 and jumped to 2.0 directly...

alci ( 2019-09-27 17:15:02 +0300 )edit

Well then @alci, please close your question as "answered".

olf ( 2019-09-27 18:10:23 +0300 )edit
1

answered 2019-09-27 16:37:57 +0300

JacekJagosz gravatar image

I did something similar recently and after updating to 2.x it only booted to white screen. After resetting and trying from the beginning I ballanced (btrfs balance start /) after every update and it worked. I have been using it for a few months without problems.

edit flag offensive delete publish link more
1

answered 2019-09-27 17:20:21 +0300

mSorvisto gravatar image

According to this question could be bit long process. My situation in comment of first answer is not that bad. With different dusage commands I manage to get used space to 10,65.

edit flag offensive delete publish link more
1

answered 2019-09-30 20:47:37 +0300

DrYak gravatar image

First, a a shameless plug for ny own howto to switch metadata from DUP to Single.

Now the details: Btrfs is closer to other modern filesystems like ZFS or BcacheFS - they aren't pure filesystems, they are also block device managers (like LVM and Mdadm).

Btrfs works by allocating chunks for either metadata or data.

It might needs to allocated e.g. a new chunk to write metadata, but there isn't unallocated space left on the device anymore. So even if there is still space left in the current data chunks (== what df will show), you get out of space errors (enosp) because it's impossible to allocate a much needed new metadata chunk.

This is made worse by the fact that btrfs never overwrites data in-place. It's a CoW (copy on write) system, it will always append first a new copy of the change, and only then it will remove the old copy if not needed anymore (not snapshotted). This makes btrfs extremely resilient to some type of problems, it makes snapshots "basically for free", and fsck is redundant (pro-tip, only run fsck on a CoW system as a last resort, usually you can recover the data without). BUT it means that btrfs is constantly writing new stuff and thus might often need a new chunk for something.

This is made worse that on Sailfish the default behaviour is to allocate metadata twice. That would be useful on a HDD (if one copy is bust, you can read from the other), but is hopeless on flash (the flash controler will group writes together, and thus both copies will go bust together). It's even worse as on Jolla 1, once you factor the gazillion of extra partitions that you need for the Android drivers, you're left with a ridiculously small amount of flash: allocating twice the chunks is terribky wasteful.

that's why rebalancing (euther manually with dusage or with jolla's tool) between upgrades is important: it avoids the situation where e.g. you have tons of half empty data chunk and no space allocatable for a new metadata chunk.

edit flag offensive delete publish link more
0

answered 2019-09-30 22:23:13 +0300

olf gravatar image

For "balancing" BTRFS at the GUI, you might use BTRFS balance checker 2.

But actually one should not run into this situation, when upgrading at the GUI per Settings -> Sailfish OS updates and seemingly that issue did not occur in the past (at least I remember no reports here at TJC). This is not to say that you are doing anything wrong, rather that this issue is strange.

edit flag offensive delete publish link more
Login/Signup to Answer

Question tools

Follow
1 follower

Stats

Asked: 2019-09-27 11:13:56 +0300

Seen: 666 times

Last updated: Sep 30 '19