How to run TWRP on Xiaomi: from unlocking the bootloader to installing the recovery

Installing custom TWRP on Xiaomi smartphones gives you access to advanced features from NANDroid backup to unofficial ROM firmware. However, the process requires care - an error at any stage can turn a device into a "brick." In this guide, we will analyze all the steps from unlocking the bootloader to choosing the right version of TWRP for your Redmi, Poco or Mi model.

It’s important to understand that Xiaomi is actively blocking the ability to install third-party backups through official channels. Last year, the company has tightened the requirements: now to unlock the bootloader requires a binding Mi Account account to the device and waiting up to 720 hours (30 days), but even after that, the process of installing TWRP on new models (for example, Redmi Note 12 Pro+ or Xiaomi 13T) has nuances, which we will tell you about.

1.Preparation of the device: what to do before unlocking

Before you start unlocking the bootloader, make sure your device meets the key requirements:

  • πŸ“± Smartphone model: Check compatibility with TWRP Not all Xiaomi devices are supported, for example, for Poco. F5 Special assembly may be required.
  • πŸ”‹ Battery charge: At least 60%.The unlocking and firmware process can take up to 30 minutes, and power outage at this point is critical.
  • πŸ” Backup: Save all important data (photos, contacts, messages) to your PC or cloud. Unlocking the bootloader erases all data from the device without the ability to restore it.
  • πŸ–₯️ Computer: You will need a Windows PC 10/11 or Linux (for fastboot and ADB). MacOS may have problems with drivers.

Pay special attention to MIUI versions. Some devices (e.g. Redmi Note 10 Pro) require a rollback to older firmware to successfully install TWRP, and up-to-date compatibility data can be found in telegram chat communities dedicated to your model.

⚠️ Note: If your Xiaomi was purchased in China (China version) ROM), Unlocking the bootloader may not be possible without additional manipulations. MIUI through EDL-regime.

πŸ“Š What Xiaomi model do you use?
Redmi Note 11/12
Poco X3/X4/X5
Mi 11/12/13
Another model

2. Unlocking the bootloader: a step-by-step process

Unlocking the bootloader is a must before installing TWRP. Xiaomi has made this procedure more complicated, but the overall algorithm has remained the same:

  1. Linking your Mi Account to your device: Go to Settings β†’ Xiaomi Account β†’ Mi Cloud and log in. Make sure the developer settings include OEM Unlocking.
  2. Unlock Tool: Download the official Mi Unlock Tool (Windows version). Launch it on behalf of the administrator, log in to the same Mi Account as on your phone, and connect your smartphone in fastboot mode (click Volume down + Power when you turn off the device).

If the utility gives you a "Couldn't unlock" error, check:

  • πŸ”Œ Connection to USB: Use the original cable and port USB 2.0 (port) USB 3.0 can cause malfunctions).
  • πŸ› οΈ Mi Unlock Tool Version: New devices (e.g. Xiaomi 13) require a version no lower than 5.5.224.30.
  • πŸ“΅ Developer Mode: It must be enabled (Settings) β†’ The phone. β†’ Version. MIUI β€” tap 7 times).

Link Mi Account to your device |Enable OEM Unlocking in developer settings |Download Mi Unlock Tool latest version |Connect phone in fastboot |Check battery (>60%)

-->

3.Selecting the Right TWRP Version for Your Model

The error in choosing a version of TWRP is one of the main reasons for the β€œbricking” of devices. Even if the model of your Xiaomi is officially supported, there are nuances:

Model of the deviceCode nameFeatures of TWRPDownload link
Redmi Note 11 Pro/Pro+veux/peuxIt requires a version that supports Dynamic Partition. Old builds don't work.twrp.me
Poco X3 ProvayuBoth versions (A/B) are supported. TWRP 3.7.0+ is recommended for ROM firmware.twrp.me
Xiaomi 12TplatoOfficial TWRP is not available due to boot.img closed-loop boot.img.XDA Developers
Redmi 10CfogIt requires a patch for dm-verity, and without it, the device won't boot after installation.twrp.me

For dynamic partition devices (such as the Redmi Note 10 Pro or Poco F3), the standard TWRP may not work, and in such cases, use modified builds marked "Dynamic" or "A/B." These can be found on the XDA Developers forums or in the telegram channels dedicated to a particular model.

⚠️ Note: On some devices (e.g. Xiaomi) 11T Pro) installation TWRP discharge DRK (Device Root Key, which blocks access to encrypted data. If you want files in your internal memory, back up through the backup. ADB pull to the firmware of the Recovery.

How to find out the code name of your Xiaomi?
Open Settings β†’ About Phone β†’ MIUI version and tap multiple times on the line β€œKeronel” (or β€œBaseband”). In some firmware, the code name appears in Settings β†’ Additional β†’ Special Features β†’ Device Model. You can also use the command ADB: adb shell getprop ro.product.device

4. Install TWRP via fastboot: step-by-step instruction

When the bootloader is unlocked and the correct version of TWRP is downloaded, you can start installing it.

  • πŸ–₯️ Computer with installed ADB and fastboot (can be downloaded via Android) SDK Platform-Tools).
  • πŸ“ File. TWRP in.img format (e.g, twrp-3.7.0_12-0-peux.img).
  • πŸ”Œ Cable USB Type-C (preferably original).

Instructions:

  1. Put the device into fastboot mode: Turn off the smartphone, then press Volume down + Power before the Fastboot logo appears.
  2. Connect to PC and check connection: Open the command prompt (cmd) in the folder with the platform-tools and execute: fastboot devices If the device is displayed (for example, 1234abcd fastboot), the connection is established.
  3. Please. TWRP: Enter the command (replace). twrp.img The name of your file: fastboot flash recovery twrp.img For partition devices recovery_ramdisk (for example, Poco F4 GT) Use: Fastboot Flash recovery_ramdisk twrp.img
  4. Reboot to TWRP: Without turning off the cable, do: fastboot reboot recovery If the device boots into a standard MIUI recavator, repeat step 3 as the firmware is not applied.

On some models (e.g. Redmi) K50) post-installation TWRP You need to immediately patch the patch. disable_dm-verity_forceencrypt, If you don't, it won't boot.

πŸ’‘

If after installing the TWRP device got stuck on the MI logo, try booting into the recavery via the combination Volume up + Power and flash a patch to disable the dm-verity check.

5. Common mistakes and their solutions

Even with the correct following of the instructions, errors can occur, and here are the most common ones and ways to fix them:

Mistake.Reason.Decision
FAILED (remote: 'Flashing is not allowed in Lock State')The bootloader is not unlocked or the unlock is reset.Repeat the unlock process through the Mi Unlock Tool. Sometimes reconnecting your Mi Account helps.
Invalid sparse file format at header magiThe.img file or incompatible version of TWRP is damaged.Download the file again from the official source. Check the MD5 checksum.
The device does not boot after installing the TWRPNo patch. disable_dm-verity or the wrong version of the recaveri.Flip the patch through fastboot or return to the standard recovery via the Mi Flash Tool.
E: Unable to mount /data in TWRPEncryption is FBE (File-Based Encryption) enabled.Enter the screen lock password in TWRP or format /data (will result in data loss!).

If after installing the TWRP, the device boots in a bootloop, try:

  1. Download to TWRP and flash Magisk (if you installed root).
  2. Remove the firmware to an older version of MIUI via fastboot.
  3. Perform a full reset (Wipe β†’ Format Data) in TWRP.

πŸ’‘

If TWRP is not installed on the first try, never repeat the command fastboot flash recovery without restarting to fastboot.

6. Additional TWRP settings: what to do after installation

After successful installation of TWRP, several important steps are recommended:

  • πŸ”„ Backup NANDroid: Go to Backup and select the Boot, System, Data, Vendor partitions. Save a copy to an external memory card or PC.
  • πŸ”‘ Install Magisk for root rights: Download the latest version of Magisk from GitHub and stream it through Install β†’ Select Image.
  • πŸ›‘οΈ Disable Forced Encryption: If You Plan to Use Custom ROM, format /data how F2FS or ext4 (depending on the kernel support).
  • πŸ“₯ Set up ADB Sideload: Enable the Advanced option β†’ ADB Sideload for easy installation ZIP-PC-file.

For dynamic partition devices (such as Xiaomi 12 or Redmi K40), standard TWRP backup may not work, in which case use alternative tools such as OrangeFox Recovery or PitchBlack Recovery, which are better adapted for new partitions.

7. Alternative methods of installing TWRP (for power users)

If the standard fastboot method doesn't work, you can try alternatives, which require more knowledge and are risky, but sometimes the only solution.

Installation TWRP through EDL-regime
Warning: This method can lock a device if executed incorrectly.It is only suitable for Qualcomm-based devices (e.g. Redmi Note) 9 Pro or Poco X3 NFC). Download the Mi Flash Tool and firmware for your model in.tgz format. Connect the device to EDL-In the mode (close test points on the board or use the command adb reboot edl if root is available). In the Mi Flash Tool, select the downloaded firmware and replace the file recovery.img yours TWRP.img. Switch the firmware with the Clean All option disabled.

Another method is to install TWRP through a temporary boot (without firmware in the recovery section):

fastboot boot twrp.img

This method allows you to boot into TWRP once without replacing the standard recovery. Suitable for devices where the TWRP firmware leads to a reset (for example, Xiaomi 11 Lite NE). After downloading to a temporary TWRP, you can immediately flash Magisk or make a backup.

8 How to Return the Standard MIUI Recovery

If you need to return the device to its original state (for example, for warranty repairs), do the following:

  1. Download the official firmware for your model from the MIUI Downloads website.
  2. Unpack the firmware and find the recovery.img file.
  3. Fastboot: Fastboot Flash Recovery recovery.img
  4. Reboot the device: fastboot reboot

To return to stock firmware, use the Mi Flash Tool with the Clean All option, which will delete all data, including TWRP and Magisk, and return the device to factory status.

⚠️ Note: Some devices (e.g. Redmi Note 12) may require re-unlocking the bootloader after returning to the drain Recovery. If you are selling or redecorating your phone, be sure to remove the Mi Account binding in the settings.

FAQ: Frequent questions about installing TWRP on Xiaomi

Can I install TWRP without unlocking the bootloader?
No, on all modern Xiaomi devices (starting with the Redmi Note 8), unlocking the bootloader is mandatory. The only exception is the temporary download of TWRP via fastboot boot, but this does not give permanent access to the Recovery.
Why does the TWRP device not boot after installation?
Most likely causes: There is no patch disable_dm-verity_forceencrypt. Incompatible version TWRP (For example, for devices with Dynamic Partition, the boot or vendor partition is damaged. TWRP + patch through fastboot or go back to stock firmware.
How to get around the wait of 720 hours to unlock the bootloader?
Unofficial methods (such as EDL or Mi Account swapping) often lead to a device being locked, and the only legal way is to wait.
Can I install TWRP on Xiaomi with a MediaTek processor?
Yes, but the process is more complicated than on Qualcomm. For devices on MediaTek (like Redmi 10A or Poco C40) it is required: Unlock the bootloader via Mi Unlock Tool. Use special versions of TWRP (like MTK TWRP). Firmware via SP Flash Tool instead of fastboot. The risk of "bricking" is higher, so it is recommended to look for guides specifically for your model.
What if TWRP doesn’t see internal memory?
This is because of the FBE encryption enabled. Solutions: Enter the screen lock password in TWRP (if requested). Format /data (will result in loss of all data!). Use ADB to copy files: adb pull /sdcard/