Installation of Recovery on Xiaomi via Fastboot: A Complete Guide to Unlocking the bootloader

Installing custom recavators on Xiaomi smartphones is a key step for those who want to gain full control of the device. Through Fastboot mode, this process becomes as reliable as possible, but requires care: from unlocking the bootloader to choosing a compatible version of TWRP or another Recovery. Many users face errors due to incorrect sequence of actions or file incompatibility, in this article we will discuss the process from A to Z, including nuances for different models of Redmi, POCO and Mi.

It is important to understand that the installation of non-castom recavery deprives the warranty and can lead to the locking of the device if an error in the firmware EFS-But for those who are enthusiastic about customization. ROM, Backups through nandroid or root rights, no alternative. Next, step-by-step instructions based on recent changes in Xiaomi policy (including mandatory binding of Mi Account to the device).

Before you start, make sure your device supports unlocking the bootloader. You can check the list of officially unlocked models at en.miui.com/unlock. If your model is not listed (for example, some Redmi Note devices for the Chinese market), an attempt to unlock can result in hard-brick, which is irreversible damage to the firmware.

πŸ“Š What Xiaomi model do you use?
Redmi Note 10/11/12
POCO F3/F4/F5
Mi 11/12/13
Another Xiaomi model
Not Xiaomi.

Preparation of the device: unlocking the loader

The first and most critical step is to unlock the bootloader, which is impossible to install without, and Xiaomi made it harder in 2023 by adding a mandatory binding Mi Account to the device and increasing the wait time to unlock to 72 to 168 hours (depending on the model).

To get started:

  1. Activate Developer Options: Go to Settings β†’ About Phone β†’ MIUI version and tap it 7 times.
  2. Enable USB Debugging and OEM Unlocking in the Developer Menu.
  3. Link your Mi Account to your device in Settings β†’ Xiaomi Account β†’ Mi Cloud.

Next, download the official Mi Unlock Tool from Xiaomi and follow the instructions. Importantly, the account must be linked before you switch to Fastboot, otherwise the utility will not see the device.

⚠️ Note: If you have previously changed IMEI If you've been unofficially flashing the device, the Mi Unlock Tool can block the unlock forever, and the only way out is to contact the service center with proof of purchase.

2. Selection of Recovery: TWRP or Alternatives

The standard choice for Xiaomi is TWRP (TeamWin Recovery Project), but not all versions are compatible with the latest MIUI updates. For example, the Redmi Note 12 Pro+ will require a special build with support for dynamic partitions, and for the POCO F5 – a version with corrected FBE encryption.

Where to look for current assemblies:

  • πŸ”Ή Official website TWRP β€” Proven builds, but not for all models.
  • πŸ”Ή XDA Developers – unofficial ports (look for themes marked) [UNOFFICIAL]).
  • πŸ”Ή Developer Telegram channels (e.g, @twrp_updates) β€” newsletters and patches.

Before downloading, check:

  1. Compatible with your model’s codename (e.g. Redmi Note 11 is spes).
  2. Support for the current version MIUI (It is listed in the file name, for example. twrp-3.7.0_12-v7.1_A13-spes).
  3. Presence of patches for anti-rollback (if you roll back on the old firmware).

β˜‘οΈ Checking the recavΓ©ri before installation

Done: 0 / 4

3. Installation of drivers and ADB/Fastboot

To work with Fastboot on PC requires Xiaomi drivers and tools ADB/Fastboot. On Windows, it is easier to use the Minimal package. ADB and Fastboot, on Linux/Mac β€” Install via packet manager (sudo apt install adb fastboot).

Procedure:

  1. Connect your phone to your PC in Fastboot mode (press Power + Volume down when the device is off).
  2. Open the command line in the adb folder and execute: fastboot devices If the device is displayed (for example, 1234abcd fastboot) – the drivers are installed correctly.
  3. To check for unlocking the bootloader, enter: fastboot oem device-info Device unlocked: true must confirm successful unlocking.

⚠️ Note: On some Windows 11 PCs, Xiaomi drivers are blocked by security. To fix this, disable driver signature verification via gpedit.msc (for Pro versions) or use Driver Signature Enforcement Overrider.

4.Racking the Recovery Firmware through Fastboot

When you're done, we go to firmware. We use the fastboot flash recovery command, but some models (like the Xiaomi 12T) require an additional step with the vbmeta patch to disable integrity check.

Step-by-step:

  1. Place a recovery file (e.g., twrp-3.7.0.img) in the adb folder.
  2. Run the firmware command: fastboot flash recovery twrp-3.7.0.img
  3. For devices with dynamic partitions (e.g., Redmi) K50) Use: Fastboot Flash recovery_ramdisk twrp-3.7.0.img
  4. Turn off vbmeta (if required): fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
  5. Reboot to the recovery not through the system, but by the team: fastboot boot twrp-3.7.0.img This will prevent the recapable from being overwritten by stock firmware.

If you are in a reboot, then you are in a stock Recovery. MIUI I re-recorded it. The solution is to stitch it. disable_dm-verity_forceencrypt (download XDA) or immediately after the firmware recovery install Magisk to block system updates.

πŸ’‘

If the fastboot flash command returns the error FAILED (remote: 'Partition not found', check the partition name is correct. For new devices, Xiaomi can use recovery instead of recovery recovery_ramdisk or boot (in the case of A/B-section).

5. Common mistakes and their solutions

Even with the correct following of the instructions, errors can occur. Below is a table of the most common problems and ways to fix them:

Mistake.Reason.Decision
FAILED (remote: 'Flashing is not allowed in Lock State')The bootloader is not unlockedRepeat unlocking through Mi Unlock Tool and wait for the timer to end.
FAILED (remote: 'Invalid sparse file format at header')Recovery file damaged.Download the file again and check the hash amount (MD5)
Device not defined in fastboot devicesThere are no drivers or USB-portTry another cable/port, install drivers manually through Device Manager
After the recavator firmware, the phone does not turn onBoot or vbmeta section damagedSwipe stock firmware through Mi Flash Tool in clean all mode

If after installing the recovery phone bootloop (cyclic reboot), most likely the problem is incompatibility of the version. MIUI And the solution is to sew it. disable_forceencrypt Or revert to an older version of the firmware.

What if the Mi Unlock Tool shows "Couldn't unlock"?
This error occurs if: 1. Mi Account is not tied to the device (you need to re-authorize in MIUI). 2. The device was stitched with an unofficial firmware before unlocking (you need to flash the stock firmware through Fastboot). 3. Xiaomi servers are temporarily unavailable (try after 24 hours). If the problem persists, use alternative unlock methods through EDL (requires an authorized Xiaomi developer account).

6. Additional settings after installation

Successful recovery firmware is only half the battle, and to avoid future problems, follow a few critical steps:

  • πŸ” Turn off encryption: B TWRP Go to Wipe. β†’ Format Data and type in yes. This will remove encryption. FBE, which can block access to internal memory.
  • πŸ“± Create a backup: In the main menu TWRP Select Backup and save Boot, System, Data and EFS on SD-card.
  • πŸ”§ Install Magisk: If you need root, run Magisk.zip via Install TWRP. Download the current version on GitHub.

For dynamic partitions devices (such as Xiaomi 13), the standard backup in TWRP may not work, in which case use alternative tools such as OrangeFox Recovery or scripts to back up via ADB.

⚠️ Note: If you are planning to use custom ROM (For example, LineageOS or Pixel Experience, check compatibility with your model in the forum first. XDA. Some firmware requires prior patch installation for firmware or vendor.

πŸ’‘

Once installed, never update MIUI through the standard update menu, which will result in TWRP overwriting with stock recavaries. Use only manual firmware via Fastboot or TWRP.

7.How to get back stock Recovery

If you need to return the original recovery (for example, for warranty repair), download the stock firmware for your model from the Xiaomi Firmware Updater website.

  1. Unpack the firmware archive and find the recovery.img file.
  2. Fastboot: Fastboot Flash Recovery recovery.img
  3. Reboot the device to the system: fastboot reboot

To return to stock firmware completely, use the Mi Flash Tool in clean all mode. Note that this will delete all data from the device, including internal memory.

FAQ: Frequent questions

Can I install the recavators without unlocking the loader?
No, Xiaomi blocks the firmware of any unofficial files through Fastboot if the bootloader is locked.The only workaround is using exploits (like DirtyCOW), but they only work on older versions of MIUI (until 2021) and can lead to soft-brick.
Why does the phone not see internal memory after TWRP firmware?
It's about encryption. FBE (File-Based Encryption: The solution is to format the Data partition into TWRP (as described in the section 6) or patch disable_forceencrypt. Keep in mind that formatting will delete all data!
Which Recovery Is Best for Xiaomi: TWRP or OrangeFox?
OrangeFox - fork TWRP Extended features (built-in file manager, support) OTA-customization ROM). But it's not available for all models. TWRP sufficient, but if you need additional tools (e.g. backup through the ADB), Try OrangeFox.
Can I use the ADB Sideload?
Technically, yes, but it's not recommended. The firmware on ADB Sideload may be interrupted due to an unstable connection, which will damage the partition. Use only the Fastboot to install the Recovery.
What if the phone does not turn on after installing the Recovery?
Most likely, the boot or vbmeta partition is damaged. Solution: Sweat stock boot.img through Fastboot. If this doesn't help, use the Mi Flash Tool for full flashing in clean all mode. Hard-brick (no buttons) devices will require firmware through EDL (requires an authorized Xiaomi account).