Need help with resizing home partition

I succesfully resized my root partition with: Use the space from a u... | SailfishOS community wiki .
However I only added 20% of the free space to the root partition. I want to use the rest for /home.

So I did the same for home:

[root@XperiaXA2 mapper]# lvextend sailfish/home -l +100%Free
  /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 19.81 GiB (5072 extents).
  Logical volume sailfish/home successfully resized.

However resize2fs doesn’t work for /home:

[root@XperiaXA2 defaultuser]# resize2fs /dev/mapper/sailfish-home 
resize2fs 1.46.5 (30-Dec-2021)
resize2fs: Device or resource busy while trying to open /dev/mapper/sailfish-home
Couldn't find valid filesystem superblock.

Is this due to the LUKS encryption? Is there a way around this? Any help would be greatly appreciated.
(also, it seems like I will only gain 3GB, 700GB on / and 2.3GB on /home, from this. Wasn’t the unused partition system_a on the XA2 more like 10-12GB?)

Haven’t tried, but did you see this - More space for /home or /root with mininal effort - #7 by robang74 ?

1 Like

I used this guide some minutes ago and it worked flawlessly.
There´s a part for devices with encryption enabled (?>SFOS 3.3?).

Please note that there are three different guides referenced above in this discussion thread (“topic”). The first two referenced use an “unused” boot partition, which has two significant drawbacks:

  1. It is not applicable to all devices, only the ones with both, a system_a and a system_b partition.
  2. 1. […] This option has the drawback that if you want to reflash your device with SailfishOS, the flashing won’t work, you need to restore the partition first, e.g. by flashing Android.

The third guide referenced is a long outdated version (because nothing at together.jolla.com can be updated since 2020-10-01) of this guide at GitLab (which is referenced at the end of the obsolete version at TJC!). It takes a few gigabytes from the user volume to amend the root volume and hence works on all devices (except for the original Jolla 1, which does shift space between user and root volume automatically).
Please stop referencing the outdated version of this guide at together.jolla.com!
Do use this maintained version:

5 Likes

I´m sorry having referred to the old article, still had it in my bookmarks. Won´t do it again. Already updated my link. Thanks for pointing out. Greetings.

1 Like

I also did it once on my XA2.
(but reverted some time later as it was not possible anymore to clone my XA2 with dd on a backup device)

The gain was the same, approx 3GB.

If you want to use this trick on your home partition, I’guess you need to do it before encrypting. I have few knowledge but in a full experimental way, I’d reinstall sailfish without encryption, resize the partitions and try to enable encryption afterwards.
Or, try to do it live, but that’s hot. Not sure it’d work. Could even ruin the boot process.

Olf’s guide way is probably safer.

I can assure that it does not have any of the drawbacks you described.

Side note: These drawbacks are logical consequence of the technical method employed by the guide in that “SailfishOS community wiki” (which was actually written by a single person): Spreading a LVM volume group across multiple physical volumes by adding a “unused” boot partition. Not being able to perform a simple backup by dd and the enormous hassles with home volume encryption come in addition to the fundamental drawbacks I already mentioned: For reflashing SailfishOS one must first reflash (to) Android, and it only works on some devices.
All in all I think that utilising a “unused” partition to extend the root volume causes too many issues to seriously recommend it.

1 Like