How to block the bootloader Xiaomi Mi 8: the full guide

Xiaomi smartphone owners often face the need to obtain superuser rights or install custom firmware, which requires unlocking the bootloader. However, after the software modification, users may lose access to banking applications, Google Pay services (now Google Wallet) and proprietary MIUI security features. The process of returning the device to its original state, known as relock, is a critical step for those who want to sell the gadget or simply protect their personal data.

Locking the bootloader on the Xiaomi Mi 8 is a procedure no less responsible than opening it, and requires strict adherence to the sequence of actions. Unlike unlocking, which is only possible through the official Mi Unlock service with reference to the account, the closing process can be performed both by standard system means and through the Fastboot mode using the computer. Incorrect execution of steps can lead to software locking the device, known as a “brick”, so it is important to carefully study the theoretical part before starting practical actions.

In this guide, we will discuss in detail all available methods of closing the bootloader, the necessary tools and precautions. You will learn how to check the current status of the bootloader, what risks exist when changing the firmware region and why it is important to use a stock image of the system. Proper preparation will avoid common errors and return your Mi 8 factory integrity of the software.

Checking the current status of the loader

Before you start any manipulation, you need to make sure that your device is in the current state. The bootloader may be in the status of "Unlocked" (unlocked) or "Locked" (locked). If you have not previously performed any operations to obtain root rights or install TWRP, most likely your bootloader is already closed and you do not need to lock again.

The fastest way to find out the status is to go to the About Phone menu and click on the build number several times to activate the developer menu. Then the "Developers" section will display "Mi Unlock Status." However, more accurate information is provided by the Fastboot mode. To log in, you need to turn off the smartphone completely, and then press the Volume Down and Power buttons simultaneously until the Fastboot logo with the image of a rabbit repairing an android appears.

⚠️ Note: If you see a sign in the corner of the Fastboot screen"UNLOCKED" It's orange, it means the bootloader is unlocked, but if it doesn't have one, it's written"LOCKED", device protected.

Using Fastboot mode gives the most reliable information, as it displays the real state of the boot sector, ignoring possible software bugs of the MIUI interface. The screen will also show the Android version and device model, which is useful for confirming that you are working with the Xiaomi Mi 8 (codename dipper).

📊 What is the status of your bootloader now?
Locked (Blocked)
Unlocked (Unlocked)
I don't know/I haven't checked.
Trying to unlock.

Preparation of the device and necessary tools

Successful bootloader locking depends on the quality of preparation. The main requirement is that you have an original or certified stock firmware that matches the current version of Android on your device. Trying to lock the bootloader on a custom build (for example, LineageOS or Pixel Experience) without first reflashing the (official) version of MIUI will lead to an endless reboot or signature verification error.

To work, you will need a computer with Windows, macOS or Linux operating system, as well as a serviceable one. USB-It is advisable to use the original cable that came with the Mi 8, as cheap analogues may not provide a stable connection when transferring data in Fastboot mode. ADB They can be downloaded separately or installed with Google's platform tools.

☑️ Checklist of preparation for blocking

Done: 0 / 5

A major step is to create a full backup. The locking process is often accompanied by a full reset of user data (Wipe Data), so all important contacts, photos and documents should be saved to the Mi Cloud service, Google Drive or your computer. Also, make sure that the device has disabled two-factor authorization in your Mi Account if you plan to reflash, although this is not always required for the lock itself, but will facilitate the afterward login.

Method 1: Blocking through the developer menu (without PC)

The easiest and safest way to get the bootloader back to its original state is available right in the smartphone interface, if it has official MIUI firmware installed. This method does not require a connection to the computer and using the command line. However, it only works if the current firmware is stock and has not been modified. If you have installed a custom recovery, this menu item may not be available or will not work.

To start, go to the smartphone settings and open About. Click on MIUI Version several times until the notification "You're a developer" appears. Then go back to the main settings menu, select "Advanced" and go to "Developers" and find "Mi Unlock Status" or "Device Status." If the bootloader is unlocked, there will be a "Block" or "Lock" button.

Once you press the button, the system will alert you that all data will be deleted. Confirm the action and the smartphone will automatically restart. During the reboot, the userdata partition will be cleared and the boot sector will be re-locked. This process can take several minutes. Do not interrupt the smartphone or press the buttons during system operations.

💡

If the lock point in the settings menu is inactive (gray), it means that the system has detected a firmware mismatch or root rights.

It is worth noting that this method requires a connection to the Wi-Fi network or mobile Internet to verify the status of the Mi Account on the company's servers. If the servers are not available or the account cannot be verified, the lock procedure will not begin. SIM-card to which the Mi Account is registered, although in the latest versions MIUI This requirement is sometimes mitigated when you have a stable Internet connection.

Method 2: Locking through Fastboot and computer

If the standard method through the settings does not work or you want to guarantee to close the bootloader after installing a clean firmware, Fastboot mode is used. This method requires a computer and a downloaded firmware image in Fastboot format (extension.tgz, not.zip). The archive must be unpacked into the root folder of the C disk or any other short-path folder to avoid errors when entering commands.

Transfer the Xiaomi Mi 8 smartphone to Fastboot mode by pressing the Volume Down and Power buttons. Connect the device to your computer via USB-Open the command line (CMD) Or PowerShell in a folder with the firmware unpacked. First, check the connection by entering the command fastboot devices. If you see the serial number of the device in response, the drivers are installed correctly and the connection is established.

fastboot oem lock

Enter the fastboot oem lock command to lock the bootloader. The system will give a warning that all data will be destroyed. Some versions of the firmware require you to press the volume button on the smartphone itself, others require the command to be executed immediately. Once the command is successfully executed, the device will restart. If you want to clear the data first and then lock, you can use the fastboot erase userdata command, but the lock command usually does this automatically.

⚠️ Attention: The fastboot oem lock command only works on stock firmware. If you try to lock the bootloader on a modified bootloader or custom Recovery, the device will go into a restart cycle (bootloop).

In case a simple command does not work, sometimes you need to use full flashing through the script. flash_all_lock.bat (It's a script that cleans the phone completely, installs a fresh copy of the system, and locks the bootloader automatically. It's the most reliable way to get the device back to a store-like state".

Compatibility table for firmware and regions

One of the most common causes of bootloader lock problems is a mismatch between the firmware and account region or previous settings. Xiaomi is strictly monitoring regional restrictions. For example, you can't just switch from Global to Chinese without unlocking, but when blocking it is important that the firmware is official for your region.

Below is a table to help you determine the type of firmware by its name.Make sure you use the correct version before starting the locking process to avoid software conflicts.

Type of firmwareDesignation in the titleDistribution regionFeatures of blocking
Global StableMIUI Global / MIInternational (Europe, Asia, Russian Federation)Recommended for most users
China StableMIUI CN / MI ChinaChinaIt may not be Google Play by default.
EEA (Europe)MIUI EEAEuropean UnionStrict privacy standards, analogue of Global
Recovery ROMExtension.zipAnybody.Not suitable for the Fastboot method without conversion

Using firmware from another region can result in the phone not being able to pass system integrity checks once the bootloader is locked, at best you will receive an error message, at worst you will have to reflash the device through Emergency Download (EDL) mode, which requires an authorized Mi Account and a paid service.

What is EDL mode?
Emergency Download (EDL) is Qualcomm’s deep recovery mode used to recover “brick” devices, and logging in on a locked bootloader often requires disassembling the phone and closing contacts on the board or paying for the services of a Xiaomi authorized center.

Possible mistakes and ways to solve them

Users may encounter various errors during the bootloader lock process, one of the most common being the Status check failed or the Couldn't verify update, which means that the signature of the current firmware does not match the expected signature for the locked state, most often when the user has tried to install a custom recap (TWRP) or modified the boot system partition.

To solve this problem, you need to perform a complete cleaning of the device and flashing. Use the command fastboot flash boot.img (where boot.img is taken from stock firmware), and then lock. If the error persists, the only way out is to use the utility Mi Flash Tool in the "Clean all and lock" mode. This mode is guaranteed to erase all partitions and close the bootloader.

⚠️ Note: When using the Clear All and Lock mode in the Mi Flash Tool, make sure the correct port is selected. COM-A port selection error can cause another device to firmware if it is connected to the same PC.

Another problem is getting stuck on the Mi logo after locking. If the phone is hanging on the logo for more than 10-15 minutes, try a forced reboot (clamp Power for 15 seconds). If that doesn't help, it may damage the userdata partition, which requires re-entering the Fastboot and executing the fastboot -w (wipe) command, which will forcefully clear user data.

💡

The main reason for blocking errors is to try to close the bootloader on a modified system. Always return to clean stock firmware before the final step.

Consequences of blocking and restoration of guarantee

After successfully locking the bootloader, your Xiaomi Mi 8 returns to a state close to factory-made. This means that all traces of interference with the code will be eliminated. Xiaomi service centers, when accepting the device under warranty, first check the status of the bootloader. If it is blocked and there is a stock firmware, a refusal to repair due to “interference in software” is unlikely.

However, locking the bootloader does not erase previous unlocks in the internal logs of Xiaomi’s server. With deep diagnostics, engineers can see the history of the device. However, for the average user, this means restoring banking applications that use SafetyNet technology (or its newer counterpart, the Play Integrity API) to verify the security of the environment.

Also, after blocking, it will be possible to receive official “over the air” updates (OTA) on unlocked devices with a modified system partition, automatic updates are often blocked to avoid conflicts, and now your smartphone will again be able to receive current security patches and Android versions directly from the manufacturer without the need for manual installation.

Will the unlock counter reset after the lock?
No, the unlock counter (if it was kept on the server side to limit the frequency of unlocks) is not reset by locking, but for normal use, this does not matter, since the limitation only concerns the frequency of unlock requests, not blocking.
Can I re-open the bootloader after blocking?
Yes, you can unlock the bootloader again through Mi Unlock, but you will have to wait 7 days (168 hours) from the date of the account’s attachment if the previous waiting period has expired.
Will photos and contacts disappear after blocking?
Yes, the process of locking the bootloader (relock) is almost always accompanied by a complete reset of the device to the factory settings (Wipe Data). All data will be deleted without the possibility of recovery, unless you made a backup in advance.
Does the lock affect the speed of the smartphone?
The status of the bootloader (Locked/Unlocked) does not affect the speed of the processor or memory. However, on a locked bootloader, the system operates in normal optimization mode, whereas on an unlocked one, some security mechanisms may work differently, which theoretically may have a slight effect on performance in benchmarks, but not in everyday use.
What if the phone says "Device is locked" when it's turned on?
This is normal for a locked device, and it appears for a few seconds when you boot, and if the phone requires a password from a Mi Account that you don't remember, you'll need a purchase check to call for support, because it's a FRP lock.