Use the space from a unused partition
Most Sailfish X devices have a partition left over from Android which is completely unused. Newer Android phones have partitions labelled system_a and system_b, which were used by deliver OS updates as full partitions without overwriting the used one. On next reboot, Android just switches the partition to boot from. SailfishOS only uses system_b, as it doesn’t provide kernel updates.
This does only work on devices with a
/dev/disk/by-partlabel/system_a and a
/dev/disk/by-partlabel/system_b partition, e.g. the Xperia XA2. It does not work on devices with only a
/dev/disk/by-partlabel/system partition like the Xperia X!
You need shell access and root access for this guide. You get shell access by enabling the devlopment mode. You become root by executing
devel-su and entering the password you sat in the development mode settings.
It's good to have a full system backup, e.g. with restic or borg.
Add the partition to LVM
To start, you have to add
/dev/disk/by-partlabel/system_a to the Logical Volume Manager.
pvcreate /dev/disk/by-partlabel/system_ato prepare the partition for LVM.
- Secondly, type
vgextend sailfish /dev/disk/by-partlabel/system_ato add the partition to the
If you get messages similar to this:
/dev/mmcblk0rpmb: read failed after 0 of 4096 at 4186112: Input/output error
mmcblk0rpmb stands for Replay Protected Memory Block, which is a security storage feature of Android not used by SailfishOS. When the programs you just executed scan all partitions, they won't be able to read this secure storage, hence the error message.
Extend the sailfish root filesystem
Now, the space of the sailfish volume group is extended by the size of the
system_a partition and we can continue with adding the new free space of the volume group to the root volume.
- This is done with
lvextend sailfish/root -l +100%Free, which tells LVM to assign all free space in the
sailfishvolume group to the
- In the end, we resize the root filesystem to the new size of the
rootvolume by entering
resize2fs /dev/mapper/sailfish-root. This can be done while the filesystem is mounted, which is a nice feature of ext4.
Now you can proceed with installing apps or starting the system update