How to wipe the system on Xiaomi: 3 proven ways to completely reset MIUI

Removing the operating system on Xiaomi smartphones is a procedure that is required in rare but critical cases: when preparing a device for sale, fixing deep software failures or before installing custom firmware. Unlike standard reset to factory settings (Wipe Data in Recovery), complete erasure involves removing all partitions, including /system, /vendor and /boot. This returns the device to a state of β€œclean canvas”, but risks turning the gadget into a β€œbrick” if you do not follow the key rules.

In this article, we will discuss three officially supported erasure methods. MIUI β€” via Fastboot, Recovery and ADB, β€” Taking into account the features of different generations of Xiaomi smartphones (from Redmi Note) 4X We will focus on unlocking the bootloader, without which any manipulation of partitions of the system is impossible, and you will learn how to avoid typical errors, such as loss of power. IMEI or blocking the Mi Account after resetting.

Preparing for System Deletion: What to Do Before Starting

Before you start deleting MIUI, follow the mandatory preparatory steps, and ignoring them in 80% of cases leads to irreversible consequences - from data loss to complete failure of the device.

  • πŸ”“ Unlock the bootloader through the official Mi Unlock Tool. On new models (released after 2021), it takes up to 720 hours of waiting due to Xiaomi's policy.
  • πŸ“± Create a backup through Settings β†’ Additionally. β†’ Backup and reset. Save a copy on your PC - after erasing the system, it will be impossible to restore data.
  • πŸ”‹ Charge the battery to at least 60 percent, and interruption due to battery discharge is guaranteed to lead to "bricking".
  • πŸ’» Install drivers for your model. Windows will require Mi Flash Tool and package ADB/Fastboot Drivers.

It is critical to check the status of the persist partition – its damage after reset can deprive the device of communication (no IMEI) or the camera. To avoid this, before erasing, follow the command in ADB:

adb shell


su




dd if=/dev/block/bootdevice/by-name/persist of=/sdcard/persist.img

The persist.img file is copied to internal memory, which can be restored later. If you don't have root permissions, skip this step, but be prepared for possible problems with communication modules.

⚠️ Note: On devices with MediaTek processors (e.g. Redmi) 9A, POCO M3) Erasure of the nvram partition will result in loss IMEI. Use only methods that do not affect this section, or pre-backup it through SP Flash Tool.

πŸ“Š What type of resetting method you plan to use?
Fastboot
Recovery (TWRP)
ADB
I haven't decided yet.

The method through Fastboot is the most reliable for devices on Qualcomm Snapdragon (for example, Xiaomi). 12T, POCO F5). It allows you to selectively delete partitions of the system without the risk of damaging critical data. modemst1/st2 (The PC will need to be installed with the Mi Flash Tool and ADB/Fastboot.

Step-by-step:

  1. Turn off your smartphone and press Volume Down + Power to log into the Fastboot.
  2. Connect the device to your PC via the original USB Type-C cable.
  3. Open the command prompt (CMD) in the ADB folder and do:
fastboot devices

If the device is determined (its serial number will appear), continue. If not, check the drivers.

fastboot erase system


fastboot erase vendor




fastboot erase product




fastboot erase boot




fastboot erase dtbo

For a complete reset (including user data), add:

fastboot erase userdata


fastboot erase metadata

After erasing, restart the device in Fastboot and run the clean firmware through the Mi Flash Tool (select Clean All option).

⚠️ Note: On Dynamic Partition devices (all Android models) 10+) The fastboot erase system may not work. Instead, use: fastboot erase. system_a fastboot erase system_b Ignoring this nuance will lead to error. FAILED (remote: 'Not allowed in Lock State'). β˜‘οΈ Checklist before erasure via FastbootConnection to PCSMade backup persist/nvramBattery charge >60%Drivers installed ADBUnlocked loader Completed: 0 / 5 Method 2: Washing through custom Recovery (TWRP) If your Xiaomi has custom Recovery installed (for example, TWRP), It's a simpler process to erase the system, and it's a method that's suitable for devices with MediaTek, like the Redmi Note. 11), Fastboot has limited capabilities, but there is a risk of damaging the iron-critical partitions if you don't know what they're used for. How to erase the system through TWRP: Load into Recovery (click Volume Up). + Power when the phone is off. Go to the Wipe section β†’ Advanced Wipe. Tick the following sections: πŸ“± System πŸ› οΈ Vendor πŸ‘’ Boot πŸ“¦ Product (if available) πŸ—ƒοΈ Data (optional, for full reset) Swipe across the screen for confirmation (Swipe to Wipe). Once the process is complete, the device will be in a "no OS" state. To restore functionality, run the firmware through Install in the computer. TWRP (Select the.zip file with MIUI Or custom firmware. Section Purpose Can be washed? System Main Android firmware Yes Vendor Drivers and binaries of the manufacturer Da Boot Core and bootloader Yes Persist IMEI, Calibration of sensors No (risk of loss of communication) Modem Cellphone settings No ⚠️ Attention: If in TWRP There is no Product section, but it is in your firmware (check through fastboot getvar all), it is necessary to erase it through Fastboot! Otherwise, after firmware, errors will occur with Google services. TWRP Does it not see internal memory? is it due to data encryption (FBE). Decision: 1) B TWRP Go to Wipe. β†’ Format Data (enter "yes"); 2) Reboot to Recovery; 3) Now the internal memory will be available for mounting. Method 3: Remove the system through ADB (for experienced users) The method through ADB Suitable if the device is on, but the system is unstable (e.g. looped bootloop). It requires root rights or an unlocked bootloader, and the main advantage is the ability to selectively erase without losing user data (if you do not touch the userdata partition). USB In Settings β†’ The phone. β†’ Version. MIUI (press 7 Once, then return to the additional β†’ Connect your smartphone to your PC and do: Adb shell su mount -o rw,remount /system For system erasure: rm -rf /system/* rm -rf /vendor/* rm -rf /product/* For complete reset (including data): rm -rf /data/* Once completed, restart the device to Fastboot and flash through the new firmware.This method is not recommended for beginners - a command error (e.g., rm). -rf / rm -rf /system/*) This will cause irreversible damage to all sections. πŸ’‘If, after erasing, through ADB The device does not load, try to restore the bootloader with the command fastboot flash boot boot.img, where boot.img β€” A file from unpacked firmware for your model, typical errors and how to avoid them, even when following instructions, users often encounter problems. TOP-5 mistakes and their solutions: 🚫 "Device is locked in Fastboot β†’ The bootloader is not unlocked. Use the Mi Unlock Tool. πŸ“΅ There is no network after resetting β†’ Persistent or nvram is damaged. Restore it from the backup. πŸ”„ Loading loop (bootloop) β†’ Incompatible firmware. MIUI, region-specific. πŸ”’ Mi Account blocked β†’ Mi Account-based devices require login/password input after reset. Untie your account in advance at Settings β†’ Xiaomi account. πŸ› οΈ Error "Invalid sparse file format" β†’ Firmware file damaged. Download it again from Xiaomi's official website, focus on regional firmware binding. Install Global ROM on a device from the original China ROM (and vice versa) may result in the module being blocked NFC Check the version with fastboot getvar product. πŸ’‘You can delete modem, persist and nvram only if you have backup copies. IMEI or sensors are 99 percent inoperable. MIUI After successful system erasure, the device will be in state No. OS. To bring it back to life, you need to flash the official or custom firmware. Xiaomi has two main tools: Mi Flash Tool - for firmware through Fastboot (files.tgz or.zip from the official website). TWRP β€” To install custom firmware (such as LineageOS or Pixel Experience) in.zip format. How to sew MIUI Mi Flash Tool: Download the firmware for your model from Xiaomi Firmware (select Fastboot version). Unpack the archive into a folder without Cyrillic characters (for example, unpack the archive in a folder, C:\MIUI\). Run the Mi Flash Tool, connect the device in Fastboot mode. Select the firmware folder and press Refresh. The device should be determined. Select the Clean All option at the bottom and press Flash. 5–10 When it's done, it automatically reboots to the new system. If the firmware doesn't start, check: πŸ”Œ Cable USB (must support the transmission of data). πŸ–₯️ Mi Flash Tool (new models require version) 2023+). πŸ“ Integrity of firmware files (check hash) MD5). Frequent questions (FAQ) Can you erase the system on Xiaomi without unlocking the bootloader. Any manipulation of system, boot or vendor partitions requires an unlocked bootloader. Except for Wipe Data reset in stock Recovery, but it doesn't delete the system itself, it only deletes user data. Why doesn't the phone turn on after the system is wiped? Most likely, the boot partition is damaged or the firmware is missing. MIUI via Fastboot with Clean All option. If the device is not determined by the PC, check the drivers or try another cable. IMEI After erasing the partition persist? If you have a backup persist.img, Restore it with Fastboot: Fastboot Flash Persistent persist.img If there is no backup, try generating it. IMEI through the engineering menu (##4636##) Or you can go to the service center. META. Which firmware to choose after erasure: stable or developer? For everyday use, a stable version of MIUI (designated as Stable) is recommended. Developer versions contain bugs and are designed to test new features. Check firmware compatibility with your model on Xiaomi. Can you erase the system on Xiaomi using a Mac/Linux computer? Yes, but additional configuration is required. On Mac, install ADB/Fastboot via Homebrew: brew install android-platform-tools On Linux, use the package manager: sudo apt install adb fastboot?