Related
Hey folks,
I've just unlocked my bootloader and flashed the newest PhilZ Recovery. I've been following THIS tutorial.
Fastboot didn't encounter any issues, so I thought everything went fine. But after flashing the recovery image, my phone got stuck while booting. The Sony logo shows up, the screen turns black and that's where it gets stuck.
Trying to erase userdata, factory reset etc didn't help. While resetting it shows up the following message
Code:
"Error mounting/formatting /data"
So I tried to mount it manually in the recovery, but it shows the same error. Seems like a permission problem?!
Since I don't have a ROM on my SD-card yet I tried to install one via fastboot.
Code:
fastboot update ArchiDroid_V3.0.1.1-nicki.zip
But..
Code:
Archive does not contain 'android-info.txt'
Archive does not contain 'android-product.txt'
error: update package has no android-info.txt or android-product.txt
Now I'm stuck. I don't think installing a new ROM will work if I can't even mount /data. So first thing is to fix this and then I'll be able to install a new ROM. Am I right?
By the way : fastboot has no problem detecting my device, but adb can't find it?! D:
I appreciate any kind of help! Thanks in advice!
Gruß aus Deutschland,
furi ;D
furiify said:
Hey folks,
I've just unlocked my bootloader and flashed the newest PhilZ Recovery. I've been following THIS tutorial.
Fastboot didn't encounter any issues, so I thought everything went fine. But after flashing the recovery image, my phone got stuck while booting. The Sony logo shows up, the screen turns black and that's where it gets stuck.
Trying to erase userdata, factory reset etc didn't help. While resetting it shows up the following message
Code:
"Error mounting/formatting /data"
So I tried to mount it manually in the recovery, but it shows the same error. Seems like a permission problem?!
Since I don't have a ROM on my SD-card yet I tried to install one via fastboot.
Code:
fastboot update ArchiDroid_V3.0.1.1-nicki.zip
But..
Code:
Archive does not contain 'android-info.txt'
Archive does not contain 'android-product.txt'
error: update package has no android-info.txt or android-product.txt
Now I'm stuck. I don't think installing a new ROM will work if I can't even mount /data. So first thing is to fix this and then I'll be able to install a new ROM. Am I right?
By the way : fastboot has no problem detecting my device, but adb can't find it?! D:
I appreciate any kind of help! Thanks in advice!
Gruß aus Deutschland,
furi ;D
Click to expand...
Click to collapse
have you try to flash any rom except that? because when i try to flash archidroid i've same problem like you can't mount but when i try to install any rom like cm my device can mount normally.
Nicklas Van Dam said:
have you try to flash any rom except that? because when i try to flash archidroid i've same problem like you can't mount but when i try to install any rom like cm my device can mount normally.
Click to expand...
Click to collapse
I did. Tried 3 different ROMs and everyone gave me the same outcome.
But it seems like I fixed it by returning to stock using FlashTool and a stock ROM. I went all over again and now it's installing the ROM. I hope it's working now.
E: Yup, it's working fine now. But thanks anyway!
Hey Guys,
I'm having a weird issue on my wife's OP3. It shows as the latest update is available for download.
I've been trying to download this update for the past 3-4 days now, everytime the download completes, it tries to verify the downloaded file and says "Cannot Verify the download, please download again". I have tried to download the full update atleast 5 times now and everytime the same issue.
The ROM downloads fine at around 5-6 MBps. However, after the download completes, the verification fails.
Any ideas what I can do to fix this. I have also tried to sideload, however, I'm getting "Can't read xxx.zip" error even though the device is recognized under "adb devices". Any pointers on how to fix this would really help.
exjc1986 said:
Hey Guys,
I'm having a weird issue on my wife's OP3. It shows as the latest update is available for download.
I've been trying to download this update for the past 3-4 days now, everytime the download completes, it tries to verify the downloaded file and says "Cannot Verify the download, please download again". I have tried to download the full update atleast 5 times now and everytime the same issue.
The ROM downloads fine at around 5-6 MBps. However, after the download completes, the verification fails.
Any ideas what I can do to fix this. I have also tried to sideload, however, I'm getting "Can't read xxx.zip" error even though the device is recognized under "adb devices". Any pointers on how to fix this would really help.
Click to expand...
Click to collapse
You can try download full zip and try sideload. But sometimes, if the file too big, then the adb will not work. if adb cannot read, because filesize too big. Use laa_2_0_4.zip to fix the adb.exe first.
bkcheah75 said:
You can try download full zip and try sideload. But sometimes, if the file too big, then the adb will not work. if adb cannot read, because filesize too big. Use laa_2_0_4.zip to fix the adb.exe first.
Click to expand...
Click to collapse
I did try to sideload and even saw this Large file fix thing on reddit. Tried it out, but it still didn't work. Will give it a shot again. will try to use google USB driver and see how that goes... Not sure if there is a utility for OP3 which can help with the sideload... Like Android Tools for Nexus..
exjc1986 said:
I did try to sideload and even saw this Large file fix thing on reddit. Tried it out, but it still didn't work. Will give it a shot again. will try to use google USB driver and see how that goes... Not sure if there is a utility for OP3 which can help with the sideload... Like Android Tools for Nexus..
Click to expand...
Click to collapse
One of the toolkits: https://forum.xda-developers.com/oneplus-3/development/toolkit-oneplus-3-toolkit-unlock-t3398799
But it is fun doing the flashing yourself, facing bootloop, anxious moments etc and then that feeling when you ultimately get it right!
You will be missing all that. Pity!
Im stuck!!
I was rooted with Magisk on crosshatch QP1A.190711.020.C3, Sep 2019.
I just tried option #4 keep data and am getting the below (also attached pic) after getting to fastbootd screen during flash:
sending product FAILED (Write to device failed (Invalid argument))
When I try to reboot, it only boots to bootloader. I then tried wiping data same thing. I then tried reverting to the previous .C3 Sep 2019 firmare and again, same thing.
Im currently on slot B and as far as im aware, I havent done anything to slot A. However, in the bootloader screen at the bottom, I see:
Enter reason: no valid slot to boot
Before I try flashing anything else, Id like to try to boot to Slot A and see if I can at least have a usable phone for work tomorrow. Is it possible to boot to slot A from the bootloader screen?
If not, what else can I do?
Thanks in advance!!!!
JJT211 said:
Im stuck!!
I was rooted with Magisk on crosshatch QP1A.190711.020.C3, Sep 2019.
I just tried option #4 keep data and am getting the below (also attached pic) after getting to fastbootd screen during flash:
sending product FAILED (Write to device failed (Invalid argument))
When I try to reboot, it only boots to bootloader. I then tried wiping data same thing. I then tried reverting to the previous .C3 Sep 2019 firmare and again, same thing.
Im currently on slot B and as far as im aware, I havent done anything to slot A. However, in the bootloader screen at the bottom, I see:
Enter reason: no valid slot to boot
Before I try flashing anything else, Id like to try to boot to Slot A and see if I can at least have a usable phone for work tomorrow. Is it possible to boot to slot A from the bootloader screen?
If not, what else can I do?
Thanks in advance!!!!
Click to expand...
Click to collapse
Did you try to use the latest SDK https://developer.android.com/studio/releases/platform-tools.html/
saxmydix said:
Did you try to use the latest SDK https://developer.android.com/studio/releases/platform-tools.html/
Click to expand...
Click to collapse
Yup, im on 29.0.4
So I found the command to switch to slot A
fastboot set_active a
Still stuck in bootloader mode.
Huuu... Had the same problem. You should try again flash.all from pc. You wait until the i/o error apears. Then you are in fastboot.d mode. From here you choose sideload ota from pc (or simular). Now you are able to execute the adb sideload command from your pc. Then wait and reboot. This saved my ass... Make sure you downloaded the full ota image before.
OK I did the regular flash-all as you said and got error. At this point, the CLI says press "any key to exit"
I then exited, selected recovery - apply ADB update - opened CLI - adb devices (saw my serial #) and then entered "adb sideload image-crosshatch-qp1a.191005.007.zip"
And now after im getting:
verifying update package....
E: footer is wrong
Update package verification took .2 s (result 1)
E: signature verifcation failure
E: error: 21
Install from ADB completed with status 2
Installation aborted
EDIT: Im an idiot, I tried to sideload the factory image. Im sideloading the OTA now. Looks like its working. Standby
Donric13 said:
Huuu... Had the same problem. You should try again flash.all from pc. You wait until the i/o error apears. Then you are in fastboot.d mode. From here you choose sideload ota from pc (or simular). Now you are able to execute the adb sideload command from your pc. Then wait and reboot. This saved my ass... Make sure you downloaded the full ota image before.
Click to expand...
Click to collapse
It worked AND I kept all my data! Suweeet! Damn you saved my ass, I wouldve been ****ed tomorrow at work. Thanks again!
How many hours did it take you to figure that out??
JJT211 said:
It worked AND I kept all my data! Suweeet! Damn you saved my ass, I wouldve been ****ed tomorrow at work. Thanks again!
How many hours did it take you to figure that out??
Click to expand...
Click to collapse
Tried several ways to get into recovery (fastboot.d) to sideload the ota after the i/o error... After a hour i got the trick (3. try to begin with flash-all.sh...). Somehow i always got trouble with system space when monthly update is downloaded automatically and can't get applied because i am rooted... Somehow it seems saver to install the full ota with sideload than the flash-all.sh procedure... Glad it also worked on your side.
Donric13 said:
Huuu... Had the same problem. You should try again flash.all from pc. You wait until the i/o error apears. Then you are in fastboot.d mode. From here you choose sideload ota from pc (or simular). Now you are able to execute the adb sideload command from your pc. Then wait and reboot. This saved my ass... Make sure you downloaded the full ota image before.
Click to expand...
Click to collapse
Which file do i sideload? I tried crosshatch-qp1a.191005.007-factory-2989a08d.zip. It failed with same error as guy above. I then tried to adb sideload image-crosshatch-qp1a.191005.007.zip and i got the same error? which file am I supposed to sideload?
EDIT:Never mind. I found the file. downloading and flashing hopefully it works!
Hello guys, I recently formatted data on my phone to fix a bootloop I had. After fixing everything, SIM card and wifi was not working, I downloaded the Official Stock ROM of my phone and flashed bluetooth, modem, dsp and dtbo. The original plan was to run "flash_all_except_storage.bat" but that kept throwing errors. After I flashed those things I booted successfully and unlocked my phone. Problem is Wifi still doesn't work. So once again got into fastboot, tried running "flash_all_except_storage.bat", once again it threw an error, so I restarted my phone and ever since I can't boot into system. Whenever I restart it goes straight into fastboot, Power off and on again goes to fastboot, I can boot into TWRP, rebooting from there still goes into fastboot mode. I fix a problem and 2 more take it's place, I really need your help here.
Thanks a lot !
Edit:
Fix Attempt 1 (FAILED): I tried formating data through TWRP as I read online, it did not work
Attempt 2 (FAILED): Used
Code:
fastboot continue
and got this error:
Code:
Resuming boot FAILED (remote: 'Failed to load image from partition: No Media')
fastboot: error: Command failed
Attempt 3 (HALF FIX): After some digging I realized after a failed attempt to run "flash_all_except_storage.bat", the boot was erased. I tried flashing only the boot.img and the phone booted up with the wifi working as well. Problem is after a reboot I go back into fastboot and I have to flash boot.img again to boot into system.
Here is recovery.log Pastebin
Leonniar said:
Hello guys, I recently formatted data on my phone to fix a bootloop I had. After fixing everything, SIM card and wifi was not working, I downloaded the Official Stock ROM of my phone and flashed bluetooth, modem, dsp and dtbo. The original plan was to run "flash_all_except_storage.bat" but that kept throwing errors. After I flashed those things I booted successfully and unlocked my phone. Problem is Wifi still doesn't work. So once again got into fastboot, tried running "flash_all_except_storage.bat", once again it threw an error, so I restarted my phone and ever since I can't boot into system. Whenever I restart it goes straight into fastboot, Power off and on again goes to fastboot, I can boot into TWRP, rebooting from there still goes into fastboot mode. I fix a problem and 2 more take it's place, I really need your help here.
Thanks a lot !
Edit:
Fix Attempt 1 (FAILED): I tried formating data through TWRP as I read online, it did not work
Attempt 2 (FAILED): Used
Code:
fastboot continue
and got this error:
Code:
Resuming boot FAILED (remote: 'Failed to load image from partition: No Media')
fastboot: error: Command failed
Attempt 3 (HALF FIX): After some digging I realized after a failed attempt to run "flash_all_except_storage.bat", the boot was erased. I tried flashing only the boot.img and the phone booted up with the wifi working as well. Problem is after a reboot I go back into fastboot and I have to flash boot.img again to boot into system.
Here is recovery.log Pastebin
Click to expand...
Click to collapse
Can you flash full rom with mi flash tool
Rares6567 said:
Can you flash full rom with mi flash tool
Click to expand...
Click to collapse
Already did, it didn't work...
Leonniar said:
Already did, it didn't work...
Click to expand...
Click to collapse
Maybe is some motherboard issues?
I don't believe so. The problem I originally had was that after a restart the phone was booting into fastboot. But if I didn't restart the phone was working fine, cellular, wifi google services everything. So in order to fix that I flashed the full stock rom and that's how I ended up in the restart loop in the first place.
https://forum.xda-developers.com/t/decrypting-xiaomi-mi10t-pro-internal-storage.4544271/page-2#posts
Here are all the details, I started from a completely different problem and ended up here. They entire process I took is in that thread
Leonniar said:
I don't believe so. The problem I originally had was that after a restart the phone was booting into fastboot. But if I didn't restart the phone was working fine, cellular, wifi google services everything. So in order to fix that I flashed the full stock rom and that's how I ended up in the restart loop in the first place.
https://forum.xda-developers.com/t/decrypting-xiaomi-mi10t-pro-internal-storage.4544271/page-2#posts
Here are all the details, I started from a completely different problem and ended up here. They entire process I took is in that thread
Click to expand...
Click to collapse
There is no volume buttons problem?
If no maybe you should reflash whole phone, fastboot, recovery, all, using edl ig.... I don't have this phone or any Snapdragon phone, so I don't really know....
Yeah I did, I used the flash_all.bat that comes with the ROM file and pretty much replaced everything. I tried to run it a couple of times and it failed mostly but I was able to run it twice I think (without changing anything, just running it again and again at some point it worked)
Leonniar said:
Yeah I did, I used the flash_all.bat that comes with the ROM file and pretty much replaced everything. I tried to run it a couple of times and it failed mostly but I was able to run it twice I think (without changing anything, just running it again and again at some point it worked)
Click to expand...
Click to collapse
So then why your phone goes to fastboot?
I really don't know, after running flash_all the second time now my phone is stuck in a restart loop. Shows the MI logo and restarts. I can manually boot to recovery or fastboot but if I leave it on it's own it keeps turning on and off
Leonniar said:
I really don't know, after running flash_all the second time now my phone is stuck in a restart loop. Shows the MI logo and restarts. I can manually boot to recovery or fastboot but if I leave it on it's own it keeps turning on and off
Click to expand...
Click to collapse
It seems that this a software bug ig, can you try go to recovery and flash the rom?
I could try but I am not sure how to do that. My rom comes in a .tgz format and not .zip and all guides mention you need a .zip file
Leonniar said:
I could try but I am not sure how to do that. My rom comes in a .tgz format and not .zip and all guides mention you need a .zip file
Click to expand...
Click to collapse
So where u downloaded the fastboot rom, there is a recovery rom too :
Xiaomi Firmware Updater
The ultimate script that provides firmware packages for Xiaomi devices.
xiaomifirmwareupdater.com
Be sure u download the recovery rom not fastboot.
Btw use your miui version u had
Tho I'm not 100% sure if you flashed the fastboot rom correctly, did u :
1. Open MiFlashTool : download the tool from here if you don't have it ---> https://xiaomiflashtool.com/
2. Select your rom ( make sure your path to the rom isn't long and the folder/folders don't have long names )
3. Connect your phone
4. Click Refresh ( to make your device appear)
5. And click flash
I didn't do it with MiFlashTool because it kept throwing errors at me whenever I launched it so I tried the flash_all.bat batch file that runs cmd commands and flashes everything. the ROM I installed was the fastboot version. The official website on the recovery ROM stated that "This page shows a single update only" so I assumed it's just an update and not the full ROM. I was also told I should use the fastboot variant in the above mentioned thread
Leonniar said:
I didn't do it with MiFlashTool because it kept throwing errors at me whenever I launched it so I tried the flash_all.bat batch file that runs cmd commands and flashes everything. the ROM I installed was the fastboot version. The official website on the recovery ROM stated that "This page shows a single update only" so I assumed it's just an update and not the full ROM. I was also told I should use the fastboot variant in the above mentioned thread
Click to expand...
Click to collapse
Ok so to fix the error : go to miflashtool folder and create a new folder called : log
Fixed the start up error, I get the screen that says "Please install driver", I press Install and I get this:
https://prnt.sc/I53g6bs_8i5w
Pressing ok gets me back to the "Please install driver" screen
Well I just closed the Install driver window and flashed as is, I got this:
https://prnt.sc/Bk2eaj9w5Lq7 so presumably it failed but my devices rebooted and is now on system set up
Edit:
3 reboots later and phone still boots fine to system
Rares6567 said:
It seems that this a software bug ig, can you try go to recovery and flash the rom?
Click to expand...
Click to collapse
flashing miui_APOLLOEEAGlobal_V12.5.4.0.RJDEUXM_451a2324af_11.0.zip from stock recovery is good idea, you can do this from MicroSD card to circumvent any usb issues you are obviously facing on fastboot.
Leonniar said:
Well I just closed the Install driver window and flashed as is, I got this:
https://prnt.sc/Bk2eaj9w5Lq7 so presumably it failed but my devices rebooted and is now on system set up
Edit:
3 reboots later and phone still boots fine to system
Click to expand...
Click to collapse
So it worked?
This "error" isn't an "error" so don't worry about it
Leonniar said:
Well I just closed the Install driver window and flashed as is, I got this:
https://prnt.sc/Bk2eaj9w5Lq7 so presumably it failed but my devices rebooted and is now on system set up
Edit:
3 reboots later and phone still boots fine to system
Click to expand...
Click to collapse
This error is normal since you are not re-locking the bootloader.
If some functions are inoperative.
Try to flash the same rom (fastboot) that you had when you bought the phone, probably an A11.
Use clean all(flash_all.bat).
https://forum.xda-developers.com/t/flash-tool-guide-use-xiaomi-flash-tool.4262425/
Hi everyone,
maybe someone here might help me. I was on bliss rom and my phone suddenly froze yesterday.
And oh boy did that started a very long day of messing with miflash tool and twrp.
The situation right now is like this,
I have full access to TWRP, and fastboot and mi flash tool.
I tried flashing stock rom with mi flash, got success with no error and yet still stuck in frozen POCO logo.
Tried flashing with TWRP couple of ROMs with correct fw and still got POCO logo stuck.
Tried sideloading with adb some ROMs and same results, stuck on POCO logo.
Also tried to use flash_all bat without mi flash tool, and it boots me to MIUI recovery...
I can always come back to fastboot and boot to TWRP and tried miflashtool many time , I always result in success (0) but nothing works...
Is there anything I'm missing?
Of course I waited at least half an hour every time on POCO logo beacuse I know It can take some time for first boot but nothing happens, If I had to guess is there a possibility that the Storage it self in the phone is broken?
kmo1997 said:
Hi everyone,
maybe someone here might help me. I was on bliss rom and my phone suddenly froze yesterday.
And oh boy did that started a very long day of messing with miflash tool and twrp.
The situation right now is like this,
I have full access to TWRP, and fastboot and mi flash tool.
I tried flashing stock rom with mi flash, got success with no error and yet still stuck in frozen POCO logo.
Tried flashing with TWRP couple of ROMs with correct fw and still got POCO logo stuck.
Tried sideloading with adb some ROMs and same results, stuck on POCO logo.
Also tried to use flash_all bat without mi flash tool, and it boots me to MIUI recovery...
I can always come back to fastboot and boot to TWRP and tried miflashtool many time , I always result in success (0) but nothing works...
Is there anything I'm missing?
Of course I waited at least half an hour every time on POCO logo beacuse I know It can take some time for first boot but nothing happens, If I had to guess is there a possibility that the Storage it self in the phone is broken?
Click to expand...
Click to collapse
Did you format the data partition at all while doing this? If not, then try running "fastboot -w" while in bootloader mode.
DarthJabba9 said:
Did you format the data partition at all while doing this? If not, then try running "fastboot -w" while in bootloader mode.
Click to expand...
Click to collapse
yes i tried. it gives me an error :
Erasing 'userdata' OKAY [ 0.032s]
F2FS-tools: mkfs.f2fs Ver: 1.15.0 (2022-05-20)
Info: Disable heap-based policy
Info: Debug level = 1
Info: Trim is disabled
Info: Set conf for android
Info: Enable Project quota
Error: Sparse mode is only supported for android
C:\Users\Moti\Desktop\platform-tools/make_f2fs failed: 4294967295
fastboot: error: Cannot generate image for userdata
kmo1997 said:
yes i tried. it gives me an error :
Erasing 'userdata' OKAY [ 0.032s]
F2FS-tools: mkfs.f2fs Ver: 1.15.0 (2022-05-20)
Info: Disable heap-based policy
Info: Debug level = 1
Info: Trim is disabled
Info: Set conf for android
Info: Enable Project quota
Error: Sparse mode is only supported for android
C:\Users\Moti\Desktop\platform-tools/make_f2fs failed: 4294967295
fastboot: error: Cannot generate image for userdata
Click to expand...
Click to collapse
Hmmm ... that shouldn't happen. You may have a hardware problem.
Try booting to recovery and formatting data from there. If that doesn't work either, then I have no other suggestions.
DarthJabba9 said:
Hmmm ... that shouldn't happen. You may have a hardware problem.
Try booting to recovery and formatting data from there. If that doesn't work either, then I have no other suggestions.
Click to expand...
Click to collapse
i tried , no luck.
is there any way to fing out if it is truely hardware problem?
Hi,
just a thought,
I have been in a situation were Miui stock would not complete it`s installation, I don`t use MIflash tool, i found a tip that involved moving the ADB flies from Miflash and put them into the Miui fastboot stock rom folder and move the re-named folder to my C: Drive.
After some panicking i tried my old faithful a "Xiaomi.eu Fastboot rom", i installed it from fastboot, it completed as it should and i carried on where i left off, flashing custom roms,
its worth a try
i do the same
johnr64 said:
Hi,
just a thought,
I have been in a situation were Miui stock would not complete it`s installation, I don`t use MIflash tool, i found a tip that involved moving the ADB flies from Miflash and put them into the Miui fastboot stock rom folder and move the re-named folder to my C: Drive.
After some panicking i tried my old faithful a "Xiaomi.eu Fastboot rom", i installed it from fastboot, it completed as it should and i carried on where i left off, flashing custom roms,
its worth a try
Click to expand...
Click to collapse
thanks for the answer, in my situation miui stock completes the installation successfully with a beautiful green success in miflashtool and yet I'm still stuck at the POCO logo till botting itself to MIUI recovery.
regardless I tried your advice and no luck
I have tried a couple more things, I flashed with locking the bootloader the oldest MIUI ROM I found on the archive, of course no luck, still stuck on POCO logo and as always somehow, I'm able to boot into fastboot so unlocked the bootloader again and tried a xieomi.eu rom without mi flash tool with the .bat file and flash_all.
same result, no luck
I'm starting to think it might really be a hardware issue, yet I'm baffled at how the phone was working perfectly fine and suddenly froze while i was using it and started bootlooping which started this whole mess.
kmo1997 said:
.... I'm starting to think it might really be a hardware issue, yet I'm baffled at how the phone was working perfectly fine and suddenly froze while i was using it and started bootlooping which started this whole mess.
Click to expand...
Click to collapse
That is often how hardware problems manifest themselves.
kmo1997 said:
thanks for the answer, in my situation miui stock completes the installation successfully with a beautiful green success in miflashtool and yet I'm still stuck at the POCO logo till botting itself to MIUI recovery.
regardless I tried your advice and no luck
Click to expand...
Click to collapse
If possible try gsi builds to boot bro it may boot directly to system
Try flashing different Fastboot stock Roms using miflash, don't use just one version, try only without locking the bootloader, probably it is a boot partition error, you just need to find the right one, also use a different miflash version (older ones seem to be more stable)
I have just read one of your recent comments, it seems like e miflash problem, flashing with lock must lock the bootloader, try using known versions especially older ones
Have you tried turning it off and on again?
Jk.
First of, which twrp Version are you using? You should try the latest skkk versions. https://sourceforge.net/projects/recovery-for-xiaomi-devices/files/alioth/
Are you sure that you have full twrp storage access? If you boot into twrp, how big is your internal storage, as seen from twrp? Does it show 0?
I had this error once, couldnt flash anything anymore because twrp couldnt handle some encryption and needed to reformat the internal storage to ext2, then back to ext4 again. Then the storage was readable and writable again.
Encryption can be a weird, just like A/B partitioning.
Make sure to use the latest version of MIUI for your specific region.
A.k.a. the exact version of MIUI that your phone shipped with, but use the latest version of it.
And don't download from a weird third party website.
I think the official site is mi.com (but you'll have to google the exact link).
Otherwise, my go-to for MIUI ROMs is xiaomifirmwareupdater.com