Installing TWRP on Xiaomi Redmi Note 7: a complete guide with unlocking the bootloader

Why install TWRP on Redmi Note 7 and what it does

TWRP (Team Win Recovery Project) is a powerful tool for owners of Xiaomi Redmi Note 7 (codename lavender), which provides access to functions not available in standard MIUI Recovery. With it you can install informal firmware (for example, LineageOS or Pixel Experience), create full backups (nandroid backup), remove preinstalled applications (bloatware), and restore the device after unsuccessful experiments.

However, installing TWRP on the Redmi Note 7 requires pre-unlocking the bootloader, a procedure that erases all data from the device and can lead to loss of warranty. Furthermore, since MIUI 12, Xiaomi has implemented Anti-Rollback (ARB) protection, which blocks the ability to roll back on older firmware versions, meaning that an incorrectly selected version of TWRP or firmware can turn a smartphone into a β€œbrick.”

In this guide, we will discuss in detail:

  • πŸ”“ How to officially unlock the bootloader through the Mi Unlock Tool (with the latest restrictions Xiaomi).
  • πŸ“₯ Where to download the current version TWRP Lavender and how to check its compatibility with your version MIUI.
  • πŸ”§ Step-by-step installation via fastboot and alternative methods (including: ADB Sideload).
  • ⚠️ Common Errors (e.g. Invalid sparse file format at header) and how to fix them.
πŸ“Š You've tried installing it before. TWRP Xiaomi?
Yes, successfully.
Yeah, but I've had some mistakes.
No, just planning.
I don't know what that is.

Preparation for installation: requirements and warnings

Before starting the procedure, make sure your device meets the following criteria:

  • πŸ“± The smartphone model is Xiaomi Redmi Note 7 (lavender). β†’ The phone. β†’ Model.
  • πŸ”‹ Battery charge at least 70%, interruption of the process due to discharge may result in inability to turn on.
  • πŸ’» Windows computer 7/10/11 (for Mi Unlock Tool or Linux/macOS (fastboot).
  • πŸ”Œ Original. USB-cable (preferably from the kit) Cheap cables can cause connection errors.

Also prepare the following files and tools:

ComponentDownload linkNotes
Mi Unlock ToolOfficial Xiaomi websiteYou need a Mi Account with a linked phone number.
TWRP for LavenderOfficial website of TWRPChoose a version that is compatible with your MIUI (see section below).
ADB & FastbootAndroid SDK Platform-ToolsUnpack at the root of the disk C:\platform-tools\.
Xiaomi driversMi PC SuiteInstall fastboot for proper operation.

⚠️ Attention: Unlocking the bootloader will reset all data on the device, including photos, contacts and apps. Create a backup through Settings β†’ Additionally. β†’ Backup and reset or use Mi Cloud (unless it is blocked in your area).

Starting in 2021, Xiaomi has tightened its unlock rules, requiring you to link your Mi Account to your device and wait 7 days before unlocking, and if you just created an account or dropped your phone, that can go up to 30 days.

What happens if you install TWRP on a locked bootloader?
Installing a custom recavator on a locked bootloader will cause an FAILED error (remote: 'Flashing is not allowed in Lock State').The device will not boot into the system, but it can be restored via fastboot with official firmware.

Step 1: Unlock the bootloader through the Mi Unlock Tool

The process of unlocking the bootloader on the Redmi Note 7 consists of three steps: linking the Mi Account to the device, waiting for confirmation and actually unlocking.

  1. Activate Developer Mode: Go to Settings β†’ About Phone and 7 times click on MIUI Version. Return to the main settings where a new Developer section will appear.
  2. Enable OEM Unlock and USB Debugging: In the Developer Menu, activate both. Without this, the Mi Unlock Tool won't see the device.
  3. Link your Mi Account: In the same menu, find Mi Unlock Status and click Add Account and Device. Enter your Xiaomi account details (it must be confirmed by phone number!).

After the account is attached, a waiting message will appear, which is usually 168 hours (7 days), but the time limit may vary.

  • πŸ“Ά Connect to the Internet via a mobile network (not Wi-Fi).
  • πŸ”„ Restart the device after linking the account.
  • ⏳ Check the unlock status in Mi Unlock Status – the remaining time will be displayed there.

When the wait is over, connect your phone to your PC in fastboot mode (turn off the device, then press Power + Volume Down), launch the Mi Unlock Tool, and follow the instructions on the screen. If done correctly, you will see the Unlocked successfully message.

Mi Account linked to device | OEM Unlock | USB | Debugging activated The device in fastboot |Mi Unlock Tool launched on behalf of the administrator-->

Step 2: Install TWRP via Fastboot

After successfully unlocking the bootloader, you can start installing TWRP.

  1. Download the current version TWRP For lavender from the official website, please note the version: MIUI 12/13 fit TWRP 3.6.2_9-0 Or newer. MIUI 11 older β€” 3.5.2_9-0.

OrangeFox/TWRP not working on encrypted devices.

Rename the downloaded file to twrp.img And put it in a folder. C:\platform-tools\.

Connect your phone in fastboot mode (as in the unlock stage) and check the connection with the command:

fastboot devices

If the device is determined (the serial number will appear), continue.

Set the TWRP command:

fastboot flash recovery twrp.img

After successful firmware, you will see a message OKAY [ 0.5s].

Important! Don't restart the device right away!

fastboot boot twrp.img

This will temporarily boot TWRP without overwriting the standard recavery.

If you replace TWRP with standard MIUI Recovery after the reboot, you have activated Anti-Rollback protection on your device.

⚠️ Attention: To secure TWRP, Immediately after loading into the Recovery go to Advanced β†’ Flash Current TWRP (If there is no such option, download TWRP Installer ZIP And run it through Install).

πŸ’‘

If after installing TWRP, the phone boots to bootloop (cyclical reboot), try flashing Magisk to fix the bootloader check. Download the latest version here and install via Install β†’ Select Storage β†’ Magisk.zip.

Step 3: Alternative methods for installing TWRP

If the installation via fastboot failed (for example, due to a FAILED error (remote: 'Not allowed in Locked State') even though the bootloader is unlocked), try alternative methods:

Method 1: Installation with ADB Sideload

This method is suitable if you already have a temporary TWRP installed, but it does not persist after a reboot.

  1. Download TWRP Installer ZIP (not.img!) from the official website.
  2. In TWRP, select Advanced β†’ ADB Sideload.
  3. On PC, run the command: adb sideload twrp-installer-lavender-3.x.x-x.zip

Method 2: Installation with OrangeFox Recovery

OrangeFox is a TWRP fork with advanced features (e.g. MIUI OTA support and built-in file manager).

  1. Download the latest version of OrangeFox for lavender from the official website.
  2. Quickboot is a TWRP: Fastboot Flash Recovery OrangeFox-*.img
  3. Load into the Recovery and select Install OrangeFox as Recovery.

OrangeFox is often better at encrypting data on MIUI 12+, but has a less intuitive interface than a classic TWRP.

πŸ’‘

If neither method worked, check the MIUI and Anti-Rollback (ARB) versions. Some firmware (e.g. MIUI 13.0.4+) requires you to roll back to the older version first via fastboot and then install TWRP.

Solving Common Errors When Installing TWRP

Even with the correct instructions, users often encounter errors, 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 unlocked on Xiaomi servers.Check status in the Mi Unlock Tool. If unlock is confirmed, repeat the procedure in 24 hours.
Invalid sparse file format at headerThe twrp.img file or incompatible version is damaged.Download the file again, check the checksum (MD5). For MIUI 12+, use TWRP 3.6.2+.
Device not defined in fastboot devicesThere are no drivers or faulty cables.Set up Mi. PC Suite, try another one. USB-port (preferably) USB 2.0).
TWRP is replaced by MIUI RecoveryAnti-Rollback protection is activated or does not embroidery TWRP Installer ZIP.Please. disable_forceencrypt.zip (to disable encryption) and TWRP Installer ZIP.

If the phone does not boot to the system after installing TWRP, try:

  1. Switch Magisk (to bypass the bootloader check).
  2. Disable forced encryption via Format Data β†’ Yes (all data will be deleted!).
  3. Install firmware MIUI via fastboot with a flag --erase-userdata.

Warning: Installing Magisk or modified cores can cause MIUI malfunctions, especially if you use Mi Pay, Mi Fit or banking apps. Use MagiskHide Props Config to mask root rights.

If you plan to install custom firmware (such as LineageOS or ArrowOS), first:

  1. Check firmware compatibility with your device’s Anti-Rollback version.
  2. Download GApps (Google services) for firmware without them.
  3. Format the Data partition (if the firmware requires F2FS instead of ext4).

πŸ’‘

Before installing custom firmware, check reviews on the XDA-Developers forum.Some builds may have issues with the camera, NFC, or fast charging on the Redmi Note 7.

FAQ: Frequent questions about TWRP on Redmi Note 7

Can I install TWRP without unlocking the bootloader?
No. Xiaomi blocks custom recavator firmware on the locked bootloader. The only workaround is temporarily downloading TWRP through fastboot boot twrp.img, but once rebooted, it will disappear.
Why After Installation TWRP The phone asks for a password, even though it wasn’t there?
This is due to the encryption of data in MIUI. To solve the problem, in TWRP Choose the Wipe β†’ Format Data (all data will be deleted!) or disable_forceencrypt.zip.
How to get back standard MIUI Recovery?
Download the official firmware MIUI For your model and run it through fastboot with a flag --recovery Or use the Mi Flash Tool.
Can I update TWRP without losing data?
Yes, download the new version. twrp.img, Load to the current recap and select Install β†’ Install Image β†’ twrp.img. After the update, reboot to Reboot (Reboot) β†’ Recovery).
Why does TWRP not see internal memory?
It's because of encryption. FBE (File-Based Encryption in MIUI 12+. Solutions: Format Data in TWRP (You can delete the data! Use OrangeFox, it works better with encryption. OTG-storage SD-backup.