Why locking up a bootloader on Xiaomi is a risky operation
The bootloader on Xiaomi smartphones is the first layer of protection that starts when the device is turned on, it checks the integrity of the system before downloading the MIUI and blocks unauthorized changes, many users unlock it to install custom firmware or root rights, but then they face the problem of how to get everything back without losing data.
Xiaomiβs official way of doing this is to completely reset the device through the Mi Unlock Tool, but it removes all files, settings and applications. Are there workarounds? Yes β but they require accuracy and understanding. In this article, weβll discuss 3 work methods for locking the bootloader with data storage, their pros, cons and potential risks. Also, weβll find out why some models (for example, the Redmi Note 12 Pro+ or POCO F5) can behave unpredictable when such manipulations occur.
Before you get into the instructions, answer the key question: Why do you want to lock the bootloader? If the goal is to improve security or sell the phone, maybe there are alternatives. If you want to return the device to a stock state for warranty repair, read on.
Method 1: Data-saving Fastboot lock (for MIUI 14/15)
This method is suitable for most modern Xiaomi, Redmi and POCO devices based on MIUI 14 or MIUI 15. It involves the use of a modified fastboot script that blocks the bootloader without affecting the /data partition.
- π± The device does not have critical firmware errors (e.g., "bootloop").
- π§ You previously unlocked the bootloader in an official way through the Mi Unlock Tool.
- π There is enough free space on the phone (minimum 2 GB).
- π Battery charge of at least 60%.
To perform the operation, you will need:
- π» Windows computer 10/11 (Linux with fastboot support).
- π Cable USB Type-C (original or certified).
- π Archive with utilities: Mi Flash Tool 2026 and modified script.
- π Mi Account Linked to the Device.
Steps of implementation:
- Download and unpack the archive with utilities in the root of the disk C:\mi_tools\.
- Open the Command Prompt on behalf of the administrator and go to the tool folder: cd C:\mi_tools\fastboot
- Connect your phone to your PC in Fastboot mode (press Power + Volβ when the device is off).
- Check the connection command: fastboot devices If the device is determined, you will see its serial number.
- Start the lock script with data saving: fastboot flash lock_critical fastboot oem lock Don't interrupt the process! On the phone screen, a lock warning will appear - confirm it with the Vol button+.
βοΈ Preparation for loader lock
Critical nuance: on some models (for example, Xiaomi 13T or Redmi K60) after locking, access to internal storage may disappear, in which case only a complete reset through the Mi Flash Tool will help.
β οΈ Warning: If after the execution of commands the phone stopped turning on or stuck on the logo MI, Do not try to re-unlock the bootloader. Connect the device to the Mi Flash Tool and run the official firmware in Clean All mode.
Method 2: Use of Engineering Mode (for older models)
On Xiaomi devices until 2020 (e.g. Redmi Note 8 Pro, Mi 9), there is a hidden Engineering Mode that allows you to block the bootloader without losing data, a method less reliable than fastboot, but in some cases works.
Instructions:
- Open the Phone app and type in the combination: ##36446337## This will open the Engineering Mode menu (if the combination doesn't work, try ##4636##).
- Go to Hardware Testing β Bootloader Lock.
- Select the Lock Bootloader (Keep Data) option.
- Confirm the action and wait for the reboot.
Advantages of the method:
- β It does not require a PC connection.
- β Stores all data and settings.
- β It's firmware-based. MIUI 11-12.
Disadvantages:
- β Not supported on new models (2021 and later).
- β May cause errors in the operation of sensors or modules NFC.
- β On some devices, the lock is reset after the update. MIUI.
What happens if the Engineering Mode does not open?
Method 3: TWRP Blocking (power users only)
If you have a custom TWRP recavator installed on your device, you can try to lock the bootloader through it, which is suitable for models with unlocked bootloader and root rights, but requires caution: improper actions can lead to a βbrickβ (breakdown) of the device.
Step-by-step:
- Download the file. lock_bootloader.zip For your model (for example, here).
- Reboot your phone to TWRP (press Power + Vol+).
- In the TWRP menu, select Install and specify the path to the downloaded file.
- Swipe to confirm the installation.
- Once completed, restart the device.
β οΈ Note: This method may cause data loss if the file is lock_bootloader.zip It is not compatible with your version. MIUI. Before using, check the reviews about the file on the forums. 4PDA or XDA Developers.
Alternatively, use the command in TWRP Terminal:
dd if=/dev/zero of=/dev/block/bootdevice/by-name/misc
echo --lock >> /dev/block/bootdevice/by-name/miscImportant: Once blocked via TWRP, you may need to re-assign your Mi Account in your device settings.
Compatibility table with Xiaomi models
| Model of the device | Method 1 (Fastboot) | Method 2 (Engineering Mode) | Method 3 (TWRP) | Risk of data loss |
|---|---|---|---|---|
| Xiaomi 13/13 Pro | β Yes. | β No. | β οΈ Partially. | Medium. |
| Redmi Note 12 Pro+ | β Yes. | β No. | β No. | Low. |
| POCO F5 | β Yes. | β No. | β Yes. | High-pitched |
| Mi 11 Ultra | β Yes. | β Yes. | β Yes. | Medium. |
| Redmi 9A | β No. | β Yes. | β No. | Low. |
If your model is not listed in the table, check compatibility on profile forums or in the support chat of Xiaomi Russia.
What to do if the lock is unsuccessful
If after attempting to lock the loader the device:
- π Hangs on the logo. MI β Try to go to Fastboot and flash the official firmware through the Mi Flash Tool.
- π΅ Not turning on β plug in to charge for 30 minutes, then try the Power combination + Vol+ + Volβ.
- π Mi Account password requires β use the official unlock service.
- π± It works, but it doesn't see. SIM-maps β check network settings in Settings β SIM-maps and mobile networks.
If none of these methods worked, there are two options:
- Contact the Xiaomi service center with a request to reflash the device (cost) ~1500-3000 β½).
- Sell the phone as "for repair" on Avito or Yule, indicating the status of the bootloader in the description.
π‘
Before selling a phone with an unlocked bootloader, be sure to reset to factory settings via Settings β Additional β Reset.This will remove the binding to your Mi Account and protect your personal data.
Alternatives to locking the bootloader: when it is not necessary
In some cases, the bootloader lock is not required and can be replaced by other actions:
- π For security: Enable data encryption in Settings β Security β Encryption of the telephone.
- π¦ For sale: perform reset via Settings β Reset settings and untie your Mi Account.
- π§ For warranty repair: Some service centers accept devices with unlocked bootloader, unless the problem is related to firmware.
- π± For updates: if MIUI refuses to install due to unlock, try flashing the update manually through Fastboot.
Also, it is worth considering that on new models (Xiaomi 14, Redmi Note 13), blocking the bootloader can lead to the activation of the antirollback mechanism, which prohibits rollbacks on older versions of MIUI.
π‘
If your goal is simply to return the phone to a factory state, a reset through settings is often enough, and locking the bootloader is only needed for warranty repairs or if you plan to sell the device as "completely original."