How to completely remove firmware on Xiaomi: 5 proven methods

Removing firmware on Xiaomi devices is a procedure that may be necessary when switching to custom firmware, rolling back to the factory version or eliminating critical system errors. However, many users confuse this concept with a normal settings reset or software update. In fact, removing firmware involves completely cleaning the /system partition and rewriting it with a new version of the OS - whether it is an official MIUI or an alternative build like LineageOS.

In this article, we will discuss 5 working ways to remove firmware on Xiaomi, Redmi or POCO – from standard tools like Fastboot to manual formatting via TWRP. Special attention will be paid to the risks of β€œbrick” (complete failure of the device) if you do not act correctly with the boot or modem partition, as well as legal methods of unlocking the bootloader, without which most operations are impossible. If your goal is simply to return the phone to a factory state, you may need to reset via Recovery (the instructions are in one of the sections below).

1.When to remove firmware on Xiaomi: 3 good reasons

Before you start manipulating the system, make sure that they are really necessary. Firmware removal is not a panacea, and in most cases, the problem can be solved with less radical methods.

  • πŸ”„ Reverse to the old version MIUI. The new firmware is unstable, drains the battery quickly, or contains critical bugs (e.g., a com.android.phone error on the Redmi Note 10 Pro after upgrading to a newer version of the new device). MIUI 14).
  • πŸ› οΈ Install custom firmware. To switch to Pixel Experience, ArrowOS or other AOSP builds, you need to completely clear the partition /system.
  • 🚨 Recovery after failure: The device loads into an infinite bootloop, produces a dm-verity corruption error, or does not respond to the power button at all.

It is important to distinguish firmware removal from other procedures:

ProcedureWhat's he doing?Does the unblocking of the loader require?
Resetting (Factory Reset)Deletes user data but leaves the system intact❌ No.
Update via OTAReplaces system files with a new version, saving data❌ No.
Remove the firmware through FastbootCompletely erases /system partition and rewrites itβœ… Yes.
Formatting through TWRPCleans /system, /data, /cache for custom firmware installationβœ… Yes.

⚠️ Attention: If your goal is to simply free up space in memory, removing the firmware won't help. /system It's protected from change, and cleaning it without flashing it again will make the device inoperable. β†’ Memory. β†’ Cleanup.

πŸ“Š Why you want to remove firmware on Xiaomi?
I want to go back to the old version of MIUI.
We need to install custom firmware.
The device does not turn on after the update
Another reason.

Preparation of the device: unlocking the loader

Most firmware removal methods on Xiaomi require an unlocked bootloader. Without this, you won’t be able to flash the device through Fastboot or install TWRP. The exception is a reset via standard Recovery, but it doesn’t delete the firmware itself, only user data.

The official way to unlock is through the Mi Unlock Tool, which takes up to 720 hours (30 days) of waiting due to Xiaomi’s anti-theft policy.

  1. Link your Mi Account to your device in Settings β†’ Xiaomi Account.
  2. Enable USB debugging and OEM unlocking in Settings β†’ About Phone β†’ MIUI version (click 7 times, then return to Additional β†’ For Developers).
  3. Download Mi Unlock Tool, log in to your account and connect your phone in Fastboot mode (clip Volume Down + Power).
  4. Start the unlock process. If you see a message called Couldn't unlock. Wait 168/720 hours, wait for the time specified.

Once the bootloader is unlocked, a warning will appear on the screen when turned on: This device is unlocked. This is normal and does not affect the operation of the device.

πŸ’‘

If you bought the device with your hands, make sure that the previous owner untie your Mi Account in Settings β†’ Xiaomi Account. Otherwise, after the reset, the phone will require you to enter its data (Mi Cloud Lock protection).

Method 1: Remove the firmware via Fastboot (official method)

The most reliable way to completely remove the firmware and install a new one is to use Fastboot and official images from Xiaomi, a method that is suitable for rolling back to the old version of MIUI or recovering from a crash.

You'll need:

  • πŸ–₯️ Computer with Windows/Linux and installed drivers ADB/Fastboot.
  • πŸ”Œ Cable USB (preferably original).
  • πŸ“¦ Official firmware in.tgz format for your model (you can download it on the official website).
  • πŸ”“ Unlocked loader.

Step-by-step:

  1. Unpack the archive with the firmware in the folder with fastboot.
  2. Turn off the phone and press Volume Down + Power to log into the Fastboot.
  3. Connect the device to your PC and execute a command to check the connection: fastboot devices Must appear serial number of the device.
  4. Run the firmware script: flash_all.bat (for Windows or./flash_all.sh (for Linux/Mac).
  5. Wait for the finish (10-15 minutes) and the device will restart automatically.

⚠️ Note: If you are using Redmi Note 9 Pro (joyeuse) or POCO X3 NFC (surya, use flash_all_except_storage.bat, Not to lose data in the section /data. For complete cleaning, only suitable flash_all.bat.

β˜‘οΈ What to check before running through Fastboot

Done: 0 / 4

Method 2: Formatting via TWRP (for custom firmware)

If you plan to install custom firmware (like LineageOS or Pixel Experience), a standard Fastboot won’t be enough. You’ll need TWRP, a custom recovery that allows you to format partitions and install unofficial images.

Warning: misuse of TWRP can lead to a "brick" (total device failure).For example, formatting the modem partition on Xiaomi Mi 11 (venus) results in a loss of IMEI.

Instructions:

  1. Install. TWRP For your model, Fastboot: Fastboot Flash Recovery twrp-3.7.0_9-0-joyeuse.img (Replace joyeuse with your device’s codename).
  2. Boot into TWRP: Turn off the phone, then press Volume Up + Power.
  3. Go to Wipe. β†’ Advanced Wipe and mark: πŸ“ Dalvik / ART Cache πŸ—ƒοΈ System 🧹 Data πŸ”„ Cache

Don't touch it.

Modem

EFS

Persist

Swipe for formatting.

Install

What if TWRP doesn’t see internal memory?
If the /data partition is not mounted after installing the TWRP, try: 1. Reflash the TWRP with the "Reboot to Recovery" tick in the Mi Flash Tool. 2. In TWRP, go to "Mount" and manually mount /data. 3. If it does not help, use the command fastboot format:ext4 userdata (erase all data!).

5. Method 3: Recoil through the Mi Flash Tool (for "bricks")

If the device doesn’t turn on (hung on the Mi logo or flashes a red indicator), the Mi Flash Tool, the official firmware utility for emergency cases, will help.

Algorithm of action:

  1. Download the full firmware image (select the Fastboot version, not Recovery).
  2. Unpack the archive in a folder without Cyrillic characters.
  3. Start the Mi Flash Tool, connect the device to the PC (clip Volume Down + Power for 10 seconds).
  4. In the utility, click Select, specify the path to the folder with the firmware.
  5. Select Clean All (Full Cleaning) or Clean All and Lock (Cleaning + Lock bootloader).
  6. Press Flash and wait until it is completed (up to 20 minutes).

πŸ’‘

Clean all and lock mode will lock the bootloader back. Use it only if you plan to stay on the official firmware. Choose Clear all for custom builds.

6. Method 4: Recovery reset (without removing firmware)

If your goal is to simply return the phone to factory settings without removing the firmware itself, resetting through standard Recovery is enough.This method does not require unlocking the bootloader and is suitable for eliminating software glitches.

How to do this:

  1. Turn off the device.
  2. Press Volume Up + Power before the Mi Recovery logo appears.
  3. Choose a language (if you have a choice).
  4. Go to Wipe Data β†’ Wipe All Data.
  5. Confirm the action and wait for the completion.

This method does not remove the firmware, but only:

  • 🧹 Clears user data (photos, apps, settings).
  • πŸ”„ Resets network and account settings.
  • πŸ“± Leaves. MIUI intact.

⚠️ Note: On some models (Xiaomi Mi) A2, Mi A3) Recovery reset may result in a device being locked if Factory Reset Protection was previously enabled (FRP). To avoid this, untie your Google account in the settings before resetting.

7. Risks and how to avoid the "brick" of the device

Firmware removal is a high-risk procedure to turn your phone into a brick. Here are the 3 most common bugs and how to avoid them:

  1. For example, trying to install MIUI 14 for Redmi Note 10 (mojito) on Redmi Note 10 Pro (sweet) will result in a bootloop. Solution: always check the model's codename in Settings β†’ About Phone β†’ MIUI version (for example, surya for POCO X3 NFC).
  2. Critical partition formatting: Removing modem, persist, or efs disrupts network, camera, and sensors. Solution: In TWRP, format only system, data, and cache.
  3. Interrupt. If the firmware on the Fastboot is interrupted by 50 percent, the device may stop turning on. Solution: Use a laptop with a charged battery or UPS.

Symptoms of "brick" and methods of recovery:

Symptoms.Probable causeDecision
The device vibrates when turned on, but the screen is black.The boot or dtbo section is damagedSwipe through Fastboot with flash boot and flash dtbo tick
Hanging on the Mi logo (bootloop)MIUI version conflict or corrupted files in /systemClean all in the Mi Flash Tool
No network (IMEI missing)The modem or nvram partition is damagedRestore via TWRP (EFS backup) or flash the original firmware
How to restore IMEI after modem partition damage?
If you have lost IMEI after the firmware: 1. Find the /efs backup (if you did it in TWRP). 2. Restore it through TWRP to /efs. 3. If there is no backup, use the engineering menu (#4636##) or the SN Write Tool utility (requires authorization from Xiaomi).

8. Frequently Asked Questions (FAQ)

❓ Can I remove the firmware without unlocking the bootloader?
No, it requires an unlocked bootloader to completely remove the firmware (clean /system partition) except for Recovery reset, but it doesn't delete the firmware itself, just user data.
❓ What to do if after removing the firmware, the phone does not turn on?
If the device doesn’t respond to buttons or is stuck on the logo: Try booting into Fastboot (Loudness down). + Power) and flash the official firmware through the Mi Flash Tool. If the Fastboot is not available, check if the device in Windows Device Manager is identified as Qualcomm HS-USB QDLoader 9008. If yes, use it. EDL-Mode and firmware via Mi Flash Pro. on models with a MediaTek processor (Redmi) 9A, POCO C31) might help SP Flash Tool.
❓ How to find out the code name of my Xiaomi device?
Codename (e.g. surya, joyeuse) can be found in: Settings: Settings β†’ The phone. β†’ Version. MIUI β†’ Assembly number (e.g, QKQ1.200114.002.surya_global β€” This is surya, and there's a code name. ADB: Connect your phone to your PC and execute the command: adb shell getprop ro.product.device
❓ Can I return the official firmware after the custom?
Yes, but there are nuances: If the bootloader is unlocked, run the official firmware through Fastboot or Mi Flash Tool. If the bootloader is blocked, you will need to unlock it again (waiting 720 hours). On some models (Xiaomi Mi 11 Ultra), switching from custom firmware to official firmware can cause problems with Anti-Rollback. MIUI.
❓ Why does Mi Flash Tool give you an β€œaccount not bound” error"?
This error means that the Mi Account is not tied to the device. Solutions: Turn on the phone, log in to the Mi Account in the settings and link it to the device. If the phone does not turn on, try linking the account via Mi Cloud on another device (enter your phone's IMEI). Some models (Redmi Note 8 Pro) require authorization through the Mi Unlock Tool even for firmware via Mi Flash.