Home > ROMs > Custom ROMs

How to Avoid Brick while Flashing Custom ROMs [A/B Partition]

In this guide, we will show you the steps to avoid bricking your device while flashing custom ROMs in an A/B Partition device. While the dual partition style has bought in quite a few under the hood goodies, it has also bought a few challenges for tech enthusiasts, especially when it comes to flashing custom binaries. Before flashing a custom ROM, it is always recommended to be on the latest stock firmware. While most users do verify it, but some only do so for the active slot [the slot to which they were currently booted].

As a result, there could be a possibility of an older firmware in the inactive slot. This inconsistency between both the slots might not spell much trouble in the stock environment, but if you end up flashing a custom ROM, then a bricked device is usually on the cards. So to avoid this from happening, you will have to maintain the firmware consistencies across both the slots. And in this guide, we will show you how to do just that. Given here are the detailed steps to avoid bricking your device while flashing custom ROMs in A/B Partition.

How to Avoid Brick while Flashing Custom ROMs [A/B Partition]

Avoid Brick while Flashing Custom ROMs

To carry out this task, we will be using the copy-partitions.zip file. As is evident from its name, this script maintains a firmware consistency across both the slots by copying the contents of the active slot to the inactive slot. The file needs to be flashed only the first time you are flashing the ROM. For subsequent dirty flashes [updating the same ROM], it is not required. However, if you are moving from one custom ROM to another, you will again have to flash it.

Moreover, do note that it should be flashed before installing a custom ROM, and ADB sideload should be the preferred method, as is explained below. While flashing this file will not wipe any data but flashing a custom ROM will. So take a complete device backup beforehand. Droidwin and its members wouldn’t be held responsible in case of a thermonuclear war, your alarm doesn’t wake you up, or if anything happens to your device and data by performing the below steps.

STEP 1: Install Android SDK

First and foremost, you will have to install the Android SDK Platform Tools on your PC. This is the official ADB and Fastboot binary provided by Google and is the only recommended one. So download it and then extract it to any convenient location on your PC. Doing so will give you the platform-tools folder, which will be used throughout this guide.

install adb platform tools windows

STEP 2: Download Copy-Partitions.zip

Next up, get hold of the copy-partitions zip file from below [credits: LineageOS developers erfanoabdi and filipepferraz]. Once downloaded, transfer it to the platform-tools folder on your PC. Likewise, rename the file to copy-partitions.zip

DOWNLOAD: copy-partitions-20210323_1922.zip

Do note that this ZIP file hasn’t been officially signed, so you may get the ‘Signature verification failed’ error message while flashing it. It is completely normal and nothing to worry about.

Avoid Brick while Flashing Custom ROMs

STEP 3: Install Custom Recovery

You will now have to install a custom recovery onto your device. Nowadays, most custom ROMs with their own recovery, so it is recommended to flash that recovery itself. If there’s no such recovery, then you could always try out the TWRP Recovery. For detailed instructions on the same, do check out our guide on How to Install TWRP Recovery on Android. The shorter instructions are given below

  1. Transfer the downloaded recovery to the platform-tools folder.
  2. Then rename it to recovery, so that the complete name becomes recovery.img
  3. Now open the CMD window inside the platform-tools folder.
  4. Then execute the below command to flash the recovery file
    fastboot flash boot recovery.img

    Avoid Brick while Flashing Custom ROMs

  5. After that, execute the below command to boot your device to recovery
    fastboot boot recovery.img

STEP 4: Flash Copy-Partitions.zip

  1. First off, start the ADB sideload process from the custom recovery.
    • In TWRP, go to Advanced > ADB Sideload > Swipe to perform a sideload
    • In LineageOS Recovery, go to Apply Update > Apply from ADB.Avoid Brick while Flashing Custom ROMs
  2. Now open the command prompt inside the platform-tools folder.
  3. After that, execute the below command to flash this file-
    adb sideload copy-partitions.zip
  4. Once done, it is recommended to reboot to recovery.
    • In TWRP, go to Reboot > Recovery
    • In LineageOS Recovery, go to Advanced > Reboot to Recovery.Avoid Brick while Flashing Custom ROMs

You may now proceed to flash the custom ROM via TWRP’s Install section or other custom recovery’s ADB Sideload feature. That’s it. These were the steps to avoid bricking your device while flashing custom ROMs in an A/B Partition device.  If you have any queries concerning the aforementioned steps, do let us know in the comments. We will get back to you with a solution at the earliest.

Share: