[Google Pixel 2 XL Guides, News, & Discussion] PixelBoot:
WARNING! Main partition table overlaps the first partition by 6 blocks!

You will need to delete this partition or resize it in an other utility.

This guide is to help those, facing this message, who have been in a mixup when repartitioning their Google Pixel 2 XL devices with the introduction of Android 12 and later ROMs/GSI Images.

More specifically this situation occurs when one follows Dollscythe's 3.8GiB system guide, followed by my (PixelExperience) repartition script.

No worries, let's solve this.

DISCLAIMER:

I AM NOT RESPONSIBLE IF THESE FOLLOWING INSTRUCTIONS ARE NOT EXECUTED PROPERLY.

KINDLY TRIPLE CHECK THE COPIED COMMANDS BEFORE EXECUTING THEM.

ANY ALTERATION TO THE PARTITIONS NOT MENTIONED BELOW COULD CAUSE SERIOUS ISSUES.

Firstly, let's understand why this occurs. 🧐

When it comes to repartitioning using sgdisk, with the case of the PixelExperience repartition method, blocks strictly defined from a starting to an ending logical sector.

(FYI: 1 logical sector = 4096 bytes)

When a user follows Dollscythe's 3.8GiB system guide, using parted, in contrast to sgdisk, the logical system sectors are modified to allow 3.8GiB of size.

Whilst this method is ideal for those planning to either flash GSI images which require specifically a larger system image, rather than making use of both product and system_ext partitions on PixelExperience and other ROMs, it is not ideal to mix them both up with each other.

(Both product and system_ext partitions offload large data from the system image, with such system apps like GApps)

So to break this down:

System is modified to adapt to 3.8GiB.

Logical starting and ending sectors system_a, system_b, pstore, aes_a, aes_b, align_parti and userdata partitions are modified.

PixelExperience script attempts to delete stock partition's userdata, but instead conflicts with 3.8GiB table.

Partition table becomes overlapped. (numerical partition numbers are not in order)

That is why it is important to keep track of which partition table your device is currently running, before making any further alterations to your system's table.

To check your current partition table, reboot into a custom recovery that supports the ADB interface via platform tools and:

adb shell

sgdisk --print /dev/block/sda

The output of this command should indicate what table you are currently running, depending on the sizes of both system_a and system_b partitions (2.5GiB on stock), or any added ones such as product and system_ext.

So double check that you are running the stock partition table before undergoing any of the guides mentioned above.

It is also worth noting that Pixel 2 XL (taimen) devices, do not revert to the stock partition table upon flashing the stock image.

This behaviour is not the same for Pixel 2 (walleye) devices, as when the stock image is flashed, the partition table is reverted to default.

(This is due to LG and HTC's bootloader behaving in different ways.)

Now, let's untie this knot!

Got the error now? Let's get started.

In short, we're going to undo the changes made, that includes both system_a and system_b partitions to the device, and redo it carefully.

Since sgdisk (installed on the device, by default) is unable to make any changes if it is found in an overlapping state, we will be using parted instead.

Download parted

Ensure you are in an ADB supported custom recovery.

Using platform-tools on an external device, push parted to the device:

adb push path/to/parted /sbin

Enter adb shell:

adb shell

Change permissions of parted:

chmod 777 /sbin/parted

Execute parted:

parted /dev/block/sda

Print current partition table:

p free

Remove overlapped partitions (when prompted, return ignore)

rm 17
rm 16
rm 15
rm 12
rm 11
rm 10
rm 9
rm 8

Recreate stock partitions

mkpart system_a ext4 169MB 2853MB
mkpart system_b ext4 2853MB 5538MB
mkpart pstore 5538MB 5546MB
mkpart aes_a 5546MB 5547MB
mkpart aes_b 5547MB 5548MB
mkpart align_parti 5548MB 5549MB
mkpart userdata ext4 5549MB 62400MB (for 64GB)
mkpart userdata ext4 5549MB 126300MB (for 128GB)

Wipe -> Format Data -> Yes

Wipe -> Factory Reset

Reboot -> Bootloader

That is what it takes to resort back to the stock partition table.

If done successfully (check via sgdisk --print /dev/block/sda), you can proceed to executing any repartition guide.