yashsingh1/xdaforums huggingface dataset:
[Redmi Note 8 Guides, News, & Discussion] Yuki1001:
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.
[Redmi Note 8 Guides, News, & Discussion] Yuki1001:
Update: I have uploaded 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.
[Redmi Note 8 Guides, News, & Discussion] Yuki1001:
Yes. You are right. I have been flashed my redmi note 5's persist partition and its a sparse img file. Look like this img file is a raw img not sparse file. Thanks for the tip. I have changed the content of method 2. And it's really easy to flash both persist and persistbak using my repair tool.
[Redmi Note 8 Guides, News, & Discussion] Yuki1001:
Yes. That's a good work. Thanks for sharing. I really have the same idea to you. I will test your file later with replacing your persist.img in the zip file.
[Redmi Note 8 Guides, News, & Discussion] Yuki1001:
OK. Thanks for the reply I will test your zip file tomorrow. It should be a good work. Just technical discussion, nothing else.
[Redmi Note 8 Guides, News, & Discussion] Yuki1001:
I don't think dd is wrong if the img is a raw image. It should can be dd to the partition. I'm sorry if I said something wrong and don't be angry please. Just discussion, nothing else. I will test your file with my persist.img tomorrow.
[Redmi Note 8 Guides, News, & Discussion] CesarPedetta:
Hi! Thanks for the input! Would I lose L1 widevine DRM validation with this method?
[Redmi Note 8 Guides, News, & Discussion] Yuki1001:
Is your persist partition broken? If so just flash it. Don't think too much. The phone works normally is the first thing. And sorry, I don't know if it will effect the widevine DRM security level. Don't use it like a toy. Persist means "persist", its data should not be changed after shipping. Only flash it when your persist partition is broken or cannot works properly.
[Redmi Note 8 Guides, News, & Discussion] AkkulaDz:
hello,

i have Mi 9T pro i have bug with light and proximity sensor, after flash persist.img with orange fox my sensor work but for few moment and stop work again look at the evidence

[YOUTUBE]https://youtu.be/84pSsY2NYp8[/YOUTUBE]
[Redmi Note 8 Guides, News, & Discussion] loopypalm:
thx 4 the tutorial
[Redmi Note 8 Guides, News, & Discussion] tze_vitamin:
can I flash this two files on my poco F2 Pro ? I have problem with persist image, lost my fingerprint sensor..
[Redmi Note 8 Guides, News, & Discussion] WinBug2:
Is there an chance to get the the persist partition file for Willow please?

I tried to restore from bak files, didn't work. :(
[Redmi Note 8 Guides, News, & Discussion] raptorddd:
autobrightness is not working for me. after ive flashed fastboot rom .. i noticed that my screen was very bright at nigth. so checked brightness.

manually brightness works ok up and down.. but in auto only works on high settings but it wont go down. or seems to go down but brightess doesnt change..

enter cit presing kernel verion did a test on light sensor. flux sensor goes up and down depending of light but the brightness value doesnt change down only up high.
[Redmi Note 8 Guides, News, & Discussion] Yuki1001:
Just download the fastboot ROM which version you are using. Extract it and you can find persist.img in images folder.
[Redmi Note 8 Guides, News, & Discussion] gwgantengcuy:
Hi, thanks for sharing.

im using mi note 10, im losing the /persist partition directory, somehow it losing after flashing custom rom, how to get it back? Im editing your file and change to my phone original persist.img, and flashing on twrp it end to fastboot bootloop. My sensor are working, but after loosing my /persist directory the fingerprint scanner "cant add fingerprint, try again" Error.

I check at miflash, theres no option to install/create persist.img partition at promram0.xml line to fix this (somehow im suprising about this, because at my old whyred phone theres an option to create the partition), Could you help me solving this?
[Redmi Note 8 Guides, News, & Discussion] the_weird_aquarian:
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.
[Redmi Note 8 Guides, News, & Discussion] GERGX:
Thank you so much, flashing the zip worked !
[Redmi Note 8 Guides, News, & Discussion] Tomasz111xp:
Where can i find repair_persist-willow.zip ? From gingko not work.
[Redmi Note 8 Guides, News, & Discussion] wsdyleon:
maybe extract it from"" fastboot.tgz""which your original version use
[Redmi Note 8 Guides, News, & Discussion] Kodize:
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!
[Redmi Note 8 Guides, News, & Discussion] Zechz:
Thanks a lot, I was gonna yeet my phone in frustration.
[Redmi Note 8 Guides, News, & Discussion] Zechz:
You are awesome! a lifesaver
[Redmi Note 8 Guides, News, & Discussion] Sahil2002:
Does this also fix l1 in my poco X2?
[Redmi Note 8 Guides, News, & Discussion] wsdyleon:
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
[Redmi Note 8 Guides, News, & Discussion] Sahil2002:
Please someone reply?
[Redmi Note 8 Guides, News, & Discussion] awanline:
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...
[Redmi Note 8 Guides, News, & Discussion] Yuki1001:
Download the fastboot ROM for your phone and find the persist.img. These zips are made for ginkgo.
[Redmi Note 8 Guides, News, & Discussion] Yuki1001:
Find the persist.img form your fastboot ROM. Then replace the persist.img in the zip file.
[Redmi Note 8 Guides, News, & Discussion] PRanxter:
what about redmi note 5 vince?
[Redmi Note 8 Guides, News, & Discussion] wsdyleon:
Find the persist.img form your fastboot ROM. Then replace the persist.img in the zip file.
[Redmi Note 8 Guides, News, & Discussion] PRanxter:
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
[Redmi Note 8 Guides, News, & Discussion] wsdyleon:
cannot access fastboot mode？ my proposal is that first shut off or reset to fastboot mode
[Redmi Note 8 Guides, News, & Discussion] PRanxter:
Fastboot works but can't flash recovery or anything coz the bootloader is locked now. I know I fkd up. Pls help
[Redmi Note 8 Guides, News, & Discussion] wsdyleon:
unlock your bootloder， recommend u flash offcial rom to return normal （with some issues as of “”persist“”）

another，your phone was locked， how comes it that “persist” was destroyed
[Redmi Note 8 Guides, News, & Discussion] PRanxter:
It was unlocked, but while flashing in hurry i clicked flash + lock
[Redmi Note 8 Guides, News, & Discussion] Shubham R. Dukhande:
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
[Redmi Note 8 Guides, News, & Discussion] wsdyleon:
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
[Redmi Note 8 Guides, News, & Discussion] wsdyleon:
i think you can flash back to normal stock rom
[Redmi Note 8 Guides, News, & Discussion] Shubham R. Dukhande:
Hi @wsdyleon , thanks for replying. Correct me if I am wrong. I think out of the box my device was on MIUI 10, Android Pie (9), I am not sure though. Now I am on MiUI 12, Android Q (10) [refer attached screenshot]. So I will have to flash the persist.img from MIUI 10, Android Pie (9) fastboot rom? Also, do I have to directly flash only persist.img or replace it with the img in Yuki's tool zip and flash Yuki's tool zip. If yes, I will have to use repair_persist-ginkgo(mi).zip this zip, right, since I am not on China rom?
[Redmi Note 8 Guides, News, & Discussion] PRanxter:
ya, I flashed stock rom but now my phone restarts in a minute of turning on. please look at this once and help

https://xdaforums.com/t/device-restarts-automatically.4295297/
[Redmi Note 8 Guides, News, & Discussion] wsdyleon:
someone give method to flash “persist.bak” if you donnot delete 。or you should download the old ver fastboot rom ，and take out the persist.img，the persist.img must be in accordance with your model
[Redmi Note 8 Guides, News, & Discussion] wsdyleon:
i suggest you unlock your phone infastboot mode，and then flash the persist also in fastboot mode（using adb platform-tools ）
[Redmi Note 8 Guides, News, & Discussion] PRanxter:
thank you, i flashed moded persist and it doesnt restart automatically. now I need to fix the network problem
[Redmi Note 8 Guides, News, & Discussion] Yuki1001:
Flashing persist and persistbak in fastboot mode is impossible. So I made these flashable zips for Redmi Note 8 users after I managed to fix the persist and persistbak. Right now with no auth programmer for Sm6125 we can also flash these 2 partitions in EDL mode.

If you tried this method and success, please tell us the firmware version you are using and give screenshots of successful flashing.

Normally the bootloader will reject flashing persist and persistbak partition. These limitations are in place since years ago!

Here's my Redmi Note 8 (ginkgo). Flashing both persist and persistbak in fastboot is not allowed by Xiaomi.

View attachment 5352023

But it allows erasing both persist and persistbak. Weird.
[Redmi Note 8 Guides, News, & Discussion] wsdyleon:
did you try “”fastboot --disable-verity flash persist persist.img

using adb platform-tools at unlocked
[Redmi Note 8 Guides, News, & Discussion] Yuki1001:
Also not allowed flashing these 2 partitions even with --disable-verification --disable-verity. These arguments are used for flashing vbmeta.

Please give your screenshot of successful flashing and the firmware version of your device.

Flashing persist and persistbak are NOT allowed in fastboot mode. These limitations are in place since years ago.

Right now with my knowledge, flashing persist and persistbak could be done with 3rd party recovery like TWRP etc. and EDL mode. Since we've got no auth programmer for Sm6125 we could flash anything in EDL freely.

But the most convenient flashing method is flashing my zip with a simple swipe, isn't it?
[Redmi Note 8 Guides, News, & Discussion] hehehehe1123:
thank you. but not working. can you make a flashable zip file for redmi note 5 pro.
[Redmi Note 8 Guides, News, & Discussion] dfrios:
You are the fu***ing admin! I was looking for this since I accidentally wiped "persist" partition on my Redmi Note 8. You saved my day. THANKS from the bottom of my heart.

I just downloaded the file you attached, moved to my cellphone using ADB (I was on TWRP):

adb push repair_persist-ginkgo(mi).zip /sdcard1/

Then I pressed INSTALL button on TWRP, selected that file, swiped to install it, and voila! The magic was done.
[Redmi Note 8 Guides, News, & Discussion] Piyush rohi:
I need redmi note 8 pro persist img because my gyroscope and accelerometer is not working 🥺
[Redmi Note 8 Guides, News, & Discussion] Yuki1001:
Extract fastboot ROM and you will find your persist image file.
[Redmi Note 8 Guides, News, & Discussion] Oddking:
Omg thank you so much you just saved my phone the 2nd method worked like a charm
[Redmi Note 8 Guides, News, & Discussion] jashan456:
i have extracted fastboot rom but there is no persist img showing
[Redmi Note 8 Guides, News, & Discussion] wavychris:
ive been wondering did you manage to fix your persist partition on poco f2 pro?
[Redmi Note 8 Guides, News, & Discussion] tze_vitamin:
Yes. I go to CIT test and in advanced settings lef or right corner, i follow all test. Even with fingerprint,I remember I need something white and sime black. After doing all this couple test. Fix my fingerprint sensor.and alll others
[Redmi Note 8 Guides, News, & Discussion] wavychris:
i couldnt fix my gyroscope seems i need to flash persist
[Redmi Note 8 Guides, News, & Discussion] tze_vitamin:
I didn't have finger print and I solve it in CIT advanced luckily.

I even try to flash from other phone persist.img ,didnt help

You try this?
[Redmi Note 8 Guides, News, & Discussion] joekerr00:
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?
[Redmi Note 8 Guides, News, & Discussion] Yuki1001:
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.
[Redmi Note 8 Guides, News, & Discussion] wavychris:
oh yes i did try this but my sensoras showed zero values, sometimes out of the blue the X value would show up as some random numbers idk
[Redmi Note 8 Guides, News, & Discussion] Suryo75:
i dont see it, both recovery or fastboot firmware, i use redmi 6a
[Redmi Note 8 Guides, News, & Discussion] Allx0021:
method 1- adb commands: working on redmi note 7 lavender, everything returned to normal, even wifi, although the proximity sensor and varometer do not work or maybe this device does not have them, and as expected the DRM is in L3. THANK YOU SO MUCH Yuki1001
[Redmi Note 8 Guides, News, & Discussion] pndwal:
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 👍
[Redmi Note 8 Guides, News, & Discussion] Yuki1001:
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.
[Redmi Note 8 Guides, News, & Discussion] pndwal:
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
[Redmi Note 8 Guides, News, & Discussion] *justintime*:
Dude thanks many times.... I flashed persist.img while I had a backup L3 was there... With your method 1. It's L1 again..... This is Life hack thread
[Redmi Note 8 Guides, News, & Discussion] loopypalm:
What method you mean ? persistbak or the zip ?
[Redmi Note 8 Guides, News, & Discussion] *justintime*:
The persistbak.... I have messed up the persist.img backup file. Didn't knew there was a backup partition.
[Redmi Note 8 Guides, News, & Discussion] Yuki1001:
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.
[Redmi Note 8 Guides, News, & Discussion] pndwal:
Yup... Thanks

I lack experience with this, but as I understand it, generic image won't change existing device-specific (unique) data / numbers, whereas device-specific backup will... So I guess either should fix basic corruption, but you wouldn't want to flash device-specific persist on a different device...

I may also be wrong about this! 😝

I've learnt a bit about Widevine security from posts in Magisk General Discussion and other threads, and note it's implementation seems to vary a lot across OEMs.

Eg, on OnePlus and other, widevine itself seems to poll SafetyNet, and L1 is lost on unlocking bootloader, but can be restored w/ SafetyNet passing by means of Universal SafetyNet Fix module etc... On MIUI, other users report that like RN8T, their devices retain L1... It may be that only corrupted persist breaks this...

- https://xdaforums.com/t/magisk-general-support-discussion.3432382/post-86770675

- https://xdaforums.com/t/magisk-general-support-discussion.3432382/post-86771223

- https://xdaforums.com/t/magisk-general-support-discussion.3432382/post-86771507

Good... Is L3 Widevine the only persist related issue you are aware is remaining? PW
[Redmi Note 8 Guides, News, & Discussion] Yuki1001:
In fact it is related to sensors and carrier network (and more). Widevine Security Level is not the point to talk. Obviously, there is no way we can accept the carrier network and sensors stop working.

Yes. The generic image only contains some basic sensors' startup data. But it's a complete filesystem image so it will overwrite your all previous data in persist partition. Flashing the image is not an incremental operation to the partition.

Exactly, the DRM security key is stored in persist partition. Only untouched persist and persistbak after shipping include the DRM Decryption Key.

It's consistent with the posts what you mentioned. So if you lose your device-specific persist.img backup and persistbak (the security key), you will lose L1 forever.
[Redmi Note 8 Guides, News, & Discussion] loopypalm:
what if we have a persist from a L1 device

can it be flashed on a L3 and work ?
[Redmi Note 8 Guides, News, & Discussion] Yuki1001:
Haven't tested it before.:)

Or you can create a raw img (sector-by-sector) of your L1 persist partition and I can do a quick test. My device is GINKGO.
[Redmi Note 8 Guides, News, & Discussion] loopypalm:
i don't have it

i have L3 so i asked if it work so i will look for one

tell me if you test anything (y)
[Redmi Note 8 Guides, News, & Discussion] Zibri:
On a healthy system that has only a bad persist partition, all is needed is just a line of code from any recovery image:

dd if=/dev/block/by-name/persistbak of=/dev/block/by-name/persist conv=notrunc

and then a reboot.

persistbak is never really backed up by the system and should be identical to persist.img you find in your firmware.

I just tried erasing persist... then I was in a soft boot loop... so I copied persistbak to persist (or persist.img to persist) and the result was the same. Same contents.
[Redmi Note 8 Guides, News, & Discussion] ludemon:
Hi, I have a MI 9 SE with proximity and light sensors not working. I tried method 1 and get Permission denied. Bootloader is unlocked. Any ideas why this failed?
[Redmi Note 8 Guides, News, & Discussion] Yuki1001:
You'd perform this operation under RECOVERY environment. Any Recovery other than Mi-Recovery.
[Redmi Note 8 Guides, News, & Discussion] TziMmysGr:
Could someone make flashable zips of partition for poco x3 pro?
[Redmi Note 8 Guides, News, & Discussion] Yuki1001:
hhh. Instead, I suggest you to write the partition manually.
[Redmi Note 8 Guides, News, & Discussion] Saitama09:
will this method work Redmi note 10 pro ? I got cts failed problem after flashing persist.img through recovery .. Now cts failes even on locked bootloader , I have tried every flashing method and miui 12,12.5,13,14 nothing worked
[Redmi Note 8 Guides, News, & Discussion] esrom02:
Will this fix VoWiFi not working?
[Redmi Note 8 Guides, News, & Discussion] snows2k:
Did you tried doing this method? And if yes, did you fixed your CTS issue? I'm also having the same exact problem as you sadly, and i think it might be because of persist.img since i deleted it once in the past & then to fix it i flashed one from the stock miui fastboot rom. I still didn't tried because i'm waiting for the 7 days to unlock bootloader.

EDIT: I tried this method & it didn't fixed the device is not certified :/ So maybe it's not related to me deleting persist.img ... Oh well

EDIT2: Tried several android 12 roms even xiaomi.eu and i get device not certified, whenever i try any android 13 custom rom device is certified... (xiaomi mi note 10 lite)
[Redmi Note 8 Guides, News, & Discussion] snows2k:
@Yuuki1001​

Yuki1001​

I deleted my persist.img at long time ago, and then to try fix the issue i flashed a persist.img from a fastboot stock rom. My question here is, the persistbak have your original persist.img or at this point it would have a backup from the persist.img of the fastboot rom?
[Redmi Note 8 Guides, News, & Discussion] _Fahad_:
Bro can u give any solution for Realme Phone ?

I have the RMX2103 (Realme 7i) model
[Redmi Note 8 Guides, News, & Discussion] mantasx1001:
Works on POCO X3 PRO (vayu) persist is named sdf7 and persistbak is named sdf8 .And you can use those commands in recovery terminal no adb needed
[Redmi Note 8 Guides, News, & Discussion] Snakeforhire:
This only works when rooted with Magisk (need root to overwrite system partitions) via adb or direct on phone, and if using a terminal emulator other than Termux on Android (Termux needs an additional package to run root commands. Best to use AnotherTerm or Termius, which support root out-of-the-box). 😉