Enlarge 4Gb root partition?

After I had to reflash because of 4.6.0.13, my partitions have also changed. In my case (as I had enlarged my root from the start) the volume on my XA2+ has decreased. Here is the size distribution from my 4.5 hardware:


As you can see, I had 5.9 GB available and now I only have:

LV Size                <3,91 GiB

Results in a displayed size of 3.9 GB
Is there anyone who has already realized this for an XA2 with 32GB total? Or someone who has already done this with an XA2II/XA2III (they also only have 4GB root size but 64GB / 128GB total size)?
Since the instructions are in GiB and in blocks, the implementation is not so trivial for me.
But I have gotten used to the large root and would like to have it again. Is there anything available yet?

Actually the 4GB are a new layout you get when you flash 4.6 freshly, before you got much smaller root for Xa2 gen phones.

1 Like

Yes, but that’s still not enough for me. Before, the original XA2+ had a root size of approx. 2.5 GB. I have increased it to 5.9 GB. That would be 3.4 GB more.
So I first have to reduce LV1 by the aforementioned 3.5 GB (convert to GiB) - but I don’t know about the blocks.
It would be better if someone had already done this.

well, there is a manual to do this by olf, but I think the target size of that is also the aforementioned 4GB

Here is the command chain of how I enlarged my root back then (with CLI responses):

/ # e2fsck -f /dev/mapper/sailfish-home
e2fsck 1.45.4 (23-Sep-2019)
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: 84110/879360 files (5.4% non-contiguous), 2470795/3932160 blocks

/ # resize2fs /dev/mapper/sailfish-home 10G
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /dev/mapper/sailfish-home to 2621440 (4k) blocks.
The filesystem on /dev/mapper/sailfish-home is now 2621440 (4k) blocks long.

/ # e2fsck -f /dev/mapper/sailfish-home
e2fsck 1.45.4 (23-Sep-2019)
Pass 1: Checking inodes, blocks, and sizes
Inode 4375 extent tree (at level 1) could be narrower. Optimize<y>? yes
Pass 1E: Optimizing extent trees
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

home: * FILE SYSTEM WAS MODIFIED *
home: 84110/586240 files (6.1% non-contiguous), 2452690/2621440 blocks

/ # lvm lvchange -a n sailfish/home
/dev/mmcblk0rpmb: read failed after 0 of 4096 at 0: Input/output error

/ # lvm lvresize -l -911 sailfish/home
/dev/mmcblk0rpmb: read failed after 0 of 4096 at 0: Input/output error
Size of logical volume sailfish/home changed from 17.55 GiB (4494 extents) to <14.00 GiB (3583 extents).
Logical volume sailfish/home successfully resized.

/ # lvm lvresize -l +100%FREE sailfish/root
/dev/mmcblk0rpmb: read failed after 0 of 4096 at 0: Input/output error
Size of logical volume sailfish/root changed from 2.44 GiB (625 extents) to 6.00 GiB (1536 extents).
Logical volume sailfish/root successfully resized.

/ # lvm lvchange -a y sailfish/home
/dev/mmcblk0rpmb: read failed after 0 of 4096 at 0: Input/output error

/ # resize2fs /dev/mapper/sailfish-home
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /dev/mapper/sailfish-home to 3668992 (4k) blocks.
The filesystem on /dev/mapper/sailfish-home is now 3668992 (4k) blocks long.

/ # e2fsck -f /dev/mapper/sailfish-home
e2fsck 1.45.4 (23-Sep-2019)
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: 84110/820736 files (6.1% non-contiguous), 2467461/3668992 blocks

/ # resize2fs /dev/mapper/sailfish-root
resize2fs 1.45.4 (23-Sep-2019)
Filesystem at /dev/mapper/sailfish-root is mounted on /rootfs; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
The filesystem on /dev/mapper/sailfish-root is now 1572864 (4k) blocks long.

/ # e2fsck -f /dev/mapper/sailfish-root

I had not recorded the CLI’s response to the last command. This generated the above values.
The errors were not errors, but they made my forehead sweat (because nowhere did it say that the errors were normal, at least not back then).

No, while Jolla’s sizes for the root volume are 2500 MiB for 32-bit devices (armv7hl) flashed with SailfishOS < 4.6.0 and 4000 MiB (~ 3,91 GiB) for all other devices, my guide provides values for shrinking the home volume calculated to increase the root volume size from 2500 MiB to 4 GiB (= 4096 MiB), 6 GiB (= 6144 MiB), 8 GiB (= 8192 MiB) and 10 GiB (= 10240 MiB).

Hence, if one (here: @Volker_S) wants to increase a root volume size of already 4000 MiB, one either has to fully comprehend the process and recalculate the values, or use the documented values, knowing they will increase the root volume by (4096 - 2500 =) 1596 MiB, (6144 - 2500 =) 3644 MiB, (8192 - 2500 =) 5692 MiB, (10240 - 2500 =) 7740 MiB.

The last bullet point of section 3.3.2 has been there for years!

1 Like

Updating from 4.6.0.13 to 4.6.0.15 I got to do this and totally lost any data, because of the encryption.
We should include in this guide also the handling of encrypted disks Sailfish OS – Systempartition vergrößern – OpenSource is a lifestyle …

Thanks,

It is, see Guide: Installing Sailfish OS, section 3.3.2 Shrinking the “home” LVM volume and extending the “root” one!

Just use the right guide. :wink:

1 Like