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

Installing system updates fails when there is not enough space in "system data" partition

asked 2017-02-08 16:47:43 +0200

nthn gravatar image

updated 2017-07-24 21:27:37 +0200

The Jolla Tablet, the Jolla C/Aqua Fish and the Turing Phone all only have less than 2,5GB system memory (see https://together.jolla.com/question/154944/ or https://together.jolla.com/question/153509/ with no solution and a bricked phone). 2GB of this is immediately filled, and system updates require 500MB free memory. Ergo, installing system updates is impossible.

How can this be solved? Why is the system partition not at least twice the size? Whose fault is this?

Update: Sailfish 2.1.1.23 now requires 520MB. This is only getting worse.

edit retag flag offensive close delete

Comments

5

I can confirm this serious issue on my Jolla C (at least with the 2.0.4 -> 2.0.5 upgrade where I had to remove almost all apps to be able to proceed). This needs to be dealt with.

nodevel ( 2017-02-08 16:52:26 +0200 )edit
4

Can you take screenshot of Settings > Storage and then also from User data and System data?

Sage ( 2017-02-08 18:16:01 +0200 )edit
1

@Sage:

Settings > Storage

User data

System data

I can retake them in English if needed, but I think it should be clear.

nthn ( 2017-02-08 18:22:49 +0200 )edit
2

That is fine, do you have developer mode installed? If you do could you give output of following cmdline

 devel-su du -x -a / > /home/nemo/Documents/filelist.txt

and then share that file or if you don't want to share it publicly (it might contain some personal information in filenames etc.) you can send it to my e-mail: marko dot saukko (a) jolla dot com :)

Sage ( 2017-02-08 18:36:00 +0200 )edit
1

Okay, email sent.

nthn ( 2017-02-08 18:46:27 +0200 )edit

5 Answers

Sort by » oldest newest most voted
35

answered 2017-02-11 11:04:59 +0200

seiichiro0185 gravatar image

updated 2017-02-11 11:15:46 +0200

On the Jolla C it is possible to change the space for root (System Data) and home (User data) using the revocery mode.

EVERYTHING I WRITE HERE WAS TESTED SUCESSFULLY ON MY JOLLA C, I TAKE NO RESPONSIBILITY IF THIS INSTRUCTIONS BRICK YOUR PHONE, TRASH YOUR DATA, KILL YOUR KITTEN... !! BE SURE TO MAKE BACKUPS OF ANYTHING IMPORTANT ON YOUR PHONE BEFORE ATEMPTING THIS.

THE FOLLOWING INSTRUCTIONS ARE ONLY FOR EXPERIENCED USERS. PLEASE READ AND UNDERSTAND THE WHOLE THING BEFORE DOING IT! IF YOU FOLLOW THE INSTRUCTIONS YOU ARE DOING SO AT YOUR OWN RISK!!

So enough with the Disclaimer, Here are the steps:

  • Make sure you have enough free space on User data (home), at least as much as you want to assign to System Data!
  • Get you Jolla C into Recovery Mode
  • Select "Shell" in the Recovery Menu:
  • Confirm the Prompt and enter your Device Lock Code if asked
  • Check the current lvm layout:

/ # lvm 
lvm> vgs 
  VG       #PV #LV #SN Attr   VSize  VFree
  sailfish   1   2   0 wz--n- 12.93g    0   
lvm> lvs 
  LV   VG       Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  home sailfish -wi-a----- 10.49g    
  root sailfish -wi-ao----  2.44g    
lvm>

  • Check and resize the home filesystem (make sure you free up enough space, I resized to 5GB, so there is roughly 5GB of free space after it. Best is to resize smaller than the intended Size to have an error margin, we will re-add the additional space later

/ # e2fsck -f /dev/sailfish/home 
e2fsck 1.43.1 (08-Jun-2016)
home: recovering journal
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
home: 9887/615552 files (1.7% non-contiguous), 244132/2749440 blocks

/ # resize2fs /dev/sailfish/home 5G
resize2fs 1.43.1 (08-Jun-2016)
Resizing the filesystem on /dev/sailfish/home to 1310720 (4k) blocks.
The filesystem on /dev/sailfish/home is now 1310720 (4k) blocks long.

  • Reduce the size of the home LV, add the freed space to the root LV

/ # lvm
lvm> lvresize -L -2663M /dev/sailfish/home
  Rounding size to boundary between physical extents: 2.60 GiB
  WARNING: Reducing active logical volume to 7.89 GiB
  THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce home? [y/n]: y
  Size of logical volume sailfish/home changed from 10.49 GiB (2685 extents) to 7.89 GiB (2020 extents).
  Logical volume home successfully resized
lvm> lvresize -l +100%FREE /dev/sailfish/root
  Size of logical volume sailfish/root changed from 2.44 GiB (625 extents) to 5.04 GiB (1290 extents).
  Logical volume root successfully resized
lvm> lvs 
  LV   VG       Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  home sailfish -wi-a----- 7.89g    
  root sailfish -wi-ao---- 5.04g

  • Resize filesystems to the new LV sizes

/ # resize2fs /dev/sailfish/home
resize2fs 1.43.1 (08-Jun-2016)
Resizing the filesystem on /dev/sailfish/home to 2068480 (4k) blocks.
The filesystem on /dev/sailfish/home is now 2068480 (4k) blocks long.
/ # resize2fs /dev/sailfish/root
resize2fs 1.43.1 (08-Jun-2016)
Filesystem at /dev/sailfish/root is mounted on /rootfs; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
The filesystem on /dev/sailfish/root is now 1320960 (4k) blocks long.
/ #

If everything went well you can now leave the revcovery shell and reboot your Phone. You should see the new sizes for User data and System data in the Settings.

These Instructions might work on other Devices that use LVM and EXT4, but I did not try this.

I did not experience any negative effects so far, but that doesn't mean there aren't any!

AND AGAIN: YOU DO EVERYTHING WRITTEN HERE AT YOU OWN RISK!

edit flag offensive delete publish link more

Comments

1

@seiichiro0185 After having reflashed my Xperia from scratch (bash ./flash.sh) then upgraded to 2.1.4.13, I still have this:

4) Perform file system check
5) Run sshd
6) Exit
Type the number of the desired action and press [Enter]: 
4
/dev/mmcblk0rpmb: read failed after 0 of 4096 at 0: Input/output error
/dev/mmcblk0rpmb: read failed after 0 of 4096 at 4128768: Input/output error
/dev/mmcblk0rpmb: read failed after 0 of 4096 at 4186112: Input/output error
/dev/mmcblk0rpmb: read failed after 0 of 4096 at 4096: Input/output error
2 logical volume(s) in volume group "sailfish" now active
e2fsck 1.43.1 (08-Jun-2016)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
root: 34099/153600 files (0.1% non-contiguous), 366568/640000 blocks
e2fsck 1.43.1 (08-Jun-2016)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
home: 1240/1077216 files (1.9% non-contiguous), 113772/4785152 blocks
/dev/mmcblk0rpmb: read failed after 0 of 4096 at 0: Input/output error
0 logical volume(s) in volume group "sailfish" now active
Done

and this:

[OK] Code accepted.
/ # lvm
lvm> vgs
  /dev/mmcblk0rpmb: read failed after 0 of 4096 at 0: Input/output error
  VG       #PV #LV #SN Attr   VSize  VFree
  sailfish   1   2   0 wz--n- 20.70g    0 
lvm>

So I'm not sure I will proceed. Should I have redefined partitioning scheme before OS upgrade? What do you think?

objectifnul ( 2018-02-20 18:15:20 +0200 )edit
1

i can confirm that seiichiro0185's instructions work well on the Xperia X. I now have a 5GB system partition, thanks for the guide!

zepher ( 2018-06-10 11:39:32 +0200 )edit

Got an Xperia X F5122. Everything worked flawlessly, thank you very much! Anyway, just for adding some points:

  • To exit LVM prompt, just do "CTRL+D".
  • To exit Recovery Mode, unplug USB cable, hold Volume Up and press the Power button.
  • I've got the same warnings @objectifnul said (Input/Output error and the like), but I ignore them and everything was fine.
  • The 'lvmresize' sent some nasty warnigs about MAY DESTROY YOUR DATA, but once finished my home was OK. Anyway, in my case it was a fresh Sailfish X install and got no more stuff than default Jolla's pictures and video.
Mced ( 2018-08-05 09:55:33 +0200 )edit

How long does it take?

pemek ( 2018-11-14 13:44:54 +0200 )edit

@pemek: only a few minutes. I successfully resized the root partitions of my Aquafish and Xperia X, both running 3.0.0.8 Lemmenjoki. Thanks for the guide.

ziellos ( 2018-11-22 12:59:22 +0200 )edit
14

answered 2017-02-08 22:07:09 +0200

Sage gravatar image

If you have such issues you can help debug the issue with following.

NOTE: it is not recommended to enable developer mode if you do not know what you are doing.

NOTE: by providing the files you might reveal some personal data based on installed packages or files. You have been warned.

  1. Say which device you have and if you have

  2. Say if you have enabled developer mode and installed some packages outside jolla store or done some "hacking" with the device and touched as root user (devel-su)

  3. Provide screenshots of following pages:

    1. Settings > Storage

    2. Settings > Storage > System data

    3. Settings > Storage > User data

  4. Run following commands in developer mode, in terminal or over ssh and provide the files for review:

rpm -qa --queryformat '%{SIZE}\t %{NAME}-%{version}\n' > /home/nemo/Documents/pkgs.txt

ssu lr > /home/nemo/Documents/repo-setup.txt

devel-su du -x -a / > /home/nemo/Documents/filelist.txt

In many cases the problem is found from some files that user has installed to system data partition which then prevents installation of the update. This usually is because of some hacking/development which has caused stale files to system data partition or installation of packages that consume the space from system data partition.

Each case seems to be a bit different and caused by user doing thing in developer mode.

edit flag offensive delete publish link more

Comments

I managed to free enough space by deleting quite many application. Not desired workaround but I have now made the update successfully. I would be nice to show which application etc. is taking the most space so one can easier decide what to remove.

KylliOrvokki ( 2017-02-10 14:44:30 +0200 )edit
5

answered 2017-04-03 22:41:25 +0200

thisisme gravatar image

I had the same problem when trying to update to 2.1.0.11 EA release in my Jolla C. I couldn't figure out what files to remove but I noticed that the free space was slowly decreasing even while I was checking the filesystem.

I hadn't rebooted the phone in several days so I tried rebooting the phone and suddenly the used space dropped from 85% to 55%... No idea what exactly hogged the space but it might work for someone else too...

edit flag offensive delete publish link more

Comments

Worked like a charm on Sailfish X (Xperia X + SailfishOS 2.1.3.5)

ExPLIT ( 2017-10-18 11:51:03 +0200 )edit

I hope Jolla will hear us and increase the rootfs size for all Xperia Models and Gemini PDA.

ExPLIT ( 2019-01-04 15:05:05 +0200 )edit

Is there a way to do it with some automated way for dummies like me on the XPeria XA2 (Plus)?

nerip ( 2019-03-04 18:51:07 +0200 )edit
1

answered 2020-03-07 19:10:29 +0200

olf gravatar image

updated 2020-03-07 19:29:29 +0200

A generic guide how to enlarge the LVM "root" volume is provided as section 3.3 Increasing the "root" LVM volume size of the Guide: Installing Sailfish X on Xperias.

It covers ...

  • all Sony Xperias: X, XA2 and 10 (all models of each)
  • devices with an unencrypted or encrypted "home" volume, both
  • also older (pre-Xperia) devices (with only 16 GiB of eMMC FLASH memory, e.g. Jolla C, Intex Aquafish; but not the Jolla 1, as it does not use LVM), when adapting (i.e., recalculating / lowering) the size the "root" volume is initially shrunk to.
edit flag offensive delete publish link more
1

answered 2020-06-21 23:05:52 +0200

speefak gravatar image

seiichiro0185s solution is little bit tricky if you want to use another rootfs size. using the following code you can define the rootsfs size directly between 2GB or 6,8GB (lvm lvextend --size 4G /dev/sailfish/root ). Just change 4G to you needs

Works for SFOS Gen2 Devices like Xperia X Series and later.

e2fsck -f /dev/sailfish/home lvm pvs
lvm lvs
resize2fs /dev/sailfish/home 15G lvm lvextend --size 4G /dev/sailfish/root lvm lvresize -l +100%FREE /dev/sailfish/home resize2fs /dev/sailfish/home
resize2fs /dev/sailfish/root e2fsck -f /dev/sailfish/homedf -h
lvm lvs

https://speefak.spdns.de/oss_lifestyle/sailfish-os-systempartition-vergroessern/

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

Question tools

Follow
34 followers

Stats

Asked: 2017-02-08 16:47:43 +0200

Seen: 10,559 times

Last updated: Jun 21 '20