Switching to custom rom from MIUI without flashing DFE - Redmi K20 Pro / Xiaomi Mi 9T Pro Questions & Answe

I removed the unlock pattern and fingerprint than rebooted into recovery. It didn't even try to decrypt the data, recovery booted instantly.
My question is: I'm on MIUI12 eu right now. When switching to AOSP custom, what will happen if I just wipe data and stuff, then flash the rom? I mean flashing without formatting data and flashing DFE. Is it ok to do that? And if it is, will there be any downsides?
I'm sorry if that was asked before, but I couldn't find any info.
Thanks

Speaw said:
I removed the unlock pattern and fingerprint than rebooted into recovery. It didn't even try to decrypt the data, recovery booted instantly.
My question is: I'm on MIUI12 eu right now. When switching to AOSP custom, what will happen if I just wipe data and stuff, then flash the rom? I mean flashing without formatting data and flashing DFE. Is it ok to do that? And if it is, will there be any downsides?
I'm sorry if that was asked before, but I couldn't find any info.
Thanks
Click to expand...
Click to collapse
There is no need to flash DFE.
You might still need to format data when coming from MIUI.
I've seen it said that MIUI implements encryption a little differently, which is why it's necessary to format data, even with the lockscreen security disabled/removed. However, I've never seen this confirmed or denied definitively, so you might be OK with just lockscreen security removed.
Edit:
Personally, I've always formatted data when flashing over MIUI, even if I've not set-up lockscreen security, just to be on the safe side.
If you did try without formatting data and it fails to load the new ROM, boot into TWRP, then format data. You should then be good to boot into the ROM.

Related

E: Unable to mount storage

I see this annoying error whenever i am in TWRP. I thought I had it resolved when I flashed the stock ROM then flashed my current run CM-12.1-20150902-NIGHTLY-shamu obtained from Cyanogens website.
Then today I let it run the latest OTA and forgot I would lose root. So I attempted to root again only get get stuck at the boot screen. I eventually did a dirty flash of the same CM 12.1 and now I am back to normal and I was able to root again. But I still get the error E: Unable to mount storage.
Also, I am now also unable to see my Nexus in Windows to explore Internal Storage but was able to before I tried rooting.
Thanks in advance.
Sounds like a good time to do full wipe and clean install. Including TWRP and root.
prdog1 said:
Sounds like a good time to do full wipe and clean install. Including TWRP and root.
Click to expand...
Click to collapse
That's the thing, I thought I did all that properly and then flashed the latest CM 12.1 but noticed last night after a failed root that it is now giving the error again.
Would using my backup after I flashed the stock ROM cause the error to come back? I am just looking for the easiest way to avoid reconfiguring my phone and apps again.
tjlmbklr said:
That's the thing, I thought I did all that properly and then flashed the latest CM 12.1 but noticed last night after a failed root that it is now giving the error again.
Would using my backup after I flashed the stock ROM cause the error to come back? I am just looking for the easiest way to avoid reconfiguring my phone and apps again.
Click to expand...
Click to collapse
Good chance it is that CM12 borking it. Flash anything you want. It either fixes it or it don't. Can always flash back to stock to troubleshoot.
Are you encrypted, with a password to decrypt on boot?
If you have like a swipe password , when rebooting into TWRP you will never the normal android to allow you to enter your password, instead you *should* get one in TWRP, however it will just prompt you for an alphanumeric password.
If you cancel out of that, or enter the wrong password (or don't have an alphanumeric password to enter), I believe it gives you this message... and obviously will fail to mount the encrypted partition.
If this is the case, boot back into system, turn off all passwords/security and it should work fine (no need to decrypt)
scryan said:
Are you encrypted, with a password to decrypt on boot?
If you have like a swipe password , when rebooting into TWRP you will never the normal android to allow you to enter your password, instead you *should* get one in TWRP, however it will just prompt you for an alphanumeric password.
If you cancel out of that, or enter the wrong password (or don't have an alphanumeric password to enter), I believe it gives you this message... and obviously will fail to mount the encrypted partition.
If this is the case, boot back into system, turn off all passwords/security and it should work fine (no need to decrypt)
Click to expand...
Click to collapse
I am not really sure what this is so my guess is now. I do have my phone set with a 'pattern unlock to boot and unlock the phone. How do I tell if I am encrypted?
Your encrypted if you did not install a kernel that supports no forced encryption, the reformat your user data partition via fastboot,
The phone is encrypted by default.
the fact that your device requires pattern unlock at boot, and not just to unlock is a pretty good indicator, but try going into security and select encrypt phone. If it does not give you warnings, remind you to charge and offer to let you encrypt, it is because you already are. Turn off the pattern needed to boot at least, if not any unlock security in general before rebooting to recovery to avoid this error.
scryan said:
Your encrypted if you did not install a kernel that supports no forced encryption, the reformat your user data partition via fastboot,
The phone is encrypted by default.
the fact that your device requires pattern unlock at boot, and not just to unlock is a pretty good indicator, but try going into security and select encrypt phone. If it does not give you warnings, remind you to charge and offer to let you encrypt, it is because you already are. Turn off the pattern needed to boot at least, if not any unlock security in general before rebooting to recovery to avoid this error.
Click to expand...
Click to collapse
Well I haven't changed my kernel and it says Encrypted in my settings. So I could potentially stay on my current setup and resolve my error if I install another kernel?
So here's what I hope will be an easy answer, what is the best method to flash a kernel? I have only tried it once and failed since my phone failed to boot afterwards.
Any recommendations on which kernel to use with CM?
Thanks for the help.
tjlmbklr said:
Well I haven't changed my kernel and it says Encrypted in my settings. So I could potentially stay on my current setup and resolve my error if I install another kernel?
So here's what I hope will be an easy answer, what is the best method to flash a kernel? I have only tried it once and failed since my phone failed to boot afterwards.
Any recommendations on which kernel to use with CM?
Thanks for the help.
Click to expand...
Click to collapse
No.
And CM comes with its own kernel, that does not force encryption.
The kernel is not "encrypted" or "decrypted", the stock kernel forces encryption, others don't. But if your encrypted, you are encrypted until you reformat userdata (obviously this wipes phone) so that it is not encrypted.
scryan said:
Your encrypted if you did not install a kernel that supports no forced encryption, the reformat your user data partition via fastboot
Click to expand...
Click to collapse
scryan said:
...and obviously will fail to mount the encrypted partition.
If this is the case, boot back into system, turn off all passwords/security and it should work fine (no need to decrypt)
Click to expand...
Click to collapse
scryan said:
. Turn off the pattern needed to boot at least, if not any unlock security in general before rebooting to recovery to avoid this error.
Click to expand...
Click to collapse
On encryption:
https://wiki.archlinux.org/index.php/Disk_encryption
(not related to nexus, other then it explains encryption, and nexus is encrypted)
You don't need to disable encryption, but obviously since you have your phone set up to require a pattern supply the decryption key to the system, and your booting into twrp BEFORE you can supply the key for decryption... twrp is not going to have any way to read the encrypted partition. Just turn the security off before rebooting to recovery.
Alternatively you can look up threads here on decrypting your phone, and follow those instructions. You will get a very minor performance boost too... but it does mean that if your phone is lost or stolen your data is a little more accessible.
scryan said:
No.
And CM comes with its own kernel, that does not force encryption.
The kernel is not "encrypted" or "decrypted", the stock kernel forces encryption, others don't. But if your encrypted, you are encrypted until you reformat userdata (obviously this wipes phone) so that it is not encrypted.
On encryption:
https://wiki.archlinux.org/index.php/Disk_encryption
(not related to nexus, other then it explains encryption, and nexus is encrypted)
You don't need to disable encryption, but obviously since you have your phone set up to require a pattern supply the decryption key to the system, and your booting into twrp BEFORE you can supply the key for decryption... twrp is not going to have any way to read the encrypted partition. Just turn the security off before rebooting to recovery.
Alternatively you can look up threads here on decrypting your phone, and follow those instructions. You will get a very minor performance boost too... but it does mean that if your phone is lost or stolen your data is a little more accessible.
Click to expand...
Click to collapse
Thanks. I hope to figure this all out tonight.
tjlmbklr said:
Thanks. I hope to figure this all out tonight.
Click to expand...
Click to collapse
The thread on it is a little confusing IMO, maybe just me.
Just remember encryption is about how the data is stored on the partition NOT a setting in the kernel. The kernel only comes into play because the kernel used stock on the nexus 6 has code to check if you are using encryption, and if you are not it forces you to encrypt your data before it boots.
So step one is make sure you have a kernel that does not force encryption. I have not seen a 3rd party nexus kernel with encryption set to enforced, that would be weird.
Step two is to actually go ahead and make your user data partition not encrypted. This has to be done by reformating in fastboot, see tutorial thread for commands. When you reformat, by default the partition will not be encrypted.
Just make sure that when you an update you don't flash the stock kernel and boot, because this will wipe your device when it forces you to encrypt (You could probably power down or cancel some how? Have never tried...)
This would most likely happen if you ran stock, and you fastboot flashed a new system and boot (boot contains kernel)
Alternatively, don't mess with any of this. You don't need to be unencrypted to mount your data in recovery, you just need to set up security in android to not require any kind of pin to boot (I used to just turn unlock to swipe instead of pattern before I wanted to use recovery). There is some performance lost with encryption, but they vastly improved encrypted performance with 5.1.1, and not being encrypted only gives you a tiny bump in performance. just A LITTLE more snappy imo.
scryan said:
The thread on it is a little confusing IMO, maybe just me.
Just remember encryption is about how the data is stored on the partition NOT a setting in the kernel. The kernel only comes into play because the kernel used stock on the nexus 6 has code to check if you are using encryption, and if you are not it forces you to encrypt your data before it boots.
So step one is make sure you have a kernel that does not force encryption. I have not seen a 3rd party nexus kernel with encryption set to enforced, that would be weird.
Step two is to actually go ahead and make your user data partition not encrypted. This has to be done by reformating in fastboot, see tutorial thread for commands. When you reformat, by default the partition will not be encrypted.
Just make sure that when you an update you don't flash the stock kernel and boot, because this will wipe your device when it forces you to encrypt (You could probably power down or cancel some how? Have never tried...)
This would most likely happen if you ran stock, and you fastboot flashed a new system and boot (boot contains kernel)
Alternatively, don't mess with any of this. You don't need to be unencrypted to mount your data in recovery, you just need to set up security in android to not require any kind of pin to boot (I used to just turn unlock to swipe instead of pattern before I wanted to use recovery). There is some performance lost with encryption, but they vastly improved encrypted performance with 5.1.1, and not being encrypted only gives you a tiny bump in performance.
Click to expand...
Click to collapse
LeanKernel decrypt is an option as it should be in all Kernels and is one of the better ones. The top kernel developers make it an option. Many noobs post unencrypted kernels where they only change the ramdisk and there is no other option. Can have performance and encryption as you say especially with the Google code updates.
prdog1 said:
LeanKernel decrypt is an option as it should be in all Kernels and is one of the better ones. The top kernel developers make it an option. Many noobs post unencrypted kernels where they only change the ramdisk and there is no other option. Can have performance and encryption as you say especially with the Google code updates.
Click to expand...
Click to collapse
Super random and unrelated plug for leankernel, but OK thanks. :good:
There are plenty of popular kernels, I have found Zen good, many like Elite and Hells Core as well.

How to remove encryption in OrangeFox?

Everytime I boot into recovery it asks for my pin lock code. Entering my pin everytime into the recovery is mildly irritating. Anyway to remove this?
Do I have format data everytime I flash a new rom? It is a pain to backup my data everytime to a PC when flashing a new rom.
rv5750 said:
Everytime I boot into recovery it asks for my pin lock code. Entering my pin everytime into the recovery is mildly irritating. Anyway to remove this?
Click to expand...
Click to collapse
It's a minor inconvenience for the security of your personal data in the phone.
rv5750 said:
Do I have format data everytime I flash a new rom? It is a pain to backup my data everytime to a PC when flashing a new rom.
Click to expand...
Click to collapse
You don't need to format data unless you want to remove encryption, but it's advisable to at least wipe data.
When wiping data TWRP will leave the external storage intact (even though external storage is stored in the data partition). So app and ROM data is lost, but personal data is kept.
When you format data, then personal data in external storage is lost too.
Robbo.5000 said:
It's a minor inconvenience for the security of your personal data in the phone.
Click to expand...
Click to collapse
Is there no way to remove it? The thing is I don't want encryption. I saw a file on K20 Pro telegram group named FCrypt Disabler which disables force encryption. Will that do the trick? When should I flash that file?
rv5750 said:
Is there no way to remove it? The thing is I don't want encryption. I saw a file on K20 Pro telegram group named FCrypt Disabler which disables force encryption. Will that do the trick? When should I flash that file?
Click to expand...
Click to collapse
Are you on official MIUI?
If you're on a custom ROM, then after formatting data you should remain unencrypted without needing to do anything else.
Robbo.5000 said:
Are you on official MIUI?
If you're on a custom ROM, then after formatting data you should remain unencrypted without needing to do anything else.
Click to expand...
Click to collapse
I'm on latest Havoc but I don't know how Orangefox is encrypted.
rv5750 said:
I'm on latest Havoc but I don't know how Orangefox is encrypted.
Click to expand...
Click to collapse
Sorry, I'm forgetting that is now standard to encrypt the phone automatically when setting a PIN for unlocking. Try the script linked in the bottom of this post to disable encryption permanently.
https://forum.xda-developers.com/k2...0s-twrp-status-phh-gsis-t3939325/post79720268
Robbo.5000 said:
Sorry, I'm forgetting that is now standard to encrypt the phone automatically when setting a PIN for unlocking. Try the script linked in the bottom of this post to disable encryption permanently.
https://forum.xda-developers.com/k2...0s-twrp-status-phh-gsis-t3939325/post79720268
Click to expand...
Click to collapse
If I used pattern unlock instead of pin it wouldn't have encrypted the rom?
In the linked thread it says to format data and then flash the file. Suppose I want to install a new rom.
The current process for this phone is:
1. Flash MIUI Chinese rom.
2. Wipe everything except vendor and internal storage.
3. Flash rom of choice and gapps.
4. Format data.
5. Boot the device.
At which step should I flash that file? Flashing the decryption file is after formatting data (step 4), right?
What if I already am on a custom rom? Flashing the file would decrypt the rom or not?
Sorry for asking so many questions. The previous device I had was Redmi Note 4 (mido) so it wasn't necessary to do all these things.
rv5750 said:
If I used pattern unlock instead of pin it wouldn't have encrypted the rom?
In the linked thread it says to format data and then flash the file. Suppose I want to install a new rom.
The current process for this phone is:
1. Flash MIUI Chinese rom.
2. Wipe everything except vendor and internal storage.
3. Flash rom of choice and gapps.
4. Format data.
5. Boot the device.
At which step should I flash that file? Flashing the decryption file is after formatting data (step 4), right?
What if I already am on a custom rom? Flashing the file would decrypt the rom or not?
Sorry for asking so many questions. The previous device I had was Redmi Note 4 (mido) so it wasn't necessary to do all these things.
Click to expand...
Click to collapse
My previous phone was a OnePlus 3, and so this was never an issue with that. After that phone had a fatal accident I had a Redmi 6a for 3 months while I waited for a an all screen with SD855 to be released. All I did with that was install TWRP and Magisk. So I've never actually tried to permanently remove encryption, so don't take what I'm saying as definite.
Not all ROMs require you to format data. I'm on the AOSiP ROM and it wasn't required. I'll move to the Havoc ROM soon, and again it's not required to format data.
My understanding is that you will have an unencrypted phone, even after setting a pin, after flashing that script, so I assume that it would be unnecessary to format data where a ROM install instruction tells you to. This is usually done to ensure the data partition is unencrypted before flashing.
I think setting a pattern also encrypts the phone. I have seen a guide on how to replicate the pattern using the keyboard in TWRP, but can't find it again now.
rv5750 said:
If I used pattern unlock instead of pin it wouldn't have encrypted the rom?
In the linked thread it says to format data and then flash the file. Suppose I want to install a new rom.
The current process for this phone is:
1. Flash MIUI Chinese rom.
2. Wipe everything except vendor and internal storage.
3. Flash rom of choice and gapps.
4. Format data.
5. Boot the device.
At which step should I flash that file? Flashing the decryption file is after formatting data (step 4), right?
What if I already am on a custom rom? Flashing the file would decrypt the rom or not?
Sorry for asking so many questions. The previous device I had was Redmi Note 4 (mido) so it wasn't necessary to do all these things.
Click to expand...
Click to collapse
Flash right before first boot
Robbo.5000 said:
Sorry, I'm forgetting that is now standard to encrypt the phone automatically when setting a PIN for unlocking. Try the script linked in the bottom of this post to disable encryption permanently.
https://forum.xda-developers.com/k2...0s-twrp-status-phh-gsis-t3939325/post79720268
Click to expand...
Click to collapse
Hi,
This scripts DecScript-Universal-v2.zip don't works on eu.rom 20.1.16/21 v3. Stuck in bootloop·
Any other solutions?
Thanks.
sfairmm said:
Hi,
This scripts DecScript-Universal-v2.zip don't works on eu.rom 20.1.16/21 v3. Stuck in bootloop·
Any other solutions?
Thanks.
Click to expand...
Click to collapse
See if the disable force encrypt script in this post works. It's more up to date.
https://forum.xda-developers.com/k2...ners-guide-to-raphaelin-t4020543/post81217503
Robbo.5000 said:
See if the disable force encrypt script in this post works. It's more up to date.
https://forum.xda-developers.com/k2...ners-guide-to-raphaelin-t4020543/post81217503
Click to expand...
Click to collapse
Good!!
I will try and after sharing with you.
Just knowledge, yesterday I flashed the script by @AndyYan, and the device starts again only after the 3 installation attempts. This script works on eu.rom 9.8xx i tested there.
Have nice!
Robbo.5000 said:
Sorry, I'm forgetting that is now standard to encrypt the phone automatically when setting a PIN for unlocking. Try the script linked in the bottom of this post to disable encryption permanently.
https://forum.xda-developers.com/k2...0s-twrp-status-phh-gsis-t3939325/post79720268
Click to expand...
Click to collapse
Yo ITS work...but now i cant use lockscreen..how to remove the script
Divapranala said:
Yo ITS work...but now i cant use lockscreen..how to remove the script
Click to expand...
Click to collapse
Get the appropriate firmware and vendor file for your phone from here https://downloads.akhilnarang.dev/MIUI/raphael
Flashing this will remove the effects of the script.
Robbo.5000 said:
Are you on official MIUI?
If you're on a custom ROM, then after formatting data you should remain unencrypted without needing to do anything else.
Click to expand...
Click to collapse
I'm running resurrection remix Android 10 on OnePlus 7t pro, formatted data still data partition is encrypted. Recovery: OrangeFox

Mi 8 Encryption

Hi to whoever can help me. I am on Havoc ROM and want to encrypt it. Is there a way I can do it without doing a clean flash?
I am also interested in that because when I press encrypt on my phone (Pixel Experience) the phone reboots but does not encrypt the data partition.
I also flashed the disable_dm_verity.zip after flashing the rom.
Xavind said:
Hi to whoever can help me. I am on Havoc ROM and want to encrypt it. Is there a way I can do it without doing a clean flash?
Click to expand...
Click to collapse
+ @greivel2
If the encryption option in settings fails, then there is no way to do it without a factory reset.
Usually obtaining encryption is easier on a rom that fails to encrypt by choosing factory reset in Recovery.
Then reboot and setup up rom, When you return to TWRP it should ask for the pattern or pin, I discovered this by accident.
Just now I found that this is actually a standard practice : https://drfone.wondershare.com/android-issue/android-encryption-unsuccessful.html
tsongming said:
+ @greivel2
If the encryption option in settings fails, then there is no way to do it without a factory reset.
Usually obtaining encryption is easier on a rom that fails to encrypt by choosing factory reset in Recovery.
Then reboot and setup up rom, When you return to TWRP it should ask for the pattern or pin, I discovered this by accident.
Just now I found that this is actually a standard practice : https://drfone.wondershare.com/android-issue/android-encryption-unsuccessful.html
Click to expand...
Click to collapse
Thank you will try this and let you know how it goes.

Bootloop to twrp

Hello, I have flashed twrp, made a backup and tried to flash arrow os on my xiaomi mi 9t pro. However, now I'm stuck and it's just booting to twrp automatically. I've tried restoring boot, system, vendor, but no success. Does anyone know what to do? Also, how do I figure out which vendor I have, I didn't look previously and now it's not booting (so I could try to flash the original rom).
krifpv said:
Hello, I have flashed twrp, made a backup and tried to flash arrow os on my xiaomi mi 9t pro. However, now I'm stuck and it's just booting to twrp automatically. I've tried restoring boot, system, vendor, but no success. Does anyone know what to do? Also, how do I figure out which vendor I have, I didn't look previously and now it's not booting (so I could try to flash the original rom).
Click to expand...
Click to collapse
You probably needed to Format (not just Wipe) Data.
This is a MUST whenever you flash custom ROMs - something that everyone must read/learn about before going for custom ROMs
However, if you messed up your vendor or other partitions, you will probably need to flash the full tgz/fastboot firmware - Google is your friend
zgfg said:
You probably needed to Format (not just Wipe) Data.
This is a MUST whenever you flash custom ROMs - something that everyone must read/learn about before going for custom ROMs
However, if you messed up your vendor or other partitions, xou will probably need to flash the full tgz/recovery firmware - Google is your friend
Click to expand...
Click to collapse
Oh my ****ing god. Thank you so so much!! Formatting data worked!
zgfg said:
You probably needed to Format (not just Wipe) Data.
This is a MUST whenever you flash custom ROMs - something that everyone must read/learn about before going for custom ROMs
However, if you messed up your vendor or other partitions, you will probably need to flash the full tgz/fastboot firmware - Google is your friend
Click to expand...
Click to collapse
Google is not your friend when you want help with your phone. There is so much bad information that is easily found when using Google (same with YouTube). If you are not sure what you're doing, how can you verify a random article/video is giving good information.
Better to stick with XDA where many members can verify info and advice. XDA search is your friend.
krifpv said:
Oh my ****ing god. Thank you so so much!! Formatting data worked!
Click to expand...
Click to collapse
You need to format data whenever you flash over MIUI (or MIUI derived custom ROM).
Flashing over another AOSP ROM you won't need to format data. However it is strongly advised to remove lockscreen security before updating a custom ROM or flashing a new custom ROM.

K20 Pro reboots back to twrp recovery after installing EU rom zip

Hey all,
When i tried switching to EU rom from global (with unlocked bootloader) by flashing the recovery EU rom I got into TWRP recovery loop.
I have wasted lot of hours trying to wrap my mind to find a fix. Finally it turned out to be a simple step.
Thanks to those people - https://xiaomi.eu/community/threads/solved-twrp-bootloop-after-flash.54583/
Just FORMAT the DATA instead of WIPING it in TWRP before installing the EU 12.6 rom.
Note: this will format your data so you might wanna copy rom from pc after formatting the DATA partition using adb push command or you can use external storage.
eg:
adb push E:\mi\recovery\adb\xiaomi.eu_multi_HMK20ProMI9TPro_21.6.2_v12-11.zip /sdcard/
Click to expand...
Click to collapse
hunkdhaya said:
Hey all,
When i tried switching to EU rom from global (with unlocked bootloader) by flashing the recovery EU rom I got into TWRP recovery loop.
I have wasted lot of hours trying to wrap my mind to find a fix. Finally it turned out to be a simple step.
Thanks to those people - https://xiaomi.eu/community/threads/solved-twrp-bootloop-after-flash.54583/
Just FORMAT the DATA instead of WIPING it in TWRP before installing the EU 12.6 rom.
Note: this will format your data so you might wanna copy rom from pc after formatting the DATA partition using adb push command or you can use external storage.
eg:
Click to expand...
Click to collapse
This is a general rule, and described in every good guide:
- When switching a ROM, one MUST FORMAT Data (not Wipe)
Unfortunately many newbies read that but do not understand that there are two options in TWRP, one for Formatting Data and another for Wiping Data, and that these two are completely different things - hence although described in the guides, they Wipe Data instead of Formatting and then they get the Bootloop
Hence not bad you wrote it here, but there will be still others who will make the same mistake again - just check into Questions and Answers, how many simular questions for the help are reported there (they flashed the ROM but did not Format Data or they Wiped instead of Formatting, and they ask how to resolve the bootloop)

Categories

Resources