2

I'm trying to flash TWRP Recovery into my Mi A2 recovery. However I get the error when flashing:

~$ fastboot flash recovery twrp.img
FAILED (remote: '(recovery_a) No such partition')

Does anyone know how to fix this error? I did test flashing it to boot_b, and that did work. but that's not the recovery slot.

2

That's expected. Devices with A/B partition scheme don't have a recovery partition. You can only boot in recovery mode with fastboot boot twrp.img. But to permanently flash recovery to device which can be booted into by proper key combination, you need to unpack both of your boot.imgs (A/B) from device and replace the ramdisk with the one extracted from twrp.img. Then repack and flash boot.imgs back to device.

Traditionally boot.img and recovery.img had two major components; kernel and ramdisk. On A/B devices, no ramdisk is required for normal boot because system.img is mounted as rootfs when processing Device Tree (dtb) which is appended to kernel image usually. So the ramdisk.cpio in boot.img is that of recovery. Since kernel is same for a device (other than build configurations), so only ramdisk needs to be replaced.

Sources:

  • Thank you so much, I had no idea. – Simkoo Apr 2 at 5:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.