Blocking the bootloader on Xiaomi: official instructions with explanations

The bootloader on Xiaomi smartphones is a software component that runs in front of the operating system and determines which software will be downloaded. By default, it is blocked by the manufacturer on all Mi, Redmi and POCO devices. However, after unlocking (for example, to install custom firmware), many users face the need to return the original state, which may be required for warranty repairs, security enhancements or error correction after unsuccessful firmware experiments.

In this article, we will discuss the official way to lock the bootloader through the Mi Unlock Tool, alternative methods for older models, as well as nuances that will help avoid a β€œbrick” (turning the phone into a β€œbrick”). All instructions are relevant for devices on MIUI 14/15 and new versions, including Xiaomi 14, Redmi Note 13 and POCO F6. If you previously unlocked the bootloader to install TWRP or LineageOS, follow the recommendations carefully – the process is irreversible without a complete data reset.

Why you may need to lock the loader

The main reasons for returning a blocked state are:

  • πŸ”§ Warranty repairs: Xiaomi service centers refuse free service if bootloader unlocked.
  • πŸ›‘οΈ Security: Unlocked bootloader allows uncertified software to run, which increases the risk of hacking.
  • πŸ”„ Some custom builds are unstable, and you can't get back the stock firmware without locking the bootloader.
  • πŸ“± Phone sales.Buyers often check bootloader status through fastboot oem device-info.

It is important to understand that locking the bootloader will result in a complete data reset (including internal memory), which is due to the Anti-Rollback protection mechanism, which prevents rollbacks to older firmware versions, and if the device has custom firmware installed, you must return the stock version of MIUI before blocking.

⚠️ Note: On devices with a MediaTek chipset (e.g., Redmi) 12C or POCO M6 Pro) the lock process is different from the models on Qualcomm Snapdragon, requiring a special file auth from Xiaomi, which is issued only to authorized service centers.

Preparing the phone for the loader lock

Before starting the procedure, follow the following steps:

Backup your data (photos, contacts, messages)| Make sure battery power > 60%| Install the latest version of the MIUI stock firmware | Disable Mi Account protection (if your phone is not tied to your account) | Download Mi Unlock Tool from the official Xiaomi website

-->

If you have custom firmware installed on your phone (such as Pixel Experience or ArrowOS), you need to replace it with stockware.

  1. Download the official firmware for your model from the MIUI Downloads website (choose the Fastboot version).
  2. Unpack the archive in a folder without Cyrillic characters (for example, C:\MIUI\fastboot_rom).
  3. Connect your phone to your PC in fastboot mode (clip Volume Down + Power when the device is off).
  4. Launch the file. flash_all.bat (for Windows or flash_all.sh (for Linux/Mac).

Once you've done the firmware, the phone will automatically restart. Don't configure it, go straight to locking the bootloader. If you see an Anti-Rollback error on the screen, you're trying to install a version of MIUI that's too old. In this case, download a newer firmware.

πŸ“Š Have you ever unlocked a bootloader on Xiaomi?
Yeah, for custom firmware installation.
Yeah, for root rights.
No, but I'm planning.
No, and no planning.

The official method: lock through Mi Unlock Tool

This is the only Xiaomi-supported method that works on most models released after 2018.

  • πŸ’» Windows computer 10/11 (64-bit).
  • πŸ“± Phone with unlocked bootloader and stock firmware.
  • πŸ”Œ Cable USB (preferably original).
  • πŸ”‘ Mi Account Linked to Phone (if Linked to).

Step-by-step:

  1. Install Mi Unlock Tool. Download the utility from the official website and unpack the archive. Launch the file. miflash_unlock.exe on behalf of the administrator.
  2. Sign in to Mi Account, which is linked to your phone. If your account is not tied, skip this step.
  3. Connect the phone in fastboot mode. To do this, turn off the device, then press Volume Down + Power before the Fastboot logo appears.

It takes 2-5 minutes. When you're done, the phone will restart, and you'll see the screen of the initial setup. If instead the device is stuck on the MI logo, then the firmware is not compatible with the current version of the bootloader, in which case, repeat the procedure with another version of MIUI.

πŸ’‘

If the Mi Unlock Tool gives you a "Couldn't unlock" error, try connecting the phone to another one. USB-port (preferably) USB 2.0) or disable the antivirus. Also check that Device Manager displays the phone as Android Bootloader Interface.

Alternative methods for older models

On devices released before 2018 (for example, Xiaomi Mi 5, Redmi Note 4X), the official utility may not work.

fastboot oem lock


fastboot reboot

If the command is not executed, try resetting the userdata section first:

fastboot erase userdata


fastboot oem lock




fastboot reboot

For models on MediaTek (e.g. Redmi 5A) you will need:

  1. Download SP Flash Tool and stock firmware in.scatter format.
  2. In the SP Flash Tool settings, select the Download Only option and tick only the preloader section.
  3. Connect the phone to the PC (without the battery if it is removable).
  4. Press Download and wait for the process to be completed.

⚠️ Note: On devices with MediaTek Helio (e.g. Redmi) 9A) Incorrect locking of the loader can lead to loss IMEI. Before the procedure, save it through the engineering menu (#4636## β†’ Phone information).

Checking the status of the loader after blocking

To make sure that the bootloader is successfully locked, run the following commands in the terminal (the phone must be in fastboot mode):

fastboot oem device-info


fastboot getvar unlocked

If you answer the first command, you will see:

(bootloader) Device unlocked: false

And the second one:

unlocked: no

So the procedure was successful, and you can also check the status through the Mi Flash Tool app.

Team team.Response with a blocked loaderResponse when unlocked loader
fastboot oem device-infoDevice unlocked: falseDevice unlocked: true
fastboot getvar unlockedunlocked: nounlocked: yes
fastboot getvar antiDisplays the Anti-Rollback versionSame answer, but status doesn't affect

If the phone doesn’t turn on or freezes on the logo after locking, try re-swiping the stock firmware through the Mi Flash Tool in Clean All mode. This will delete all data, but restore the working capacity.

Frequent mistakes and their solutions

When you lock the bootloader, you're going to have a problem, and you're going to see the most common ones.

  • 🚫 "Couldn't lock device" error. Cause: incompatible version of Mi Unlock Tool or firmware. Solution: download the latest version of the utility and try again.
  • πŸ”Œ Phone is not defined in fastboot. ADB/Fastboot. Solution: Install Mi PC Suite or drivers manually through Device Manager.
  • ⚑ The phone turns off during the process. Cause: battery is dead or the cable is broken. Solution: charge the phone to 100% and use the original cable.
  • πŸ”’ Once locked, the phone requires a password from Mi Account, and the reason is that the account was tied before unlocking. Solution: enter the account details or wait 72 hours for automatic unlock (if the device is new).

If none of these methods worked, contact Xiaomi Service Center and tell them that you need a relock bootloader, which is a standard procedure that takes 1-2 days.

What to do if your phone turns into a brick?
If the bootloader is locked, try 1. Press Volume Up + Power for 20-30 seconds for forced reboot. 2. Connect to charging for 1-2 hours - sometimes helps with a discharged battery. 3. Swipe stock firmware through Mi Flash Tool in EDL mode (requires an authorized Xiaomi account). If nothing helps, contact the service center with a check for purchase.

Security after blocking the loader

After successful blocking, it is recommended to:

  • πŸ” Enable Mi Account protection. Go to Settings β†’ Xiaomi account β†’ Security and activate the Find the Device option.
  • πŸ”„ Update the firmware. Go to Settings. β†’ The phone. β†’ Update the system and install the latest version MIUI.
  • πŸ›‘οΈ Install antivirus. Unlocked bootloader could allow malware to enter the system.

If you plan to sell the phone, complete a full reset via Settings β†’ Additional β†’ Restore and Reset β†’ Reset. This will delete all data, including accounts and apps.

πŸ’‘

Locking the bootloader isn’t just a β€œbackward” unlocking procedure; it requires a stock firmware compatible with the current version of Anti-Rollback, otherwise the phone may stop turning on.

FAQ: Answers to Frequent Questions

Can I block the bootloader without losing data?
No. Locking the bootloader always results in a complete data reset (userdata).This is a Xiaomi security requirement to prevent access to personal information after a change in bootloader status.Be sure to back up via Mi Cloud or locally on your PC before the procedure.
What is Anti-Rollback and why does it interfere with blocking?
Anti-Rollback (ARB) is a security mechanism that prevents rollbacks on older firmware versions. If you try to lock a bootloader on a firmware with a lower version of ARB than the one installed earlier, the phone will lock permanently ("hard brick"). To avoid this, always use the latest official firmware for your model.
Can I unlock the bootloader after blocking?
Yes, but you will have to repeat the entire unlock procedure from scratch: tie Mi Account, wait 7-15 days (for new accounts), use Mi Unlock Tool. The number of unlocks / locks is unlimited, but frequent changes in the status of the bootloader can lead to the blocking of Xiaomi account on suspicion of fraud.
Why can't Mi Unlock Tool see my phone?
The problem is usually with drivers or connection mode. Check: The phone must be in fastboot mode (Mi Bunny logo labeled Fastboot). Device Manager should display the Android Bootloader Interface device. USB-The cable must support data transfer (charging cables often don't fit), the Windows antivirus or firewall can block the Mi Unlock Tool. USB-port (preferably) USB 2.0) or use another PC.
How to lock the bootloader on POCO F5 with HyperOS?
The procedure is no different from MIUI, but note: HyperOS may require a newer version of the Mi Unlock Tool (check on the official website). If the phone was updated by air (OTA), return to the stock firmware via the Mi Flash Tool before locking. POCO with HyperOS may need to disable the OEM Unlocking option in the developer settings before locking.