How to block the bootloader on Xiaomi phones: tips with 4PDA

Bootloader locking on Xiaomi smartphones is the reverse of the popular unlocking required to install custom firmware or obtain superuser rights. However, there are times when the user needs to return the factory state of the device before selling, for warranty repairs or after unsuccessful firmware experiments. The 4PDA forum is actively discussing this topic, but the information is scattered on dozens of topics, and the official Xiaomi documentation often does not talk about the nuances.

Unlike unlocking, which requires waiting 7-30 days and binding a Mi Account, bootloader locking can be done in many ways, from the standard method through the Mi Unlock Tool to manual commands in fastboot mode. Not all Xiaomi models support backlocking, and on some devices, the procedure leads to complete data loss or even a β€œbrick” (inoperable state). 4PDA, Added risk warnings and detailed instructions for different scenarios.

Why you might need to lock the loader

At first glance, a blocked bootloader limits the user's ability to install custom restore (TWRP), flash alternative firmware or obtain root rights, but there are good reasons to return the factory state:

  • πŸ“¦ Many buyers check the status of the bootloader through service codes (for example, ##4636##), and an unlocked bootloader can reduce the cost of the device.
  • πŸ”§ Warranty repair: Xiaomi service centers often refuse free repairs if they find traces of firmware tampering.
  • πŸ›‘οΈ Security: An unlocked bootloader makes it easier to steal data when you lose your phone, as an attacker can flash custom firmware bypassing the lock screen.
  • πŸ”„ Back to stock firmware after the Custom experiment. ROM Users often encounter bugs (e.g., a broken camera or a crashed camera). NFC), And locking the loader helps to restore stability.

It is important to understand that locking the bootloader is not always possible on devices with damaged anti or keymaster partitions. For example, on Redmi Note 10 Pro (sweet) models, after improper firmware, Anti-Rollback protection can work, making blocking impossible without specialized equipment.

πŸ“Š Why do you want to block the bootloader on Xiaomi?
Preparation for sale
Warranty repairs
Return to stock firmware
Another reason.

The official method: Mi Unlock Tool

The safest method is to use Xiaomi's Mi Unlock Tool, but there are pitfalls: it's designed to unlock, not lock, and to get the bootloader back to its original state, you'll need to:

  1. Install the latest stable version of the stock firmware via the Mi Flash Tool (file with the.tgz extension).
  2. Sign in to the Mi Account tied to the device (required!).
  3. Enable USB debugging and OEM-unlocking allowed in Settings β†’ About Phone β†’ MIUI version (7 times tap to activate the developer mode).
  4. Connect your phone to your PC in fastboot mode (clamp Volume down + Power).
  5. Run the Mi Unlock Tool and follow the instructions. At the action selection stage, the system may suggest a Lock Bootloader option.

In practice, this option does not work on all devices, for example, on Poco F3 (alioth) after the firmware Global ROM, the lock option may not be available, in which case an alternative method through fastboot helps.

Download Mi Unlock Tool from Xiaomi | Install ADB/Fastboot | Check the MIUI version (should be stock) | Link Mi Account to the device | Enable debugging via USB and OEM-unlock-->

Alternative method: fastboot commands

If the Mi Unlock Tool does not offer a lock option, manual commands can be used, which requires knowledge of the device model and firmware version, since improper actions will lead to hard brick (irreparable damage).

Instructions:

  1. Download the firmware archive for your model from Xiaomi Firmware (select the Stable version, not the Developer version).
  2. Unpack images.tar.gz from the archive to the folder with fastboot utilities.
  3. Connect your phone in fastboot mode and execute commands: fastboot flash boot.img fastboot flash dtbo dtbo.img fastboot flash vbmeta vbmeta.img fastboot oem lock
  4. After the last command (fastboot oem lock) is executed, the device will automatically restart.

⚠️ Note: On some models (e.g. Redmi Note 9 Pro (joyeuse), the fastboot oem lock command may return the error FAILED (remote: 'Not allowed in Lock State' This means that the lock is only possible through the service center.

If the phone doesn’t turn on after locking or is stuck on the MI logo, try flashing the full firmware package through the Mi Flash Tool with the clean all option (delete all data!).

What if fastboot doesn’t see the device?
Make sure that Qualcomm drivers are installed HS-USB QDLoader 9008 (for Snapdragon devices) or MediaTek Preloader.If the phone is not identified, try: 1. Use another USB-cable (original). 2. Connect to the port USB 2.0 (not 3.0!). 3. Run the command prompt on behalf of the administrator. 4. In Device Manager, manually update the driver for an unknown device by specifying the folder with adb drivers.

Xiaomi models, on which the bootloader lock is impossible

Not all Xiaomi smartphones support backlocking, due to manufacturer policies and hardware restrictions, and here is a list of devices that either have a lock or require special conditions:

ModelCode nameReason for limitationPossible workarounds
Xiaomi Mi 11 UltrastarAnti-Rollback 3.0 protectionOnly through an authorized service
Redmi K40 Pro / Poco F3aliothError on the command oem lockFirmware through EDL-regime
Xiaomi Mi 10T / 10T ProapolloRequires stock EU ROMReflashing on Global ROM
Poco X3 NFCsuryaDamage to the keymaster sectionRecovery via QFil (Qualcomm)

For anti-Rollback devices (such as Mi 9 (cepheus)), blocking is possible only if the firmware version is not lower than the one installed earlier.

πŸ’‘

Before blocking the bootloader, check the current version of Anti-Rollback via the command fastboot getvar anti. If the value is higher than in the download version, the procedure can not be carried out!

Risks and possible problems

Locking the bootloader is a high risk of error, and even if you follow the instructions, the following problems may occur:

  • πŸ”΄ Hard brick: The device does not turn on, does not respond to charging, does not detect the PC. Most often it occurs due to incompatibility of firmware versions or interruption of the process.
  • πŸ”„ Bootloop: The phone is constantly rebooted on the logo MI. The cause is damaged boot or system partitions.
  • πŸ”’ Data loss: Lock resets settings and deletes files from internal memory (including photos and apps).
  • πŸ“΅ Loss of loss IMEI: On some models (for example, Redmi Note 8 Pro (begonia) after blocking the network disappears due to reset modem-partitions.

To minimize the risks, follow the following rules:

  • βœ… Use only official firmware from the Xiaomi site (not custom builds).
  • βœ… Check the compatibility of the Anti-Rollback version.
  • βœ… Do not interrupt the process (even if it is stuck on 10).+ minute).
  • βœ… Create a backup copy IMEI and NVRAM through MTK Droid Tools (for devices on MediaTek).

⚠️ If after blocking the phone stopped catching the network, do not try to restore IMEI On new models, this results in a permanent lock of the communication module. EDL.

Recovery after a failed lockdown

If the procedure failed and the phone does not turn on, there are several ways to resuscitate:

  1. EDL (Emergency Download Mode): For Qualcomm: close test points on the board or use a Deep Flash cable. For MediaTek: clamping Volume up + Volume down when connecting to a PC.

Then we will use the Mi Flash Tool (clean all and lock option).

Fastboot resuscitation

fastboot flash boot boot.img


fastboot flash recovery recovery.img




fastboot flash system system.img




fastboot reboot

If the device boots but errors occur, repeat the firmware with the save userdata option.

Service centre

fastboot

EDL

UFi Box

EasyJTAG

The 4PDA forum has themes with free author utilities for recovery (such as XiaomiTool V2), but using them requires experience.

πŸ’‘

If the phone doesn’t turn on after locking the bootloader, DO NOT try to flash custom recovery (TWRP) – this will exacerbate the problem.

Frequent questions and answers

Can I block the bootloader without losing data?
No. Locking the bootloader always results in resetting settings and deleting data from the /data partition.We recommend pre-reserving a backup via Mi Cloud, Google Account or adb backup.
Why does Mi Unlock Tool not show the lock option?
This happens for three reasons: Unofficial firmware (e.g. xiaomi.eu) is installed; Mi Account is not connected to the device or confirmed; device model does not support blocking through the utility (see table above); Try flashing stock Global ROM and repeat the procedure.
What if the network is lost after blocking?
Most likely, the modem partition is damaged or IMEI is reset. For Qualcomm devices: Sweep modem.img and fsg.img from stock firmware. Restore IMEI through the engineering menu (#36446337### for MediaTek). If the network does not appear, contact the service.
Can I block the bootloader on Xiaomi with custom Recovery?
No. Before locking, you need to return the stock recovery (recovery.img from the official firmware), otherwise the device will be stuck on the MI logo or go to fastboot.
How to check the status of the loader after blocking?
There are three ways: Turn on your phone in fastboot mode β€” if you see the word Locked on the bottom of the screen, the procedure was successful. Type in the command: fastboot oem device-info β€” Device unlocked: false will confirm the lock. Install the Bootloader Status app from Google Play.