Xiaomi bootloader is a software component that runs to the operating system and determines what software will be downloaded on the device. By default, it is blocked on all smartphones of the brand, but many users will unlock it to install custom firmware, obtain root rights or test beta versions of MIUI. However, there are situations when you need to return the factory lock β for example, before selling the device, to restore warranty or fix software failures.
The Fastboot lock process is officially supported by Xiaomi, but it has a number of nuances, from the need to log in to Mi Account to the risk of βbrickingβ the device if you do not do it correctly. In this article, we will discuss all the steps of the procedure, including preparation, the commands themselves and how to solve possible errors.
Why you may need to lock the loader
The main reason is the restoration of factory condition, and the unlocked bootloader leaves traces in the system, which can:
- π΄ Deprive warranties β Xiaomi service centers check the status of the loader during repair.
- π΄ Determinate security β Open bootloader makes it easier to install malware.
- π΄ Failure to Fail β Some Functions MIUI (Mi Pay or Face Unlock are not working.
- π΄ Lock down OTA-Updates β the system may not receive official updates.
In addition, a lock is required for:
- π± Device sales β the new owner will not be able to accidentally install unofficial software.
- π Return to stock firmware after experiments with custom ROM.
- π‘οΈ Resolve Anti-Rollback errors when the device refuses to boot.
β οΈ Attention: Locking the bootloader erases all data on the device, including files in internal memory. If encryption is enabled on the smartphone, it will be impossible to restore data after the procedure.
Preparation of the device: what to do before blocking
Before starting the procedure, be sure to follow the following steps:
Create a backup copy of data (photos, contacts, messages)
Make sure that the battery charge is > 50%
Download the official firmware for your model
Install ADB/Fastboot drivers on PC
Sign in to Mi Account on your device and to Mi Unlock Tool
Disable Mi Account protection (if you plan to sell your phone)
-->
Pay special attention to the firmware version. If the device has a custom build or beta version of MIUI, you must flash the official stable firmware through Fastboot before blocking. Otherwise, the risk of bricking increases to 70%.
To check the current firmware version, go to Settings β About Phone β MIUI. If the version contains the words Beta, Developer or Custom, it should be replaced with stable.
| Model of the device | Minimum version of MIUI for blocking | Do I need to unlock before blocking? |
|---|---|---|
| Redmi Note 10 Pro (sweet) | MIUI 12.5 Stable | No. |
| Poco X3 Pro (vayu) | MIUI 13.0.4 Stable | Yes (if you have a custom firmware) |
| Mi 11 (venus) | MIUI 14.0.1 Stable | No. |
| Redmi 9A (dandelion) | MIUI 12.0.8 Stable | Yeah (for the anti-rollback) |
β οΈ Note: MediaTek chipset devices (e.g. Redmi Note 11 or Poco) M4 Pro) require an additional step - unlock Bootloader through SP Flash Tool before locking in Fastboot. Qualcomm doesn't need this move.
Step-by-step: lock the bootloader through Fastboot
The process consists of three steps: logging into Fastboot mode, checking the bootloader status, and directly locking.
- π₯οΈ Computer with Windows/Linux/macOS.
- π Cable USB (preferably original).
- π± Device with unlocked loader.
- π Mi Account Account Linked to Phone.
If everything is ready, follow the instructions:
- Turn off your phone. Press the Power Button + Volume down for 10 seconds to enter the Fastboot. The screen will show a picture of a hare in a hat-eared.
- Connect the device to a PC. Open the terminal (or Command Prompt in Windows) and execute the command to check the connection: fastboot devices If the device is determined (its serial number appears), move on. If not, install Xiaomi USB Drivers.
- Check the current status of the bootloader: fastboot oem device-info In the conclusion, find the line Device unlocked: true. If false, the bootloader is already locked.
- Sign in to Mi Account via Fastboot (if you havenβt done it before): fastboot oem unlock-go The phone will receive a confirmation request β agree.
- Lock the bootloader with the command: fastboot oem lock Attention! After this command, the device will automatically restart and erase all data.
If the process is successful, after the restart, you will see a standard MIUI setting screen. If the device does not turn on or hangs on the logo, go to the "Error Solving" section.
π‘
If the fastboot oem lock command gives an error FAILED (remote: 'Not allowed in Lock State'), then the device has Anti-Rollback protection on. Solution: run the official firmware through the Mi Flash Tool with the clean all and lock option
Features for devices on MediaTek
Xiaomi smartphones with MediaTek processors (e.g. Redmi 10C, Poco C40) are blocked differently. Here, the SP Flash Tool utility is used instead of Fastboot.
- Download the SP Flash Tool and the official firmware for your model in.zip format.
- Unpack the firmware and find the scatter.txt file.
- Launch the SP Flash Tool, download scatter.txt, and select Firmware Upgrade mode.
- Connect the device turned off to the PC (no buttons!) and start the firmware with automatic boot lock.
The main difference from Qualcomm is that the lock is done simultaneously with the firmware, not with a separate command.
- β‘ Use only official firmware from the site MIUI Downloads.
- β‘ Do not interrupt the process β this will damage the preloader partition.
- β‘ After the firmware, reset via Recovery (Wipe Data).
What to do if SP Flash Tool does not see the device?
Common mistakes and their solutions
Even with the correct following of the instructions, there may be failures. Let's consider the typical problems and ways to fix them:
| Mistake. | Reason. | Decision |
|---|---|---|
| FAILED (remote: 'Flashing is not allowed in Lock State') | The bootloader is already locked, but the firmware is unofficial. | Swipe the official firmware through the Mi Flash Tool with the clean all option. |
| FAILED (remote: 'Device is locked. Cannot flash images') | Try to flash custom recovery (e.g. TWRP) on a locked bootloader. | Unlock the bootloader through the Mi Unlock Tool, then repeat the firmware. |
| The device hung on the MI logo after being locked. | The boot or system section is damaged. | Swipe the full firmware through Fastboot with the option --lock. |
| Waiting for device in the terminal. | Drivers are not installed or the cable is faulty. | Reinstall drivers, try another cable/port. |
If the device stops turning on (the "brick"), don't panic. In 90% of cases, it can be restored:
- For Qualcomm, use the Mi Flash Tool in EDL mode. You will need an authorized Xiaomi account.
- For MediaTek: Sweat through the SP Flash Tool with Format All + Download tick.
β οΈ Note: If after blocking the bootloader, the device requires the entry of a password from Mi Account, but you do not remember it, you can restore access only through the official Xiaomi service. IMEI.
π‘
If the bootloader is locked, DO NOT try to flash it through informal tools (e.g. OrangeFox or PitchBlack Recovery).This will make the problem worse. Use only official Xiaomi utilities.
How to check if the bootloader is successfully blocked
After the procedure is completed, you need to make sure that the lock is correct, and this can be done in two ways:
- Fastboot: fastboot oem device-info The output should be Device unlocked: false.
- Through MIUI settings: Go to Settings β About Phone. Tap the MIUI version several times until the message "You're a developer!" appears. Return to Settings β Additional β Developer. Find bootloader Status - it should be "Blocked".
If both methods show that the bootloader is locked but the device is not stable (e.g., spontaneously restarts), do:
- π Reset to factory settings via Recovery (Wipe Data).
- π Reflashing the official version MIUI unlockless.
Some models (such as Xiaomi 12T or Redmi K50) may be blocked after a warning about the discrepancy of the Anti-Rollback versions.
- Download the latest stable firmware for your model.
- Fastboot with the command: fastboot flash all [name file].zip
Frequent questions and myths about the bootloader lock
There are a lot of rumors surrounding the lockdown procedure.