Owners of Xiaomi, Redmi and POCO smartphones often face the need to modify the system, which leads to the installation of custom recavators such as TWRP. However, to receive official air updates (OTA) or return the device to its original state, you need to return the factory recovery partition. This process requires care, but with the right approach takes no more than 10-15 minutes.
The main difficulty is that replacing the Recovery partition affects critical system files. The procedure for completely erasing the recovery partition via Fastboot is the only guaranteed way to remove TWRP on modern Xiaomi models. If you decide to simply โflashโ the image over the top, the system can replace it with custom one on the first boot, so it is important to act strictly by algorithm.
In this guide, we will take a look at everything from tool preparation to final system integrity checks, how to avoid errors that can lead to bootloop and how to make sure your smartphone is ready for official updates.
Why return factory recavator to Xiaomi
Many users install modified recavators to obtain root rights or install custom firmware. However, after the experiments are completed, there is often a need to return to the "stack". Official firmware update via the Settings โ About the phone will not be installed if it detects a modified bootloader or a modified recovery partition.
In addition, the availability TWRP It can cause problems with banking applications and services Google Pay, even if you hide the root rights. MIUI HyperOS constantly checks the integrity of the system partition, and any deviations block access to protected functions.
Restore (factory) image is also necessary before selling the device or transferring it to another user, ensuring that the new owner gets the device as it came out of the factory, without hidden modifications and potential security vulnerabilities.
- ๐ฑ Possibility of installing official updates OTA faultless.
- ๐ Improving data security and banking applications.
- ๐ Preparation of the device for delivery to the service center or sale.
- ๐ Errors caused by conflict of modified software with the system.
โ ๏ธ Warning: The recovery process will wipe out all data on the device if you do a full reset. Back up important files, photos and contacts in advance.
Necessary tools and PC preparation
Before you start any manipulation of system partitions, you need to prepare a workspace. You will need a computer running the Windows operating system, because Xiaomi drivers and utilities work best in this environment. Using macOS or Linux is possible, but requires additional environment settings.
It is critical to use quality USB-Cheap charging-only cables donโt transmit data, which will cause connection errors in Fastboot mode. It is recommended to use the original cable that came with the smartphone or a certified analogue with data transfer support.
You also need to make sure that the battery is at least 60 percent charged, and interrupting the firmware process due to battery discharge can lead to serious consequences, including not being able to turn on the device, charge the phone in advance and not connect it to the PC until the procedure begins.
โ๏ธ Preparations for recovery
Search and download stock image Recovery
The most difficult step for beginners is to find the correct recovery.img file. This file strictly corresponds to the specific model of the smartphone and the firmware version. Using an image from another model or even another version of MIUI can lead to the deviceโs inoperability.
The best source is xiaomirom.com or the official XDA Developers forum. You need to find firmware that matches the current version of the system on your phone (or a newer one if you plan to upgrade). Inside the firmware archive (usually a file with the.tgz extension for Fastboot) is the image you want.
After downloading the firmware archive, retrieve it. The recovery.img file usually lies at the root of the unpacked folder or in the image subfolder. Move this file to the ADB/Fastboot tool folder on your computer for ease of use.
Where to look for recovery.img if the firmware is in zip format?
Installation of drivers and login to Fastboot mode
To connect your computer and smartphone, you use special drivers. If you have not previously worked on Xiaomi firmware, install the Minimal ADB and Fastboot package or Xiaomi USB Drivers. Without them, the computer will not see the device in bootloader mode.
To turn your smartphone into Fastboot mode, turn it off completely. Then press the Power + Volume Down buttons simultaneously. Hold them until you see a picture of a hare in a hat-husband repairing an android or FASTBOOT.
Connect your phone to your computer with a cable. The Windows Device Manager (Devices or Android) should have a device called the Android Bootloader Interface, and if there's an exclamation point, the drivers are installed incorrectly or not installed at all.
| Mode of work | Button combination | Screen indication | Appointment |
|---|---|---|---|
| Fastboot | Volume (-) + Nutrition | The tool hare | Partition firmware, unlocking |
| Recovery | Volume (+) + Nutrition | Recovery menu / Mi logo | Resetting settings, installing updates |
| Edl (9008) | Special. combination / Cable | Black screen | Deep Recovery (Qualcomm) |
Replacement of TWRP with Stock Recovery
Open the command line (cmd) or PowerShell in the folder where the ADB tools and the recovery.img file are located. Enter the command fastboot devices. If you see the serial number of the device and the word fastboot in response, then the connection is established successfully.
Now, run the command to erase the recovery partition, and that's the key point: we don't just replace the file, we clean the sector first.
fastboot erase recoveryAfter successful execution of the command (completed status), enter the command to record a new image:
fastboot flash recovery recovery.imgWait until the process is over. Once you get a message of success, you have to restart the device immediately. Don't let the phone hang around for long.
๐ก
If the erase recovery command is overloaded, donโt panic. immediately press the Fastboot login buttons again and repeat the flash command, as the partition may have cleared but not filled.
Completion and verification of the result
Once you have the image firmware, run the command fastboot reboot. The phone will go into reboot. The first run can last longer than usual (up to 5-7 minutes), as the system checks the integrity of the files. Do not interfere with this process.
To make sure the stock Recovery is installed, you can turn off the phone and try to enter recovery mode (Loud (+) + Power).You should see the standard MIUI Recovery menu with a selection of languages and Wipe Data/Reboot buttons, rather than the TWRP interface.
If the menu opens and looks standard, it's a success, so you can boot in and check for updates in the settings, and the device is ready for normal use.
- โ Standard logo MIUI when downloaded instead of the logo TWRP.
- โ No Root Rights Request at First Launch.
- โ Possibility of installation OTA-error-free updates.
โ ๏ธ Note: If the phone goes into an endless bootloop after firmware, the recovery image may not be compatible with your bootloader version.
๐ก
The main key to success is the use of recovery.img strictly the same firmware version that is installed on the smartphone, or a newer one.
Frequent mistakes and ways to solve them
One common problem is the FAILED (remote: device is locked) error, which occurs when you try to flash partitions on a device with a locked bootloader. To return a stock back, the bootloader must be unlocked, or the command will be rejected.
And people often confuse Recovery modes, because once you've run a stock image, the phone can go to Recovery mode itself, and if you see a language selection menu, that's OK, but if the phone just shows the Mi logo and it's hanging, wait 5-10 minutes.
If your computer stops seeing the device after the erase command, try reconnecting the cable or using another one. USB-Sometimes it helps to restart the Android service. ADB Interface in Device Manager.