[OnePlus 6T  Guides, News, & Discussion] AnoopKumar:
[GUIDE][HOW TO] Flashing with care & Surviving soft bricks with fastboot [CMD] [TIPS]

Hello guys, some of us are new to the A/B partitions. Flashing on wrong partition may end up in soft bricks. This is not a rooting guide, here I'm explaining how to handle flashing A/B partitions properly and survive soft bricks using fastboot . Always backup your data before flashing anything.

Those who still don't know about the A/B partitions, please take a look at this thread https://xdaforums.com/oneplus-6/how-to/guide-noobs-guide-to-b-partitions-op6-t3816123

Prerequisites:

OnePlus 6T with unlocked or locked bootloader

A computer for running fastboot commands

You :laugh:

Rebooting

Rebooting your device via adb and fastboot

adb reboot //normal reboot
adb reboot recovery //reboot to recovery
adb reboot bootloader //reboot to fastboot (bootloader)

fastboot reboot //normal reboot
fastboot reboot bootloader //reboot to fastboot (bootloader)

Unlocking the Bootloader

Bootloader can be unlocked via fastboot

fastboot oem unlock

WARNING THIS WILL WIPE YOUR DATA

Working with A/B Partitions

There are two boot partitions on this device, named boot_a and boot_b respectively, they are not the “traditional” boot partitions. Both of these partitions contain a kernel and ramdisk like you are probably used to. The difference is that there is no recovery partition and the boot partition is new recovery partition. The A/B partitioning scheme can be quite confusing to users. There are actually two copies of many of the partitions. There is only one data (userdata) partition.

Slots

The concept of ‘slots’ comes into play to determine whether you are booting ‘slot A’ or ‘slot B’. We can determine which slot is ‘active’ or marked for booting via adb and fastboot:

adb shell getprop ro.boot.slot_suffix

fastboot getvar current-slot

Switching Slots

We can switch between slots via fastboot:

fastboot set_active other //switch to inactive slot

fastboot set_active (a or b) //switch to specified slot

Flashing/Booting

We can flash/boot (temporary flash) recovery/kernel via fastboot. To boot (what we call temporary flash) a kernel/recovery there is no need to switch/select any slot. Keep in mind that when we run the flash command instead of boot, it will wipe the specified partiton (you may lose your root & custom kernel)

fastboot boot boot.img or twrp_recovery.img

To flash permanently, first switch/select any slot you want or it will automatically flashed to the active slot. This may cause boot loop, always proceed with caution.

fastboot flash boot boot.img or twrp_recovery.img

fastboot flash recovery twrp_recovery.img

If your testing something, always use the inactive slot. Eg: if you want to test a custom rom, first back up your data then switch to the inactive slot and flash the custom rom, this will save your time (no need restore full backup only data).

Surviving Soft Bricks

Some possible simple solution we can try rather than using MSMTool or flashing the full rom.

When causing boot loops, try these:

Flash Magisk via recovery

Switch to the other slot via fastboot

Wipe data partiton via fastboot -w

When causing Bootloader crash, try these:

Turn off the phone by holding the power button (release after power off)

Hold both volume buttons

Now press power button

Phone will boot to fastboot

Now switch the other slot via fastboot

To be continued....