[Motorola One Vision Guides, News, & Discussion] arch-dev:
WARNING​

This process is extremely dangerous. You may brick your device.
Do it only if you know what you are doing!
I am not responsible of bricked devices or dead sdcards.

Hello guys,

I've decided to write this guide since this seems to be the only way to resize system partition to install larger GSIs.

Before starting remember to always make a backup since you will loose all your data.

Also DO NOT DO a simple copy-paste compare with yours first and if you have any doubts write in the comments before enter the doubtful command. Prevention is better than cure!!

This process has been tested on my own device but it has not been tested restoring stock firmware.

(You can also join the telegram group to ask for help https://t.me/MotorolaOneAction)

Requirements​

Latest TWRP downloaded (to be booted through fastboot later)

Parted arm64 static binary (attached below)

Latest fastboot and ADB commands installed

Patience

Process​

Boot to TWRP from fastboot

Run the following commands:

adb push /path/to/parted /sbin/parted
adb shell
chmod 777 /sbin/parted
parted /dev/block/sda
p free

Now parted will list your partition table which should be like this:

View attachment 5378675

Save the output of the command above (this is very important to restore original partition table if you will run into issues in the next parts)

Now with extreme attention type

rm partition_number

replacing partition_number with the number of the partition following the reverse order until you reach system_b partition removing it too . In my case I'll type:

rm 42
rm 41
rm 40
rm 39

Once you removed these partition it's time to recreate them following the original order but increasing the target partition size, in our case system_b. Type

mkpart name fs_type start end

replacing name with the original partition name (refer to the command output you saved at point 5), fs_type with original file system type, start with the end value in MB of the previous partition, and end with start + size, where size will be the size of the target partition (size is the original size of the partition except for system_b which I've decided to change to 4221MB, 1000MB larger than original one). If it says that the partition isn't aligned, type Ignore. In my case I'll type:

mkpart system_b ext4 5630MB 9851MB
mkpart oem_a ext2 9851MB 9918.1MB
mkpart oem_b ext2 9918.1MB 9985.3MB
mkpart userdata ext4 9985.3MB 128GB

Now restore the partition flags typing

set partition_number msftdata on

replacing partition_number with the number of the partition. In my case I'll type:

set 39 msftdata on
set 40 msftdata on
set 41 msftdata on
set 42 msftdata on

Now type again

p free

and compare the output with the original table saved before, they should be quite identical.

Type:

quit
exit

Reboot to bootloader and boot again into TWRP

If in the logs you see lot of red lines saying it could not mount oem partition and userdata partition don't panic, it is normal since they have not been formatted yet (they are registered into fstab with a different file system type). Type:

adb shell
mkfs.fs_type /dev/block/sdapartition_number

replacing fs_type with original file system type, partition_number with the number of the partition. In my case I'll type:

adb shell
mkfs.ext4 /dev/block/sda39
mkfs.ext2 /dev/block/sda40
mkfs.ext2 /dev/block/sda41
mkfs.f2fs /dev/block/sda42

Now reboot to bootloader and again into TWRP. Logs now should be free of red lines and you should be able to mount all partitions again.

You have done it!! Now you are able to flash larger GSI (I suggest you doing it from TWRP since fastboot may have some problem recognizing the resized partition size, also remember to change the active slot to the resized one, in my case the slot b)