Android Upgrades, Custom ROMs (LineageOS), & Kernels

Fixing Failed A/B Updates: Manual Recovery & Partition Restoration for Treble Phones

Google AdSense Native Placement - Horizontal Top-Post banner

Introduction: Navigating Failed Android A/B Updates on Treble Devices

The Android ecosystem continuously evolves, and one significant architectural shift introduced with Android Nougat, and refined with Project Treble, is A/B (Seamless) system updates. Designed to improve the update experience by minimizing downtime and reducing the risk of a bricked device, A/B updates allow the system to write updates to an inactive partition set while the user continues to use the active one. Upon reboot, the device simply switches to the newly updated, previously inactive partition.

While ingenious, this system isn’t infallible. Failed A/B updates can still occur due to various reasons: a corrupted update package, an interrupted installation, flashing an incompatible custom ROM, or even a critical error within a custom recovery environment like TWRP. When an update fails, your device might enter a bootloop, refuse to boot entirely, or continuously revert to an older, potentially broken state. This guide provides an expert-level walkthrough on manually recovering your Treble-enabled Android device by restoring its A/B partitions, focusing on factory image restoration and slot management.

Understanding A/B Partitions and Project Treble

Project Treble decoupled the Android OS framework from the vendor implementation, allowing device manufacturers to update Android more easily. A critical component of Treble is the mandatory implementation of A/B partitions for devices launching with Android 8.0 Oreo and newer. Instead of a single set of system partitions, devices have two identical sets: slot_a and slot_b. Each slot contains core partitions such as:

  • boot: The kernel and ramdisk.
  • system: The Android OS framework.
  • vendor: Device-specific hardware abstraction layers (HALs) and drivers.
  • product and system_ext: (On devices with dynamic partitions) Additional OEM and system-side components.

When an update is applied, it targets the currently inactive slot. For example, if slot_a is active, the update is written to slot_b. Once complete, the bootloader is instructed to switch the active slot to slot_b for the next boot. If slot_b fails to boot, the bootloader might automatically revert to slot_a, providing a failsafe mechanism.

Prerequisites for Recovery

Before attempting any recovery steps, ensure you have the following:

  1. ADB and Fastboot Tools: Installed and properly configured on your computer.
  2. Device-Specific Drivers: Installed on your computer to ensure proper communication with your phone in Fastboot mode.
  3. Original Factory Image/ROM: Download the official factory image specific to your device model and carrier. This is crucial for restoring your device to a known working state.
  4. Custom Recovery (Optional but Recommended): TWRP (Team Win Recovery Project) can be invaluable for advanced diagnostics, flashing custom images, or backing up/restoring specific partitions. However, for a fully failed boot, Fastboot will be your primary tool.
  5. Enough Battery Charge: Ensure your device has at least 50% battery to prevent further complications during the flashing process.

Step-by-Step Manual A/B Partition Restoration

This process assumes your device is stuck in a bootloop or fails to boot into the Android system, but can still access Fastboot mode.

Step 1: Boot into Fastboot Mode

Power off your device completely. Then, boot into Fastboot mode. This usually involves holding down the Volume Down button and the Power button simultaneously until you see the Fastboot screen. Connect your device to your computer via USB.

adb reboot bootloader

If ADB is not enabled or accessible, perform the hardware button combination.

Step 2: Verify Fastboot Connection

On your computer, open a command prompt or terminal and type:

fastboot devices

You should see your device listed with its serial number. If not, check your drivers and USB connection.

Step 3: Identify the Active Slot

It’s important to know which slot is currently active and which might be problematic. You can query the current active slot using:

fastboot getvar current-slot

This will typically return slot_a or slot_b.

Step 4: Attempt to Switch to the Other Slot (If Possible)

If your device is failing to boot and you suspect the active slot is corrupted, you might try switching to the other slot first, as it might contain an older, working system. Replace <other_slot> with the slot opposite to your current active one (e.g., if current-slot is a, try b):

fastboot set_active <other_slot>

After setting the active slot, try rebooting:

fastboot reboot

If your device boots successfully into Android, you might be able to re-flash the problematic slot or perform an OTA update to fix it. If it still fails, proceed to the next step.

Step 5: Extract and Prepare Factory Images

Download the full factory image for your device. Factory images are typically ZIP archives. Extract the contents. Inside, you’ll usually find several .img files (e.g., boot.img, system.img, vendor.img) and potentially another ZIP file containing more images or a flash-all script.

For devices with dynamic partitions (most modern Treble phones), the system.img, product.img, and system_ext.img (and others) are often bundled within a single super.img. You might need to extract these or flash the entire super.img if provided, or use a flash-all.bat/.sh script which handles this automatically. For manual recovery, focusing on the core boot, system, and vendor partitions (or the `super` image) is usually sufficient.

Step 6: Manually Flash Core Partitions to Both Slots

This is the most critical step. You will flash the individual partition images to *both* slots to ensure a consistent, clean state. Always specify the target slot explicitly. It’s recommended to flash to the slot you want to make active first, then to the other.

Assuming your extracted images are in the same directory as your Fastboot executable:

First, flash to slot_a:

fastboot flash boot_a boot.imgfastboot flash vendor_a vendor.imgfastboot flash system_a system.img

If your device uses dynamic partitions, you might need to flash the super partition if the factory image provides a single super.img. Be cautious and refer to your device’s specific flashing instructions if available:

fastboot flash super <path_to_super.img>

Then, flash to slot_b:

fastboot flash boot_b boot.imgfastboot flash vendor_b vendor.imgfastboot flash system_b system.img

And for dynamic partitions:

fastboot flash super <path_to_super.img>

This step ensures that both `slot_a` and `slot_b` receive a fresh, uncorrupted copy of the essential system components.

Step 7: Set Active Slot and Reboot

After flashing, set your preferred slot as active. It’s often safest to set the slot you started with (or slot_a for consistency) as the active one:

fastboot set_active a

Finally, reboot your device:

fastboot reboot

Your device should now boot into the freshly installed Android system. The first boot after a full system flash might take longer than usual. Be patient.

Troubleshooting and Additional Tips


  • Android Mobile Specs & Compare Directory

    Are you researching mobile hardware properties, processor SoCs, GPU chipsets, or RAM configurations? Access our complete specs catalog to compare up to 5 devices side-by-side!

    Compare Devices Specs →
Google AdSense Inline Placement - Content Footer banner