Xiaomi Formatting via Fastboot: Detailed Instructions with bootloader Unlocking

Introduction: When to format Xiaomi via Fastboot

Formatting Xiaomi’s smartphone via Fastboot mode is a radical method of solving system problems that is used in cases where standard reset via Settings does not help, which allows you to completely clean the internal memory of the device, including partitions with firmware, and install a clean version of MIUI or custom build.

It is important to understand that formatting through Fastboot is not just a reset, but a complete rewriting of all memory partitions, which requires the bootloader to be unlocked beforehand and special tools.

The process differs from standard Wipe Data in Recovery in that it affects even those areas of memory that are normally protected from change, which means that after the procedure you will have to reconfigure the device, as after purchase, but with the guarantee that there are no software conflicts. However, there are risks: wrong actions can lead to a complete loss of performance of the smartphone, so the instructions should be carried out carefully and only if you have a backup of the data.

Preparing for Formatting: What to Do in Advance

Before you start formatting via Fastboot, you need to follow a few critical steps, and neglecting them can lead to irreversible consequences, including losing all data or locking the device.

  • πŸ“± Back up all the important data (photos, contacts, messages) and you can't recover it after formatting.
  • πŸ”‹ Charge the battery to at least 70%. interruption of the process due to battery discharge can "brick" the device.
  • πŸ–₯️ Install drivers for Xiaomi on PC. Without them, the computer will not recognize the smartphone in Fastboot mode.
  • πŸ”“ Unlock the bootloader (if it is blocked). Without this formatting through Fastboot is impossible.
  • πŸ“‚ Download the firmware for your model. It's going to be used to restore the system after cleaning.

Special attention should be paid to unlocking the bootloader. Xiaomi blocks this feature by default to protect against unauthorized changes.

  1. Link your Mi Account to your device in settings (Settings β†’ Mi Account β†’ Link your account).
  2. Apply for unlocking through the official Mi Unlock Tool (you can download it on the Xiaomi website).
  3. Wait 7-14 days (depending on Xiaomi policy), and then the bootloader can be unlocked.

⚠️ Note: If you did not unlock the bootloader in advance, formatting through Fastboot will not be possible. Trying to execute commands without unlocking will lead to an error. FAILED (remote: device is locked).

πŸ“Š What Xiaomi model do you plan to format?
Redmi Note 10/11/12
POCO X3/X4/X5
Mi 11/12/13
Another model

Tools and programmes required

To successfully format Xiaomi through Fastboot, you will need a set of specialized tools. Without them, you can not perform the procedure.

Tool.AppointmentWhere to download
Mi Unlock ToolOfficial utility for unlocking the bootloaderOfficial Xiaomi website
Mi Flash ToolSoftware for firmware and formatting through FastbootMIUI Download Page
ADB & Fastboot ToolsSet of commands to work with Android through PCAndroid Developers
Firmware for your modelFirmware file in.tgz or.zip formatXiaomi Firmware Updater
Qualcomm or Mediatek driversDrivers for device recognition in FastbootIt depends on the processor of your smartphone.

Pay special attention to the choice of firmware. It should match the exact model of your device and the region. For example, the firmware for the Redmi Note 10 Pro (codename sweet) is not suitable for the Redmi Note 10 (codename mojito).

Also check that your PC has drivers installed to work with Fastboot. If the device is connected in Fastboot mode (black screen with a rabbit and the inscription Fastboot), the computer does not emit a connection sound or does not detect the device in Device Manager, then the drivers are installed incorrectly, in this case, it is recommended to use the Driver Signature Enforcement Overrider utility for forced installation.

πŸ’‘

If you are not sure about the model of your device, you can find out it by entering the command fastboot getvar product in the terminal after connecting the smartphone to the PC.

Step-by-step: how to format Xiaomi via Fastboot

Now, let's get straight to the formatting process. Follow the steps to avoid errors. The whole process can be divided into three stages: entering Fastboot mode, executing formatting commands, and installing firmware.

Step 1: Enter Fastboot Mode

  1. Turn off your smartphone.
  2. Press and hold the Power + Volume Down buttons for 10-15 seconds until the screen with the rabbit and the Fastboot label appears.
  3. Connect the device to the PC through USB-cable (preferably original).

Step 2: Check the connection and unlock the bootloader

Open the command prompt (or PowerShell) in the folder with ADB & Fastboot Tools and type:

fastboot devices

If the device is determined (the serial number will appear), you can continue. If not, check the drivers or cable.

If the bootloader is not yet unlocked, do:

fastboot oem unlock

Then the device will restart and erase all the data, and if the bootloader is already unlocked, skip this step.

Step 3: Formatting sections

Now let's start formatting. Type in the commands one by one.

fastboot erase boot


fastboot erase system




fastboot erase userdata




fastboot erase cache

These commands will clear the main partitions of the device. For full formatting (including modem, dsp, and others), you can use:

fastboot erase --all

⚠️ Attention: Fastboot erase team --all Deletes all sections, including those responsible for IMEI Use it only if you are confident in your actions and have a backup copy of the persist partition.

The bootloader is unlocked|Device is defined in fastboot devices|Backup copy of data created|The firmware for the model is downloaded|The battery is charged at more than 70%-->

Step 4: Installation of firmware

Once formatted, the device won't be able to boot -- it has nothing to download. So you need to install the firmware right after cleaning.

  1. Unpack the downloaded firmware (.tgz format) in a folder without Cyrillic characters.
  2. In the Mi Flash Tool, click Select and select the folder with the firmware.
  3. Press Refresh – your device should appear in the list.
  4. Select Clean All (Full Cleaning) or Clean All and Lock (Cleaning + Lock bootloader).
  5. Press Flash and wait for the process to end (5-10 minutes).

Once the firmware is successful, the device will automatically restart. The first run can take up to 15 minutes β€” that's normal.

πŸ’‘

Formatting via Fastboot erases all data without recovery. Make sure the backup is created and the firmware is suitable for your model.

Common mistakes and their solutions

Even with strict adherence to instructions, errors can occur, and here are the most common ones and ways to fix them:

  • 🚫 Mistake. FAILED (remote: device is locked) Reason: bootloader not unlocked Solution: Unlock the bootloader via Mi Unlock Tool (see Preparation section").
  • πŸ”Œ Device not defined in fastboot devices Reason: Drivers missing or cable faulty Solution: Install drivers manually through Device Manager or try another USB-cable (preferably original).
  • πŸ“± After the firmware, the device does not turn on Reason: Inappropriate firmware or interrupted process Solution: Repeat the firmware by choosing the correct version MIUI If the device is not responding, try to flash through EDL-Regime (Authorized Account Required).
  • ⚑ Critical partition flashing is not allowed Reason: Trying to flash a locked device or using unofficial firmware Solution: Unlock the bootloader or use official firmware from Xiaomi website.

If you encounter an error that isn't on the list, look at the code, and it often encrypts a hint, like errors with the remote prefix, which indicate a problem on the device side, and errors with FAILED, which indicate a problem with the command or connection.

What if the device has become a brick?
If the smartphone doesn’t turn on after a failed formatting (black screen, no button response), try the following steps: 1. Connect the device to charging for 30-60 minutes – the battery may have run out. 2. Try logging into Fastboot (Power buttons). + Volume reduction) or EDL-mode (Power buttons) + Volume increase). 3. If the device is identified in Device Manager as Qualcomm HS-USB QDLoader 9008 can be restored via Mi Flash Tool in mode EDL (Authorization is required. 4 If nothing helps, contact the service center - it is possible that the hardware (for example, flash memory) is damaged).

Data recovery after formatting

Once formatted via Fastboot, all the data on the device will be erased without the ability to recover it in the standard way, but if you had a backup, you can return some of the information.

  • πŸ“² Recovery via Mi Cloud If you sync your data to your Mi Account, after logging in on a formatted device, you will be prompted to restore contacts, notes, photos and other data from the cloud.

It is important to understand that recovering data from Fastboot formatting is the exception rather than the rule: most files (especially those stored in internal memory) will be lost irretrievably, so backing up before the procedure is mandatory.

If you used TWRP Recovery before formatting, there is a chance that the backup (nandroid backup) was saved on the memory card.

  1. Install TWRP again via Fastboot:
  2. In TWRP, go to Restore and select the saved copy.

⚠️ Note: Recovery from nandroid backup can return old system errors if they were the reason for formatting. Use this method only if you are sure of the cleanness of the backup.

Alternative Resetting Methods by Xiaomi

Fastboot formatting isn't the only way to get your smartphone back to factory settings, but depending on the situation, there are other methods that might be easier or safer to use.

MethodWhen to useAdvantagesDeficiencies
Reset via SettingsThe device turns on and responds to commandsSimplicity, does not require a PCDoes not clean system partitions completely
Wipe in RecoveryThe device is loaded into Recovery, but not into the system.Does not require unlocking the loaderDoes not clean the system and boot partitions
Fastboot (this method)The device is not switched on or a complete cleaning is requiredCleans all sections, including systemRequires unlocking the bootloader and PC
EDL-regimeThe device in the state of "brick" (does not respond to buttons)It also restores dead devices.Requires authorization and special cable

If your goal is to simply return the smartphone to factory settings without deep cleaning of system partitions, just reset through Settings β†’ About Phone β†’ Reset. This method saves the unlocked bootloader and does not require a connection to the PC.

If the device loads into Recovery (the robot with a red exclamation point on the screen), you can run Wipe Data right from there:

  1. Press Power + Volume Up to Enter Recovery.
  2. Select Wipe Data β†’ Wipe All Data (Manage Volume and Power buttons).
  3. Confirm the action and wait for the completion.

However, if the problem is related to damage to system files (for example, after a failed update), Wipe Data in Recovery will not help - it will require Fastboot formatting or flashing.

FAQ: Answers to Frequent Questions

Can Xiaomi be formatted via Fastboot without unlocking the bootloader?
No. Without unlocking the bootloader, any Fastboot commands that involve changing system partitions (including formatting) will be blocked with the device is locked error. Unlock is mandatory.
Will I lose my warranty after formatting through Fastboot?
Yes, unlocking the bootloader and formatting through Fastboot removes the device from warranty. Xiaomi considers this an interference with system software. However, if after the procedure you lock the bootloader back (fastboot oem lock command), it will be less noticeable externally, but the warranty will still not be restored.
How do I know if my Xiaomi bootloader is unlocked?
Turn off the device, then press Power + Volume Down to enter the Fastboot. If the bottom of the screen says Unlocked, bootloader unlocked. If Locked is locked. You can also check by command: fastboot oem device-info In the output, find the line Device unlocked: true/false.
What to do if after formatting the smartphone does not see SIM-map?
This can happen if the modem or persist partitions that are responsible for IMEI were erased during formatting. Solutions: Sweat the device with the official firmware through the Mi Flash Tool (select Clean all and lock mode). If the IMEI is gone, restore it through the engineering menu (code # #4636##) or specialized utilities like the SN Write Tool (requires authorization).
Can I cancel formatting via Fastboot?
No. Once fastboot erase commands are executed, the data is deleted without the possibility of canceling, and the only way to bring the device back to life is to flash it back again, which is why it's so important to have a backup and the right firmware on hand.