[Guide] About repairing/fixing the persist partition

Search This thread

Kodize

Member
Nov 28, 2018
34
5
Saltillo
You are my hero, thank you! I tried the telegram solution with a command in the terminal and it didn't work, I tried reinstalling the rom by fastboot and it didn't work either, my sensor was practically dead and I recovered it by flashing your persist.img, infinite grace!
 

wsdyleon

Senior Member
Feb 2, 2012
655
52
POCO M3 Pro / Redmi Note 10 5G
Where can i find repair_persist-willow.zip ? From gingko not work.
i think you should flash the special “persist.img” from yourself original rom。
for example:your original firmware version come from Android9.0,your must flash that persist.img from the 9.0 official firmware
and this tips for you:flash this img over android platform tools
may your phone come to the normal
 

awanline

New member
Jul 13, 2014
1
0
Redmi Note 8
what do you mean global version and Chinese version? is it the rom or where you bought ? I use xiaomi.eu rom and I bought the Indonesia version...
 
Disclaimer: I am not responsible for the results of any of these operations.


Everyone knows that the persist partition is responsible for sonsors and carrier network etc. Once this partition is failed or lost, your phone will go wrong. I just faced, then solved the problem and I want to share the solution that could maybe help other persons.

This was how it happeded:
While I was flashing the phone, I erased the partition called "persist" accidently. When I was trying to flash the persist partition, the phone returned a message said that you can't flash the controlled partition. I suddenly relized something bad happened. Then I reboot the phone and find that many sensors stopped working. But the worst thing is the carrier network signals lost. I want to contact the service center at first. But I think as long as the phone is unlocked, there are tons of possibilities to fix it, unless it's hard-bricked. So I wanted to try to fix the partition.

As we know, Xiaomi phones have backup partitions for most of the important partitions. For example, vbmeta and vbmetabak partitions. The vbmetabak usually is the backup of vbmeta. This persist partition also has a backup partition called "persistbak". This backup partition can be used to repair the persist partition. There are 2 ways to fix the persist partition. Choose the method you preferred.


1. This way is for users have erased the persist partition, but haven't modified/erased the persistbak partition. If you don't want to type commands just use method 2.
Go to fastboot, flash the twrp recovery first. Then hold the POWER and VOLUME UP to force the phone boot to twrp recovery. Connect the phone to your PC and open adb command window. Type the following commands in order:

adb shell

cd /dev/block/by-name

ls -all

Check the output, find the partitions called "persist" and "persistbak". Remember the blocks corresponding to these two partitions. They should be similar to "mmcblk0p**". Once you know these correspondences, you can restore the persist partition immediately. For example, the persist partition and persistbak partition correspond to mmcblk0p$$ and mmcblk0p%% respectively (persist---->mmcblk0p$$ and persistbak---->mmcblk0p%%). Run this following command to restore your persist partition:

dd if=/dev/block/mmcblk0p%% of=/dev/block/mmcblk0p$$

Note: You need to replace "mmcblk0p$$" and "mmcblk0p%%" with the real partition block name.

Now the persist partition has been fixed/restored. Reboot your phone to system and check whether sensors and carrier network etc. all work fine.


2. This way is for users that have erased persist partition and persistbak partition or can't restore the partition using method 1. Also, this method is a universal and easy way to fix both persist partition and persistbak partition. It doesn't need to type any command but only a swipe.
I have made the persist partition repair tool for both global version and Chinese version. Both of them are in attachments. These tools make the repair process very easy. Both flashable zip files are tested on my Redmi Note 8 and they work fine.
I have also posted them to Mi Community.
Flash the repair tool in attachment. Choose the right file and flash it.
Now the persist partition and persistbak partition have been fixed/restored. Reboot your phone to system and check whether sensors and carrier network etc. all work fine.


If you think it's useful, please click the "Like" button.
what about redmi note 5 vince?
 
Find the persist.img form your fastboot ROM. Then replace the persist.img in the zip file.
I'm in another huge problem trying to fix that one. I flashed the official firmware on my redmi note 5 (Vince), then It restarts automatically(It's like when u hold the power button for too long). I tried removing the power and volume strip to check if the problem was because of the buttons, still have the same issue. please help
 

Attachments

  • Vid 20210622 145607000022687000104673-1.mp4
    2.9 MB · Views: 0

wsdyleon

Senior Member
Feb 2, 2012
655
52
POCO M3 Pro / Redmi Note 10 5G
I'm in another huge problem trying to fix that one. I flashed the official firmware on my redmi note 5 (Vince), then It restarts automatically(It's like when u hold the power button for too long). I tried removing the power and volume strip to check if the problem was because of the buttons, still have the same issue. please help
cannot access fastboot mode? my proposal is that first shut off or reset to fastboot mode
 

Shubham R. Dukhande

New member
Jun 22, 2021
4
2
Disclaimer: I am not responsible for the results of any of these operations.


Everyone knows that the persist partition is responsible for sonsors and carrier network etc. Once this partition is failed or lost, your phone will go wrong. I just faced, then solved the problem and I want to share the solution that could maybe help other persons.

This was how it happeded:
While I was flashing the phone, I erased the partition called "persist" accidently. When I was trying to flash the persist partition, the phone returned a message said that you can't flash the controlled partition. I suddenly relized something bad happened. Then I reboot the phone and find that many sensors stopped working. But the worst thing is the carrier network signals lost. I want to contact the service center at first. But I think as long as the phone is unlocked, there are tons of possibilities to fix it, unless it's hard-bricked. So I wanted to try to fix the partition.

As we know, Xiaomi phones have backup partitions for most of the important partitions. For example, vbmeta and vbmetabak partitions. The vbmetabak usually is the backup of vbmeta. This persist partition also has a backup partition called "persistbak". This backup partition can be used to repair the persist partition. There are 2 ways to fix the persist partition. Choose the method you preferred.


1. This way is for users have erased the persist partition, but haven't modified/erased the persistbak partition. If you don't want to type commands just use method 2.
Go to fastboot, flash the twrp recovery first. Then hold the POWER and VOLUME UP to force the phone boot to twrp recovery. Connect the phone to your PC and open adb command window. Type the following commands in order:

adb shell

cd /dev/block/by-name

ls -all

Check the output, find the partitions called "persist" and "persistbak". Remember the blocks corresponding to these two partitions. They should be similar to "mmcblk0p**". Once you know these correspondences, you can restore the persist partition immediately. For example, the persist partition and persistbak partition correspond to mmcblk0p$$ and mmcblk0p%% respectively (persist---->mmcblk0p$$ and persistbak---->mmcblk0p%%). Run this following command to restore your persist partition:

dd if=/dev/block/mmcblk0p%% of=/dev/block/mmcblk0p$$

Note: You need to replace "mmcblk0p$$" and "mmcblk0p%%" with the real partition block name.

Now the persist partition has been fixed/restored. Reboot your phone to system and check whether sensors and carrier network etc. all work fine.


2. This way is for users that have erased persist partition and persistbak partition or can't restore the partition using method 1. Also, this method is a universal and easy way to fix both persist partition and persistbak partition. It doesn't need to type any command but only a swipe.
I have made the persist partition repair tool for both global version and Chinese version. Both of them are in attachments. These tools make the repair process very easy. Both flashable zip files are tested on my Redmi Note 8 and they work fine.
I have also posted them to Mi Community.
Flash the repair tool in attachment. Choose the right file and flash it.
Now the persist partition and persistbak partition have been fixed/restored. Reboot your phone to system and check whether sensors and carrier network etc. all work fine.


If you think it's useful, please click the "Like" button.
Hi Yuki,

Greetings from India, hope you and your family are doing well.

I own a Redmi K20 (davinci). I had installed Pixel Experience rom, which I didn't like and wanted to roll back to stock rom. But without reading the guide to flash fastboot rom, I flashed the back up I had taken via TWRP. Apparently, my phone was bricked and I had to enter edl mode via cmd and flash the stock rom which showed some error, but the phone booted to stock rom. Everything is working fine, even the touch-fingerprint sensor is working. All the other sensors aren't. I tried a lot of things, but to no avail. I took my device to the official service centre, they couldn't fix the sensors' issue.

A couple of days ago, I stumbled upon your post on Redmi 8-sensors-not-issue solution. Can I use the same tool to fix the persist partition on my phone? I had read one of your replies saying: specific phone's persist.img should be extracted from the fastboot rom and replaced with one in your tool.

It would be a great help if you could guide me.

Many thanks
 

wsdyleon

Senior Member
Feb 2, 2012
655
52
POCO M3 Pro / Redmi Note 10 5G
Hi Yuki,

Greetings from India, hope you and your family are doing well.

I own a Redmi K20 (davinci). I had installed Pixel Experience rom, which I didn't like and wanted to roll back to stock rom. But without reading the guide to flash fastboot rom, I flashed the back up I had taken via TWRP. Apparently, my phone was bricked and I had to enter edl mode via cmd and flash the stock rom which showed some error, but the phone booted to stock rom. Everything is working fine, even the touch-fingerprint sensor is working. All the other sensors aren't. I tried a lot of things, but to no avail. I took my device to the official service centre, they couldn't fix the sensors' issue.

A couple of days ago, I stumbled upon your post on Redmi 8-sensors-not-issue solution. Can I use the same tool to fix the persist partition on my phone? I had read one of your replies saying: specific phone's persist.img should be extracted from the fastboot rom and replaced with one in your tool.

It would be a great help if you could guide me.

Many thanks
my experience for you:i succedd in flashing the persist.img into my note8,but sensor still worked abnormally,at last i flash persist.img from the oldest ver fastboot rom when i bought ,it worked
 
  • Like
Reactions: Shubham R. Dukhande

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Hi Yuki1001

    Great guide / fix!

    Could you please do us (all those concerned with restoring Widevine DRM L1 security / TEE for HD video streaming after persist corruption) a favour if you still have this device? (I have RN8T.)

    Please can you install and open DRMInfo app, and just say if Security level is L1 under Widevine CDM?

    Many thanks, PW 👍
    Hello pndwal:

    I still have RN8 (as one of my backup phones) because it has the ability to try out anything without interrupting my work. Flashing persist is necessary when your persist partition corrupts which may cause sensors fail. Your DRM level changes to L3 at the time you unlock the bootloader.

    BR.
    1
    Hello pndwal:

    I still have RN8 (as one of my backup phones) because it has the ability to try out anything without interrupting my work. Flashing persist is necessary when your persist partition corrupts which may cause sensors fail. Your DRM level changes to L3 at the time you unlock the bootloader.

    BR.
    But it seems most MIUI devices don't actually lose Widevine L1 security (for decoding HD in TEE) with bootloader unlock; only if persist is corrupted... That's why I wondered if your fix, particularly 1) Restore from persist.bak, restores L1...

    I have Redmi Note 8T, stock, rooted... Always had L1:
    IMG_20220428_212126.jpg

    🙂 PW
    1
    What method you mean ? persistbak or the zip ?
    The persistbak.... I have messed up the persist.img backup file. Didn't knew there was a backup partition.
    1
    But it seems most MIUI devices don't actually lose Widevine L1 security (for decoding HD in TEE) with bootloader unlock; only if persist is corrupted... That's why I wondered if your fix, particularly 1) Restore from persist.bak, restores L1...

    I have Redmi Note 8T, stock, rooted... Always had L1:
    View attachment 5600539
    🙂 PW
    My RN8 is obviously L3.

    At that time I had only thought my phone was damaged, with strong nervous I found the persistbak and did a dd command to restore the persist. Then I'd like to help everyone who did something same with me to get out of such situation with an easy solution. Then I made these flashable zip files and uploaded to the thread.

    I've lost my original persist/persistbak backup and have overwritten the 2 partitions for many times so my phone will last L3 forever. But if you didn't touched persistbak, do a backup of its raw data to a safe place in order to restore your own unique image, instead of a generic persist.img.


    The generic persist.img is only for emergency situation, but it's surely a way to fix, isn't it?


    Actually I seldom touch DRM content. I buy DVDs and CDs for watching films and listening to music.
  • 24
    Disclaimer: I am not responsible for the results of any of these operations.


    Everyone knows that the persist partition is responsible for sonsors and carrier network etc. Once this partition is failed or lost, your phone will go wrong. I just faced, then solved the problem and I want to share the solution that could maybe help other persons.

    This was how it happeded:
    While I was flashing the phone, I erased the partition called "persist" accidently. When I was trying to flash the persist partition, the phone returned a message said that you can't flash the controlled partition. I suddenly relized something bad happened. Then I reboot the phone and find that many sensors stopped working. But the worst thing is the carrier network signals lost. I want to contact the service center at first. But I think as long as the phone is unlocked, there are tons of possibilities to fix it, unless it's hard-bricked. So I wanted to try to fix the partition.

    As we know, Xiaomi phones have backup partitions for most of the important partitions. For example, vbmeta and vbmetabak partitions. The vbmetabak usually is the backup of vbmeta. This persist partition also has a backup partition called "persistbak". This backup partition can be used to repair the persist partition. There are 2 ways to fix the persist partition. Choose the method you preferred.


    1. This way is for users have erased the persist partition, but haven't modified/erased the persistbak partition. If you don't want to type commands just use method 2.
    Go to fastboot, flash the twrp recovery first. Then hold the POWER and VOLUME UP to force the phone boot to twrp recovery. Connect the phone to your PC and open adb command window. Type the following commands in order:

    adb shell

    cd /dev/block/by-name

    ls -all

    Check the output, find the partitions called "persist" and "persistbak". Remember the blocks corresponding to these two partitions. They should be similar to "mmcblk0p**". Once you know these correspondences, you can restore the persist partition immediately. For example, the persist partition and persistbak partition correspond to mmcblk0p$$ and mmcblk0p%% respectively (persist---->mmcblk0p$$ and persistbak---->mmcblk0p%%). Run this following command to restore your persist partition:

    dd if=/dev/block/mmcblk0p%% of=/dev/block/mmcblk0p$$

    Note: You need to replace "mmcblk0p$$" and "mmcblk0p%%" with the real partition block name.

    Now the persist partition has been fixed/restored. Reboot your phone to system and check whether sensors and carrier network etc. all work fine.


    2. This way is for users that have erased persist partition and persistbak partition or can't restore the partition using method 1. Also, this method is a universal and easy way to fix both persist partition and persistbak partition. It doesn't need to type any command but only a swipe.
    I have made the persist partition repair tool for both global version and Chinese version. Both of them are in attachments. These tools make the repair process very easy. Both flashable zip files are tested on my Redmi Note 8 and they work fine.
    I have also posted them to Mi Community.
    Flash the repair tool in attachment. Choose the right file and flash it.
    Now the persist partition and persistbak partition have been fixed/restored. Reboot your phone to system and check whether sensors and carrier network etc. all work fine.


    If you think it's useful, please click the "Like" button.
    2
    Does this fix "device storage corrupted" error?
    Actually I have this error but my sensors, carrier, wifi ... Etc all working great this error still appears. Anyway I think magisk hide config props module damaged my device's persist when I changed the fingerprint then I came back to stock rom and this error happened so my question is: is this process risky Or could cause losing mac or imei? And am I going to lose widevine l1?
    I'm thinking about backing up my current persist before proceeding do you think it's a good idea?

    Yes. It can fix "find device storage corrupted" . You won't lose your imei or mac. At that time I erased the persist partition by a command "fastboot erase persist" accidently. I have tried both method 1 and 2, and the error is no longer appeared.
    About backing up, the persistbak partition is a backup partition for your current persist partition. So if you failed, just restore the persistbak to the main persist partition. And you can also export the raw image of your current persist partition. Of course, the error will appear if you restore the corrupted persistbak.
    1
    Disclaimer: I am not responsible for the results of any of these operations.


    Everyone knows that the persist partition is responsible for sonsors and carrier network etc. Once this partition is failed or lost, your phone will go wrong. I just faced, then solved the problem and I want to share the solution that could maybe help other persons.

    This was how it happeded:
    While I was flashing the phone, I erased the partition called "persist" accidently. When I was trying to flash the persist partition, the phone returned a message said that you can't flash the controlled partition. I suddenly relized something bad happened. Then I reboot the phone and find that many sensors stopped working. But the worst thing is the carrier network signals lost. I want to contact the service center at first. But I think as long as the phone is unlocked, there are tons of possibilities to fix it, unless it's hard-bricked. So I wanted to try to fix the partition.

    As we know, Xiaomi phones have backup partitions for most of the important partitions. For example, vbmeta and vbmetabak partitions. The vbmetabak usually is the backup of vbmeta. This persist partition also has a backup partition called "persistbak". This backup partition can be used to repair the persist partition. There are 2 ways to fix the persist partition. Choose the method you preferred.


    1. This way is for users have erased the persist partition, but haven't modified/erased the persistbak partition. If you don't want to type commands just use method 2.
    Go to fastboot, flash the twrp recovery first. Then hold the POWER and VOLUME UP to force the phone boot to twrp recovery. Connect the phone to your PC and open adb command window. Type the following commands in order:

    adb shell

    cd /dev/block/by-name

    ls -all

    Check the output, find the partitions called "persist" and "persistbak". Remember the blocks corresponding to these two partitions. They should be similar to "mmcblk0p**". Once you know these correspondences, you can restore the persist partition immediately. For example, the persist partition and persistbak partition correspond to mmcblk0p$$ and mmcblk0p%% respectively (persist---->mmcblk0p$$ and persistbak---->mmcblk0p%%). Run this following command to restore your persist partition:

    dd if=/dev/block/mmcblk0p%% of=/dev/block/mmcblk0p$$

    Note: You need to replace "mmcblk0p$$" and "mmcblk0p%%" with the real partition block name.

    Now the persist partition has been fixed/restored. Reboot your phone to system and check whether sensors and carrier network etc. all work fine.


    2. This way is for users that have erased persist partition and persistbak partition or can't restore the partition using method 1. Also, this method is a universal and easy way to fix both persist partition and persistbak partition. It doesn't need to type any command but only a swipe.
    I have made the persist partition repair tool for both global version and Chinese version. Both of them are in attachments. These tools make the repair process very easy. Both flashable zip files are tested on my Redmi Note 8 and they work fine.
    I have also posted them to Mi Community.
    Flash the repair tool in attachment. Choose the right file and flash it.
    Now the persist partition and persistbak partition have been fixed/restored. Reboot your phone to system and check whether sensors and carrier network etc. all work fine.


    If you think it's useful, please click thanks button.
    not to hate or dislike or be rude or anything... but people will lose Widevine L1 support by this method... so if anyone doesn't want HD videos on netflix etc, go ahead with this method.. otherwise don't even touch persist partition.
    1
    Hi Yuki,

    Greetings from India, hope you and your family are doing well.

    I own a Redmi K20 (davinci). I had installed Pixel Experience rom, which I didn't like and wanted to roll back to stock rom. But without reading the guide to flash fastboot rom, I flashed the back up I had taken via TWRP. Apparently, my phone was bricked and I had to enter edl mode via cmd and flash the stock rom which showed some error, but the phone booted to stock rom. Everything is working fine, even the touch-fingerprint sensor is working. All the other sensors aren't. I tried a lot of things, but to no avail. I took my device to the official service centre, they couldn't fix the sensors' issue.

    A couple of days ago, I stumbled upon your post on Redmi 8-sensors-not-issue solution. Can I use the same tool to fix the persist partition on my phone? I had read one of your replies saying: specific phone's persist.img should be extracted from the fastboot rom and replaced with one in your tool.

    It would be a great help if you could guide me.

    Many thanks
    my experience for you:i succedd in flashing the persist.img into my note8,but sensor still worked abnormally,at last i flash persist.img from the oldest ver fastboot rom when i bought ,it worked
    1
    I've been having camera issues with my Poco citrus device for the past year I even reflashed the device twice and was thinking of buying a new camera when I stumbled across this thread, my question is isn't IMEI and MAC stored in persist how can the same image be used across devices (same model obviously) should I try with overwriting persist persistback or use a persist image from mi, there are quite a few images out now do I flash the oldest or current Miui 12.5 ROM image?
    1. IMEI and MAC addr are not stored in persist/persistbak. They are stored in safer places where you never need to touch.
    2. Persist and persistbak images could be flashed at any time when needed.
    3. You must use your own persist.img which made for your device to write to 2 partitions.