Closing the bootloader on Xiaomi without data loss: the complete guide

The bootloader on Xiaomi smartphones is a special mechanism that controls the process of launching the operating system. It is blocked by the manufacturer by default, but many users will unlock it to install custom firmware, obtain superuser rights or test new features. However, after experiments, it is often necessary to return everything as it was - close the bootloader to avoid problems with security, warranty or banking applications.

The main difficulty is that the standard process of locking a bootloader through the Mi Unlock Tool involves a complete device reset (fastboot oem lock), which means losing all data, including photos, contacts and installed applications. But there are workarounds that allow you to close the bootloader without formatting, which will be discussed in this article.

Important: the procedure requires technical training. If you have never worked with an ADB or Fastboot, it is better to consult a specialist or use backup. Some methods can lead to a "brick" (inoperability) of the device if performed incorrectly.

Why users want to close the bootloader on Xiaomi

The unlocked bootloader gives you a lot of freedom, but it also has some serious drawbacks, and here are the main reasons why Xiaomi owners decide to close it:

  • πŸ”’ Data security: Open bootloader makes it easier for attackers to access system partitions, especially if a device is stolen or lost.
  • πŸ’³ Banking applications: Many financial services (e.g. Sberbank Online or Tinkoff) block access on devices with unlocked bootloaders.
  • πŸ“± Updates by air (OTA). Some firmware stops receiving updates if the bootloader is unlocked.
  • πŸ”„ Warranty repair: Xiaomi service centers may refuse warranty if they find an unlocked bootloader.
  • 🐞 Stability: Castom firmware or modifications sometimes cause failures, and returning to a runoff state helps to eliminate them.

And not all users are willing to sacrifice data to shut down the bootloader, especially for those who store important information on their phones without backups, and then we'll look at how to minimize the risks and save files.

πŸ“Š Why did you unlock the bootloader on Xiaomi?
Install custom firmware
Get root rights
Testing new functions
Correct stockware errors
Other

Preparation of the device before closing the loader

Before you start the procedure, you need to follow a few critical steps, neglecting them can lead to data loss or failure of the smartphone.

First, you have to back up all the data, and even if the method promises to keep the files safe, there's always a risk of failure.

  • πŸ“ Local backup through Settings β†’ System system β†’ Backup (saves applications, settings, but not always media files).
  • ☁️ Cloud services: Mi Cloud, Google Drive or Yandex Disk for photos, contacts and documents.
  • πŸ’» Manual copying on PC through MTP (Connect your phone like a flash drive and copy folders DCIM, Downloads, WhatsApp and others.).

Second, check the battery status, make sure it's at least 60 percent charge, and you better connect the device to charge during the procedure. PIN-Code and pattern lock – they can interfere with the work of Fastboot.

β˜‘οΈ Preparation for the closure of the loader

Done: 0 / 5

Official method: Close the bootloader through Mi Unlock Tool

The standard way Xiaomi uses the Mi Unlock Tool, but it inevitably causes the device to reset. If you're ready, follow the instructions:

  1. Download the latest version of the Mi Unlock Tool from the official website.
  2. Sign in to your Mi-account (it should be linked to the device).
  3. Put the phone in Fastboot mode: turn it off, then press Volume down + Power.
  4. Connect your smartphone to your PC and launch the Mi Unlock Tool. The program must identify the device.
  5. Press Unlock (yes, β€œunlock” is a localization error; use the same button to lock).
  6. Confirm action. The phone will reset and reset to factory settings.

Important: this method is guaranteed to reset all data, so if you need to save information, move to alternative methods.

What if the Mi Unlock Tool can’t see the device?
Make sure you have Fastboot drivers installed (you can download it via the Mi Flash Tool). USB-You can turn off the antivirus, it can block the utility.

Alternative methods: Closing the bootloader without losing data

There are informal ways to close the bootloader by storing user data, which are based on modifications to system partitions and require root rights, and the two most reliable methods are described below.

Method 1: Use the fastboot oem lock command with pre-training

This method is suitable for devices based on Qualcomm (most Xiaomi smartphones), the essence is to temporarily disable the verification of the bootloader’s signature:

  1. Install ADB and Fastboot on PC (you can use Android SDK Platform Tools).
  2. Transfer the phone to Fastboot (Loudness down + Power).
  3. Run the command to disable the check: fastboot oem edl If the device does not support EDL, skip this step.
  4. Close the bootloader with the command: fastboot flashing lock or (for older devices): fastboot oem lock
  5. Reboot the phone: fastboot reboot

⚠️ Note: On some models (Redmi Note 8 Pro, POCO X3) This method can lead to a load cycle, in which case you will need firmware through the EDL.

Method 2: Modification of the boot section via TWRP

If your device has a custom TWRP recap, you can try the following scheme:

  1. Download stock boot.img for your model from the Xiaomi Firmware Updater website.
  2. Reboot to TWRP (Loudness Up + Power).
  3. Backup the current boot section (Backup β†’ Select boot).
  4. Sweat stock boot.img through Install β†’ Install Image β†’ Select boot.img.
  5. Reboot to Fastboot and execute: fastboot flashing lock_critical

This method does not work on all devices, but avoids a complete reset, but there is no guarantee of data safety - always keep a backup on hand.

πŸ’‘

If the bootloader is closed, try flashing the stock firmware through the Mi Flash Tool in Clean all and lock mode, which will return the device to factory status, but delete all data.

Comparison of methods: which to choose

To make it easier, we've put together a table of the pros and cons of each method, and focus on your model and risk-awareness.

MethodData retentionDifficultySuitable modelsRisks.
Mi Unlock Tool❌ No (full reset)⭐ (simple)All models.Data loss but 100% performance
fastboot oem lock⚠️ Possible (but not guaranteed)⭐⭐ (middle-of-the-road)Qualcomm chips (Redmi Note 9, POCO F3, etc.)Possible bootloop
Modification through TWRPβœ… Yes (with the right actions)⭐⭐⭐ (difficult)TWRP devices (Redmi K20, Mi 9, etc.)High risk of errors requires root
Firmware through EDL❌ No (full reset)⭐⭐⭐⭐ (difficult)All models (authorized account required)Risk of "brike" in an error

If you want to be as safe as possible, go for the official method with a full reset, and if you want to save the data and you're ready to experiment, try alternative methods, but only after you've created the backup.

πŸ’‘

On devices with a Mediatek chip (e.g. Redmi 9A), it is almost impossible to close the bootloader without data loss due to the peculiarities of the architecture.

Frequent mistakes and their solutions

When you close the bootloader, users often face problems, and let's look at the most common ones and how to fix them.

  • πŸ”Œ "Device not found" in Fastboot. Check drivers, try another one USB-port or cable. disable driver signatures in Windows (via gpedit.msc).
  • πŸ”„ The phone is stuck on the Mi logo. This is bootloop -- cyclical reboot. Solution: flash the stock firmware through the Mi Flash Tool in Clean all mode.
  • πŸ”’ "This device is locked when you try to close. This means that the bootloader is already locked. Check the status of the command: fastboot oem device-info (see Device unlocked: false).
  • πŸ“± The sensor doesn't work when it's closed. It's a rare bug on some models (POCO X2). Solution: Sweeten stock vendor.img.

⚠️ Warning: If the bootloader stops turning on after closing, don't try to re-unlock it right away.First try booting into Fastboot and perform:

fastboot continue

If this doesn’t work, you’ll need firmware via EDL (requires an authorized Xiaomi account).

What to do after successful closure of the loader

If the procedure is successful, follow a few steps to check the device’s health:

  1. Make sure that the phone is loaded into the system without errors.
  2. Check the status of the bootloader by the command: fastboot oem device-info (must be Device unlocked: false).
  3. Update the firmware to the latest version through Settings β†’ System Update.
  4. Install banking applications and check their work (for example, Sberbank Online should stop swearing at an unlocked bootloader).
  5. Restore data from the backup (if you used the method without resetting).

If you closed the bootloader for warranty repair, please note: the service center can check the unlock history through fastboot oem. get_identifier. In this case, it is better to return the device to a fully drained state.

πŸ’‘

Once the bootloader is closed, some custom functions (such as Magisk or Xposed) will stop working.

FAQ: Frequent questions about closing Xiaomi bootloader

Can I close the bootloader on Xiaomi without a computer?
No, you need a PC with ADB/Fastboot installed to close the bootloader. All formal and informal methods require the device to be connected to the computer via USB.
Will Google Pay work after the bootloader closes?
Yes, Google Pay and other SafetyNet services should be working, because the unlocked bootloader is one of the reasons why the certification fails, but if you installed Magisk to mask root, it needs to be completely removed.
Can I close the bootloader on Xiaomi with Magisk installed?
Technically yes, but before closing, you need to completely remove Magisk (via Uninstall in the app or the firmware of stock boot.img).
What happens if you close the bootloader on the custom firmware?
With 99% probability, the phone will stop loading (bootloop); the bootloader will only be closed on Xiaomi’s stock firmware; if you use a custom (like LineageOS or Pixel Experience), go back to the original software first.
How to check if the loader is closed?
There are two ways: Through Fastboot: fastboot oem device-info, Search for Device unlocked: false. Through phone settings, go to Settings β†’ About Phone β†’ MIUI version and tap it several times. If the bootloader is locked, the bootloader status: locked will appear in the developer menu.