Fastboot

Flashing a Custom Recovery via Fastboot

Published: July 6, 2026 Applies to: Unlocked bootloader devices, fastboot from Android Platform Tools

A custom recovery replaces the stock recovery partition with one that can install unsigned ZIPs, take full partition backups, and mount the filesystem for direct file access — capabilities the stock recovery deliberately doesn't have. Getting one onto a phone is a single fastboot command, but which command you need, and whether it sticks around after a reboot, depends heavily on how your phone's partitions are laid out.

Before You Start

A/B Partitions Change the Procedure

Phones launched with Android 8 or later commonly use seamless A/B partitioning, meaning there are two copies of most system partitions (boot_a/boot_b, and so on) and the device flips between them on update. On these phones, the recovery partition is frequently merged into the boot partition rather than existing as a standalone slot, which means a plain fastboot flash recovery command may have no effect, or may need to target boot instead. Check your specific recovery project's device-specific instructions before assuming the classic non-A/B flashing steps apply, since flashing to the wrong partition can leave a slot unbootable.

Devices that still use a discrete, non-A/B recovery partition follow the traditional command shown below without complication.

Flashing to a Discrete Recovery Partition

fastboot flash recovery recovery.img

This writes the image directly to the recovery partition, replacing it permanently until flashed again. After this, rebooting into recovery (usually Volume Up + Power, or via fastboot reboot recovery) loads the custom recovery instead of the stock one.

Some stock ROMs actively overwrite a flashed recovery image on next boot as an anti-tamper measure. If the custom recovery disappears after rebooting normally into the OS, boot straight into recovery mode immediately after flashing, before letting the system boot fully, and disable any "recovery verification" or similar option inside the custom recovery's settings if it offers one.

Testing Without Flashing: fastboot boot

Before committing to a permanent flash, it's worth booting the recovery image temporarily to confirm it's the right build for your device:

fastboot boot recovery.img

This loads the image into memory for a single session without writing it to any partition. If the recovery doesn't boot correctly, the phone falls back to its normal state on the next reboot with nothing changed. Only run the permanent fastboot flash recovery command once you've confirmed the image boots and functions correctly through this temporary route.

Verifying the Flash

After flashing, reboot into recovery mode directly:

fastboot reboot recovery

If the device instead boots into the stock recovery's interface (usually a plain Android logo with minimal text options), the flash either targeted the wrong partition or was overwritten by the system on first boot, as described above.

Troubleshooting

"Partition not found" error: this generally means the device is A/B and doesn't expose a standalone recovery partition. See the A/B section above.

Recovery boots to a black screen: the image doesn't match your exact device variant. Re-check the chipset and region/model number against what the recovery build targets.

Recovery boots but touch input doesn't respond: this is usually a display driver or DPI mismatch between the recovery build and your specific panel revision; check whether the recovery project has a separate build for your device's display hardware revision.

Bootloader relocks itself and wipes the recovery: some OEMs enforce automatic relocking after a period if certain security settings weren't disabled before unlocking. Re-check your device's specific unlock documentation for any additional steps required to keep it unlocked long-term.

Verified Boot Can Block the Recovery From Loading

On A/B devices where the recovery ramdisk is merged into the boot partition, the phone's verified boot chain checks that merged boot image against a signed hash before it will run. A custom recovery patched into boot changes that image's contents, so on some devices the phone refuses to boot into it at all, or shows a warning and reboots straight back to the bootloader instead of loading recovery. If flashing succeeds but the phone won't actually boot into the new recovery, disabling verification with fastboot flash vbmeta --disable-verity --disable-verification is frequently the missing step, not a failed flash.

Recovery-Only Access to /data

One of the main reasons people flash a custom recovery in the first place is direct access to the data partition without booting the OS at all — useful when the OS itself won't boot but you still need to pull files off before wiping. Most custom recoveries offer a "mount" menu that exposes /data, /system, and the SD card as regular filesystems, either through their own file manager or by presenting the phone as a mass storage device or MTP device to a connected computer. This only works reliably if the data partition isn't encrypted with a key the recovery can't decrypt, which is worth checking with a low-stakes test file before relying on it during an actual data-recovery situation.