Restore persist partition and unbrick Redmi 5 Plus

How to restore bricked Redmi 5 Plus and fix bootloop

In this post we are going to show you a few different methods on how to unbrick and restore Xiaomi Redmi 5 Plus (or how to restore “persist” partition). 

The second part of this article will be generally about Redmi 5 Plus bootloop issue and how to fix it.

Tutorial on how to fix bootloop and restore hardbricked Redmi 5 Plus

Please pay attention that you do everything at your own risk and you’re responsible for any possible issues with your device.

Read the following information if you own Chinese version of Redmi 5 Plus: You can not flash Global MIUI ROM with locked bootloader, in this case you’ll get a bootloop device. Here’s what you should do: install Official Chinese MIUI ROM, sync with your Mi account (fix the 10008 error with DNS or VPN) and then request the bootloader unlock permission from MIUI.

Test point method is used in the following cases:

  • Your phone is a brick. It can’t be turned on, fastboot and recovery modes are not working.
  • In case of bootloop, when your phone automatically reboots on each startup and bootloader is locked.
  • If you want to flash official ROM, but bootloader is locked.

For China Redmi 5 Plus version:

You can use the following tutorial to fix the following issues:

  • If in the “Developer options” menu you see that the bootloader is unlocked, while if you check via terminal “cmd” command it is showing “(false)” meaning the the bootloader is locked.
  • If you want to unlock the bootloader, but when you trying to sync device with Mi-account you’re getting 86006 error.

Xiaomi Redmi 5 Plus Disassembly Part

The whole process requires accuracy and patience! Please read carefully and watch videos on YouTube to have a better understanding of the disassembly process.

  1. Turn off your smartphone. In case you have bootloop issue, then press all the three buttons at the same time (both volume buttons and “Power”), hold them your device will reboots automatically for a few times and then it will turn off, release the buttons.
  2. Next we are going to take out the SIM tray.
  3. First, flip the bottom of the lid by carefully pulling it up near USB connector.
  4. Next snap off the back cover.

Watch the following video for more information:

Required Drivers and Software for Redmi 5 Plus

Here’s the list of drivers and tools you must have installed on your PC to proceed with unbricking your Xiaomi Redmi 5 device:

  1. First of all you’ll need to disable driver signature enforcement on your Windows PC.
  2. Then you’ll need to install Qualcomm drivers: QDLoader+HS-USB+Driver_32-64bit_Setup.7z
  3. Install the MiFlash tool, in case of any errors try the following version: MiFlashSetup-Beta.msi
  4. Download the official MIUI ROM for MiFlash/fastboot, you can download and flash both Stable or Developer version. Unpack downloaded ROM to “C:/” drive.
  5. Start MiFlash as administrator, click on the upper left “select” button and locate the path to unpacked firmware folder. Then select and enable “clean all” option in the bottom of the screen.

How to boot Redmi 5 Plus into EDL mode

We’ll try to give a step-by-step text guidance, but I will highly recommend you to check additional videos on how to get to the test points.

  1. Remove the battery cable and gently pull it to the side.
  2. Insert USB cable in the device, but do not connect other side to PC yet.
  3. Grab some tool and close the Test Point contacts together.
  4. While keeping the Test Points contacts together connect your device to PC via USB.
  5. If everything was done correctly Redmi 5 Plus will reboot in the so-called EDL Mode and the screen will be off (black).
  6. On your Windows PC open the “Device Manager” and check for the connected device and it’s COM or LPT port. You should see “Qualcomm HS-USB QDLoader 9008 (COMxx)” device, where “xx” is the number of the port you’re using.
  7. As soon as your device COM port is appeared in the device manager you can remove your hand from the Test Point contacts.

Flashing Redmi 5 Plus with MiFlash tool

Now you can continue with the flashing process, it wouldn’t be complicated really:

  1. Open MiFlash software.
  2. Click on the “Refresh” button.
  3. If everything was done correctly, you should see COM port appeared in the “device” column.
  4. Press “Flash” to start flashing process. You should see the progress bar appeared.
  5. If the flashing was completed successfully you’ll see a green “Success” message.
  6. Now we can check and test the smartphone. Remove the USB cable and connect the battery cable back.
  7. Turn on your device.
  8. Carefully put the back cover neatly to its place.
  9. Insert SIM tray back as well.
  10. That’s it!

Restore persist partition and unbrick Redmi 5 Plus

This method will only work only if your device automatically reboots on Mi logo and you can’t use Test Points method for some reasons. This could happen because of the corrupted (deleted or formatted) persist partition file. To restore it you’ll need to edit two files from the unpacked Fastboot ROM: partition.xml and rawprogram0.xml. We will recommend you to download Notepad++ to edit the files above.

Pay attention:

  • If the bootloader is locked, you can only use the China Stable fastboot ROM
  • If the bootloader is unlocked, you can use both Global or China Stable fastboot ROM.
  1. Unpack downloaded ROM and find these files, locate “images” folder and find these two files: partition.xml and rawprogram0.xml
  2. Open “partition.xml” find the following line:
    <partition label="persist" size_in_kb="32768" type="6C95E238-E343-4BA8-B489-
    8681ED22AD0B" bootable="false" readonly="false" 
    filename="persist.img" sparse="true"/>

    and change readonly=”false” to “true”, in the result you’ll get

    <partition label="persist" size_in_kb="32768" type="6C95E238-E343-4BA8-B489-
    8681ED22AD0B" bootable="false" readonly="true" 
    filename="persist.img" sparse="true"/>
  3. Open “rawprogram0.xml” and make the following changes:
    <program SECTOR_SIZE_IN_BYTES="512" file_sector_offset="0" filename="" 
    label="persist" num_partition_sectors="65536" physical_partition_number="0" 
    size_in_KB="32768.0" sparse="true" start_byte_hex="0xf4000000" 
    start_sector="7995392"/>

    to

    <program SECTOR_SIZE_IN_BYTES="512" file_sector_offset="0" filename="persist.img" 
    label="persist" num_partition_sectors="65536" physical_partition_number="0" 
    size_in_KB="32768.0" sparse="true" start_byte_hex="0xf4000000" 
    start_sector="7995392"/>
  4. Save changes.
  5. Now you can use the flashing process which is described above.
  6. You may also use the MiFlashPro tool for flashing, which can be downloaded here.

How to fix bootloop Redmi 5 Plus smartphone

Here’s the very simple solution on how to fix the bootloop issue when your phone automatically reboots without starting into the system.

  1. Use all three available buttons to turn off your device completely. Press and hold “Volume Up” + “Down” and “Power” buttons and wait until your device reboots and then turned off.
  2. Connect the test points and insert USB cable, you device should appear in device manager as “Qualcomm HS – USB QDLoader 9008” (please check the tutorial above on how to use Test Points and boot Redmi 5 Plus into Download mode).
  3. Start MiFlash tool, locate the path to previously downloaded ROM and press “Refresh”. For China version use only China Stable or Developer Fastboot ROM, flashing Global ROM will lead to bootloop once again.
  4. Your device should be identified as listed with its COM3 port, enable “clean all” and press “Flash” button to start flashing.
  5. Wait until flashing process is completed.
  6. Press “Power” button to start your phone. If the phone doesn’t start use the both volume and “Power” buttons at the same time and wait for 20 seconds. Your phone should start using this method.

If your phone is identified as “Unknown device” in “Device Manager” and constantly disconnects, that means that it just needs to be turned on. Disconnect USB cable from PC, press and hold all three buttons on your device and wait 20 seconds until it turns on.