Use the space from a unused partition
Preparations
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.
- Enter
pvcreate /dev/disk/by-partlabel/system_a
to prepare the partition for LVM. - Secondly, type
vgextend sailfish /dev/disk/by-partlabel/system_a
to add the partition to thesailfish
volume group.
If you get messages similar to this:
/dev/mmcblk0rpmb: read failed after 0 of 4096 at 4186112: Input/output error
Don't worry. 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 thesailfish
volume group to theroot
volume. - In the end, we resize the root filesystem to the new size of the
root
volume by enteringresize2fs /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