[Google Pixel 2 Guides, News, & Discussion] sharanoth:
SPECIAL THANKS TO

@Lunarixus on XDA

I wouldn't have figured out how to maneuver the pixel 2 XL partition table without him.​

!!!WARNING PLEASE READ!!!!

This tutorial only applies to Walleye (regular 2). There's another tutorial for Taimen (2 XL). Please join the telegram group if you can! ​

Google Pixel Development Group.​

​

ALSO, this only increases system partition on slot B. If you want to flash GSIs, make sure you are on the correct slot with this command:​

​

fastboot --set-active=b​

​

REQUIREMENTS:

Walleye with unlocked bootloader.

Updated adb & fastboot binaries.

GNU parted for ARM64. Get it here: https://guidedflame.dev/parted

Custom recovery for Walleye with adb support.

STEPS:

1. Enable USB Debugging​

2. Reboot into fastboot mode​

adb reboot bootloader​

3. Boot into the recovery (format data if it is stuck on splash screen)​

fastboot boot path/to/recovery.img ​

(optional) you can flash TWRP permanently if you wish. fastboot flash boot_a path/to/recovery.img and fastboot flash boot_b path/to/recovery.img DO NOT FLASH TWRP. JUST BOOT TO IT.​

4. In TWRP...​

If it asks you to decrypt your data, do it.

If it asks you to swipe for RW permissions on system partition, do it.

Unmount all partitions. Click on Mount, then un-tick everything.

5. Back to your PC. Copy parted to /sbin.​

adb push path/to/parted /sbin​

6. Enter shell mode.​

adb shell​

7. Change permissions of parted.​

chmod 777 /sbin/parted​

8. It's time to use parted!​

​

We mainly use 3 commands. Here's how they work.​

In your terminal (still in shell mode), type parted /dev/block/sda

It should greet you with a welcome screen. Type p free, and save what you get in a screenshot or text file (on windows you can copy and paste in notepad, or use Snipping Tool, since it's installed by default). THIS IS VERY IMPORTANT IF YOU GET STUCK!!!!

View attachment 5371867​

We have to delete all partitions starting from the bottom until system_b. Make sure to keep the screenshot or text file you saved earlier from p free, because we are gonna need it to recreate the deleted partitions later. YOUR PARTITION SCHEME MIGHT BE DIFFERENT THAN THIS. Make sure to STOP after system_b is removed.

rm 45

rm 44

rm 43

Once you are done, it's time to recreate those partitions. We do it in the proper order now, starting from system_b. Refer to the screenshot or text file you saved earlier. We will increase the partition size to 3GB to be able to boot most GSIs, including Android 12. If it says that the partition isn't aligned, type Ignore.

mkpart system_b ext2 4073MB 7173MB

mkpart padding1 7173MB 7179MB

mkpart userdata ext4 7179MB 62400MB (if you have 128GB Walleye, do mkpart userdata ext4 7179MB 126300MB)

Check your partitioning with p free and compare with your screenshot/text file. It should be similar, with some extra free spaces.

Time to name the partitions.

name 43 system_b

name 44 padding1

name 45 userdata

Check your partitioning again with p free. It should show the named partitions. If everything looks good to you, leave parted.

quit

9. Exit shell mode.

exit​

10. Reboot into fastboot mode

adb reboot bootloader​

11. Format all the partitions we made

fastboot erase system_b​

fastboot erase padding1​

fastboot erase userdata​

fastboot format:ext2 system_b​

fastboot format:ext4 userdata​

​

And that's all!

You can start immediately flashing GSIs/Android 12. If you're stuck on splash screen, that means the partitions didn't repopulate correctly. Follow the advice above!

If you have any questions, or accidentally brick your device, join the telegram group for direct support, or ask here in the XDA thread.