Installation lineageos - Redmi K20 / Xiaomi Mi 9T Questions & Answers

Hi guys,i have a mi9t with bl unlocked and would change from miui to lineage,but my device is crypted,i can flash twrp,do wipe,install and reboot o could be dangerous with the encryption and how to disable if i can,t flash lineage,thank
(sorry for my bad english)

sbnnn said:
Hi guys,i have a mi9t with bl unlocked and would change from miui to lineage,but my device is crypted,i can flash twrp,do wipe,install and reboot o could be dangerous with the encryption and how to disable if i can,t flash lineage,thank
(sorry for my bad english)
Click to expand...
Click to collapse
General procedure when switching ROMs (you can double-check, guides can be found elswhere, not specifically for LOS and generally for Xiaomi phones)
- Backup as much as you can, by various methods
- Install the latest official TWRP
- Boot to TWRP, enter your Android unlock pin to be able to see Internal memory (to be able to flash the ROM zip file from Internal memory)
- Flash the ROM (do not Wipe anything)
- F O R M A T (not Wipe - different options in TWRP, formatting does more than wiping, that's what you need for the proper encryption for the new ROM) DATA partition (it will also wipe Internal memory - that's why you need to backup first)
- reboot to the new ROM

zgfg said:
General procedure when switching ROMs (you can double-check, guides can be found elswhere, not specifically for LOS and generally for Xiaomi phones)
- Backup as much as you can, by various methods
- Install the latest official TWRP
- Boot to TWRP, enter your Android unlock pin to be able to see Internal memory (to be able to flash the ROM zip file from Internal memory)
- Flash the ROM (do not Wipe anything)
- F O R M A T (not Wipe - different options in TWRP, formatting does more than wiping, that's what you need for the proper encryption for the new ROM) DATA partition (it will also wipe Internal memory - that's why you need to backup first)
- reboot to the new ROM
Click to expand...
Click to collapse
I am in twrp without pin,but it Is removed after restart,so can i flash a rom with MIUI encrypted(only format)?

sbnnn said:
I am in twrp without pin,but it Is removed after restart,so can i flash a rom with MIUI encrypted(only format)
Click to expand...
Click to collapse
If you don't use the pin on Android, TWRP should not ask you.
If you use pattern, it will ask you for the pattern
But you need that only to be able to navigate to the zip file you want to flash.
You can put the zip file to USB -OTG or also to external SD card you will put to the second SIM slot, then TWRP does not need the pin, it will not need to read Internal memory
After you flash and when you Format Data (it will also reformat Internal memory), it's all over
When you reboot to the new ROM, the new ROM will create it's own, new encryption (but to be able to do that, you had to Format Data before rebooting to that new ROM)
Some ppl do even this way:
- first they Format Data
- then they sidelload new ROM zip file from PC (they cannot flash from Inernal memory because they have already formatted Data and therefore lost everything from Internal nemory)
- then they reboot to the new ROM
Ie, it is important that you do both flashing the ROM and formatting Data from TWRP before you reboot, the order is not important
However, for me it's easier to flash from Download folder than sideloading, that's why I suggested you to Format after flashing
Once you reboot to the new ROM, it will establish its new encryption, it will ask you to setup your new unlock pin/pattern (or nothing if you prefer your phone to stay unsecure)
---
Hence, if you will be sideloading or flashing from USB-OTG or external SD card, who cares for your unlock pin while you are entering TWRP before flashing
---
Wiping Data delete files and folders only, but the old encryption remains (and new ROM does not handle it)
Formatting prepares Data (with Internal memory) for nthe new ROM to make its own, new encryption
You know what is different between formatting hard disk/usb stick/SD card from just wiping files.
Formatting creates new file system, wiping leaves the old file system but only removes files and folders

Btw, some people wipe only (or do not even wipe because they 'think' they can save their stuff while switching the ROM)
Then they report problems with the new ROM (and neither the new ROM, nor TWRP can no more read Internal memory, hence they loose their stuff anyway)
Then they cry for help, and they finally learn and accept they have to Format Data - they do it (it doesn't affect the ROM they had previously flashed to System partition - different partition hence not affected by later formatting Data)
After they finally format Data (two days or a week later after flashing the new ROM), they reboot and they can finally then to properly setup.the new ROM

zgfg said:
Btw, some people wipe only (or do not even wipe because they 'think' they can save their stuff while switching the ROM)
Then they report problems with the new ROM (and neither the new ROM, nor TWRP can no more read Internal memory, hence they loose their stuff anyway)
Then they cry for help, and they finally learn and accept they have to Format Data - they do it (it doesn't affect the ROM they had previously flashed to System partition - different partition hence not affected by later formatting Data)
After they finally format Data (two days or a week later after flashing the new ROM), they reboot and they can finally then to properly setup.the new ROM
Click to expand...
Click to collapse
I have installed lineageos without problem,but when i try to flash potatoasosp with android 12 result an error,It would baseband v12.1.4(like),how to now?
Thank for tour support

sbnnn said:
I have installed lineageos without problem,but when i try to flash potatoasosp with android 12 result an error,It would baseband v12.1.4(like),how to now?
Thank for tour support
Click to expand...
Click to collapse
No idea, I don't use those ROMs (I prefer MIUI not stock but Xiaomi.eu)

Flash firmware - it's all described in 1st post. You need specific firmware for ROM to work

Related

[Q] Newbie questions (don't kill me Im new!)

Hy there I love xda and im a new user to xda nexus forum
With excelent guides I learnt how to root unlock and install custom rom (quite easy let it down into your internal storage and install from zip)
but I have few questions..
When I tried to wipe data and cache I accidentally did factory reset which ended up in no installed rom, internal storage empty and I was in custom recovery and I couldn't connect to computer, so I had to start from 0... last times I've been selecting wipe data and cache.. but I seen that in my nexus 7 some old files are still there (under a folder called 0) What should I do to make a clean install? which option of the new recovery should I choose? thankyou
mariosanoguera said:
Hy there I love xda and im a new user to xda nexus forum
With excelent guides I learnt how to root unlock and install custom rom (quite easy let it down into your internal storage and install from zip)
but I have few questions..
When I tried to wipe data and cache I accidentally did factory reset which ended up in no installed rom, internal storage empty and I was in custom recovery and I couldn't connect to computer, so I had to start from 0... last times I've been selecting wipe data and cache.. but I seen that in my nexus 7 some old files are still there (under a folder called 0) What should I do to make a clean install? which option of the new recovery should I choose? thankyou
Click to expand...
Click to collapse
Use TWRP for recovery and to do a clean install wipe all data from TWRP.
Sent from my Nexus 7 using xda premium
mariosanoguera said:
Hy there I love xda and im a new user to xda nexus forum
With excelent guides I learnt how to root unlock and install custom rom (quite easy let it down into your internal storage and install from zip)
but I have few questions..
When I tried to wipe data and cache I accidentally did factory reset which ended up in no installed rom, internal storage empty and I was in custom recovery and I couldn't connect to computer, so I had to start from 0... last times I've been selecting wipe data and cache.. but I seen that in my nexus 7 some old files are still there (under a folder called 0) What should I do to make a clean install? which option of the new recovery should I choose? thankyou
Click to expand...
Click to collapse
I'd flash a stock recovery image onto your device available here which would restore your device completely back to stock (with your bootloader unlocked) From there I'd just re root and do what you want. However I'd personally use CWM Touch Recovery myself, but I just like that recovery more (have used it and the non-touch version for ages and on many devices)
smt8544 said:
I'd flash a stock recovery image onto your device available here which would restore your device completely back to stock (with your bootloader unlocked) From there I'd just re root and do what you want. However I'd personally use CWM Touch Recovery myself, but I just like that recovery more (have used it and the non-touch version for ages and on many devices)
Click to expand...
Click to collapse
I actually have Team Win Recovery Project..
under wipe I can find
Cache
Dalvik
Factory Reset (This is the one I use.. but It leaves in my internal storage with a folder called 0 and my old data from previous roms is stored there)
System
External Storage
Int. Storage ?
Format Data (I did this and I lost everything except TWRM which I could boot at it (but I had no option to install from zip neither couldnt transferr a file through usb mount sd card didn't work))
Which one of all of this should I run before doing the install zip from sd card?
mariosanoguera said:
I actually have Team Win Recovery Project..
under wipe I can find
Cache
Dalvik
Factory Reset (This is the one I use.. but It leaves in my internal storage with a folder called 0 and my old data from previous roms is stored there)
System
External Storage
Int. Storage ?
Format Data (I did this and I lost everything except TWRM which I could boot at it (but I had no option to install from zip neither couldnt transferr a file through usb mount sd card didn't work))
Which one of all of this should I run before doing the install zip from sd card?
Click to expand...
Click to collapse
I think it would be easier and cleaner if you restored back to stock before trying to re root, flash recovery, etc. If you have no important data on your device I'd go for it. If you do have important data, then try and pull it to your computer and then flash a stock image and re root etc.
I always find that in times when my device is screwing around, or I have file dregs around the place, I find it simply easier to backup important things and flash a stock image.

Need a little help understanding A/B partitions

I have a few questions I'm new to the a/b partitions thing I've read the page on a/b partitions. But I'm still in the mud.
1 I'm on Verizon bootloader unlocked twrp 3.2.3-23 and magisk installed I have 9.0.11 installed twrp and magisk in slot a/b
now is it necessary to backup stock rom? If I install lets say crDroid in slot A install twrp installer I know twrp goes into both slots reboot back to recovery making sure I'm still in A install gapps and magisk reboot back to recovery making sure again I'm still in A slot then reboot to crDriod that should work yes?
2 Now If I wanted to go back to my stock rom witch is in B slot can I not reboot back to twrp and switch to slot B and go to stock?
Thanks guys this A/B partition is still clear as mudd
Making a back up is always recommend, but it's up to the user to decide if the want to or not. The down side is loosing all your data, so there is that.
The short answer to your 2nd question is no you can not dual boot ROMs on this device. I posed the same question in a different thread and you can read the explanation from Dark Nightmare here.
https://forum.xda-developers.com/showpost.php?p=78375631&postcount=988
Sent from my ONEPLUS A6013 using Tapatalk
foamerman said:
I have a few questions I'm new to the a/b partitions thing I've read the page on a/b partitions. But I'm still in the mud.
1 I'm on Verizon bootloader unlocked twrp 3.2.3-23 and magisk installed I have 9.0.11 installed twrp and magisk in slot a/b
now is it necessary to backup stock rom? If I install lets say crDroid in slot A install twrp installer I know twrp goes into both slots reboot back to recovery making sure I'm still in A install gapps and magisk reboot back to recovery making sure again I'm still in A slot then reboot to crDriod that should work yes?
Click to expand...
Click to collapse
I'm new to A/B as well but have been flashing quite a bit. Maybe someone can correct me if I'm wrong. From what I've observed, ROMs are designed to flash to the slot you're not using and, on reboot, switch slots. TWRP zip installer is designed to install to both slots. Magisk and Gapps, however, install to the current slot. This means you should flash the ROM (which flashes to the non-active system and boot partitions and possibly others), flash the TWRP installer (which installs to both boot partitions, including the one that was just flashed). Then reboot back into recovery (which will be the other slot that the ROM was installed to), and then install all the other zips needed (i.e., Gapps, Magisk, etc...).
Switching A/B partitions in the TWRP reboot menu also triggers the partition switch after reboot, if needed. It doesn't seem to immediately switch before a reboot however, even though it gives that impression.
foamerman said:
2 Now If I wanted to go back to my stock rom witch is in B slot can I not reboot back to twrp and switch to slot B and go to stock?
Click to expand...
Click to collapse
The data partition, which contains user apps and system and user app data, is not slotted. Moving back and forth between slots that share a common ROM type and are close in version might not pose a problem. But A/B slotting wasn't designed for switching Roms back and forth. It was designed to try to ensure that there is always a valid bootable ROM without regard to use data (i.e., potentially, after a factory-reset). Don't expect to boot up an AOSP modded ROM using the data and apps from an OygenOS ROM. Do a backup of all partitions to be safe (with the exception of system and vendor since system_image and vendor_image give a bit-for-bit copy, instead of file-for-file copy). Copy the TWRP directory to a computer afterward, if possible. Make sure to wipe data if flashing a ROM of a different type, not just a different version (after flashing everything but before initial system boot).
phillymade said:
Making a back up is always recommend, but it's up to the user to decide if the want to or not. The down side is loosing all your data, so there is that.
The short answer to your 2nd question is no you can not dual boot ROMs on this device. I posed the same question in a different thread and you can read the explanation from Dark Nightmare here.
https://forum.xda-developers.com/showpost.php?p=78375631&postcount=988
Sent from my ONEPLUS A6013 using Tapatalk
Click to expand...
Click to collapse
Nsane457 said:
I'm new to A/B as well but have been flashing quite a bit. Maybe someone can correct me if I'm wrong. From what I've observed, ROMs are designed to flash to the slot you're not using and, on reboot, switch slots. TWRP zip installer is designed to install to both slots. Magisk and Gapps, however, install to the current slot. This means you should flash the ROM (which flashes to the non-active system and boot partitions and possibly others), flash the TWRP installer (which installs to both boot partitions, including the one that was just flashed). Then reboot back into recovery (which will be the other slot that the ROM was installed to), and then install all the other zips needed (i.e., Gapps, Magisk, etc...).
Switching A/B partitions in the TWRP reboot menu also triggers the partition switch after reboot, if needed. It doesn't seem to immediately switch before a reboot however, even though it gives that impression.
The data partition, which contains user apps and system and user app data, is not slotted. Moving back and forth between slots that share a common ROM type and are close in version might not pose a problem. But A/B slotting wasn't designed for switching Roms back and forth. It was designed to try to ensure that there is always a valid bootable ROM without regard to use data (i.e., potentially, after a factory-reset). Don't expect to boot up an AOSP modded ROM using the data and apps from an OygenOS ROM. Do a backup of all partitions to be safe (with the exception of system and vendor since system_image and vendor_image give a bit-for-bit copy, instead of file-for-file copy). Copy the TWRP directory to a computer afterward, if possible. Make sure to wipe data if flashing a ROM of a different type, not just a different version (after flashing everything but before initial system boot).
Click to expand...
Click to collapse
OK I understand what you both are saying my understanding is that data is still there in both slots yes? so If I want to go back to my 9.0.11 stock rom I should be able to just reboot to twrp and select slot B and go back to to stock yes? guys I'm sorry this is my first A/B partition phone I'm just trying to figure it out
foamerman said:
OK I understand what you both are saying my understanding is that data is still there in both slots yes?
Click to expand...
Click to collapse
As long as it isn't wiped, yes.
foamerman said:
so If I want to go back to my 9.0.11 stock rom I should be able to just reboot to twrp and select slot B and go back to to stock yes? guys I'm sorry this is my first A/B partition phone I'm just trying to figure it out
Click to expand...
Click to collapse
No. Except for the possible exception that both slots contain different versions of the same ROM, the data will work with one ROM but not the other.
When flashing a ROM in TWRP, just mke sure to make a nandroid backup first and follow the installation directions. If you have to switch back, you will need to flash the nandroid backup.
It is a pain and there are pitfalls. This phone is relatively new and this is the cost of flashing a custom ROM/bootloader.
No. Except for the possible exception that both slots contain different versions of the same ROM, the data will work with one ROM but not the other.
When flashing a ROM in TWRP, just mke sure to make a nandroid backup first and follow the installation directions. If you have to switch back, you will need to flash the nandroid backup.
It is a pain and there are pitfalls. This phone is relatively new and this is the cost of flashing a custom ROM/bootloader.[/QUOTE]
OK one more I think lol If I have 9.0.11 on my internal storage can I not go into slot A and wipe it and install it back on there and be OK?
foamerman said:
OK one more I think lol If I have 9.0.11 on my internal storage can I not go into slot A and wipe it and install it back on there and be OK?
Click to expand...
Click to collapse
Internal storage is an encrypted folder in the data partition that is wiped separately from data. As long as you don't wipe internal storage for any reason it should be ok, in theory. But it's not in practice.
Most of the problem with this phone is maintaining encryption back and forth between ROMs. Honestly, if you can't afford to lose data, don't try to flash ROM's yet. I have had very little luck flashing back and forth and, after reflashing data, being able to avoid a bootloop. TWRP has only supported encryption on this phone for a month or so and IMHO it's not ready for prime time. I have relied on Titanium Backup and moved it's backup folder back and forth between my phone and computer.
Nsane457 said:
Internal storage is an encrypted folder in the data partition that is wiped separately from data. As long as you don't wipe internal storage for any reason it should be ok, in theory. But it's not in practice.
Most of the problem with this phone is maintaining encryption back and forth between ROMs. Honestly, if you can't afford to lose data, don't try to flash ROM's yet. I have had very little luck flashing back and forth and, after reflashing data, being able to avoid a bootloop. TWRP has only supported encryption on this phone for a month or so and IMHO it's not ready for prime time. I have relied on Titanium Backup and moved it's backup folder back and forth between my phone and computer.
Click to expand...
Click to collapse
Well the mud is starting to clear up a little. Yea I've been a little leery about trying to install roms yet. I have read all the post in the Recovery thread mauronofrio is getting a 6t soon so maybe he can figure it out. But again Thank you.

Any Pie Roms Without Loosing Internal Data

Hello Guys,
After flashing few pie roms and few GSI I faced really big trouble. When we flash rom we must install erecovery and factory format data. After doing this we loose everything on our internal memory. And this is very headaches. :silly:
So I search many times " How to flash pie roms without wiping internal storage" Finally I figure out a method. Some times you know about this, Some times you don't know about this. Pls let me guide.
• I do not responsible for bricked devices, dead SD cards
We call this "Universal DM-Verity, ForceEncrypt, Disk Quota Disablers"
Link here - https://forum.xda-developers.com/android/software/universal-dm-verity-forceencrypt-t3817389/amp/
Introduction....
• If you're currently encrypted: BACKUP YOUR INTERNAL STORAGE TO YOUR PC.
1- Download zip file
2- Reboot to recovery, Then format data.
3- Reboot back into recovery
4- After doing that or if you're not encrypt anymore
5- Make a backup using TWRP ( Ramdisk,Vendor)
6- Wipe required partitions(If you want)
7- Flash your rom, custom kernel (if applicable), then this zip, the magisk/supersu/other root, then Gapps
8- Most important part after flashing rom, You must factory reset using twrp. (TWRP -> Wipe -> slide Left to Right)
• This zip should be flashed after anything that modifies your boot img (like a custom kernel) but before magisk/supersu since this zip creates the files that tells magisk/supersu to not encrypt.
Congratulations now you don't need bootloader for flash roms... :laugh: Feel Free
Credits - @Zackptg5

"Data partition is encrypted" even after formatting data

I've just moved from MIUI 11 to custom Q roms recently and I faced the "Data partition is encrypted" error when I open recovery. I read that I should format the data partition and reboot recovery but I tried and after rom starts, I opened recovery and the error appeared again.
I tried:
Formatting data before installing new rom
Formatting data after installing new rom
Try another Q rom
But nothing changed.
I'm using OrangeFox recovery.
Any suggestions? Thanks in advance
ashvsmay00 said:
....Any suggestions? Thanks in advance
Click to expand...
Click to collapse
Most lavender ROMs will encrypt automatically an unencrypted device when booting up for the first time. This is for a very good reason - without encryption, some things (PIN/password, fingerprint) will not work on this device.
The only way you can prevent such automatic encryption is to format data, reboot OrangeFox, tick "Disable Forced Encryption" in the OTA settings page, and then flash the ROM. In most cases, this will be enough to prevent the ROM from encrypting the device. However, I would very strongly advise you to NOT do this (for the reasons stated above). Let the ROMs encrypt, and live happily with the encrypted device!
Good to know your solution.
I want my de vice encrypted. But what the purpose to have à encrypted phone without knowing the key pass?
We are not able to wipe cache and delvik, so we can't update the ROM version and get last security updates.
How can we encrypt the phone using a clean way?
what orangefox version you are using? and before you reply.....PLEASE UPDATE TO THE LATEST 10.1, because version 10.0.1 is obsolete at least three releases. (thats the only thing i can think of - solution for your problem)
deleted reply

Decrypting "Internal Storage" aka "/data/media/0" aka "/sdcard"

Hi
I was trying to flash xiaomi.eu (xiaomi.eu_multi_HMK20MI9T_V12.5.2.0.RFJCNXM_v12-11) custom rom to my Mi 9T device via TWRP recovery
I booted into recovery then I noticed TWRP isn't asking for a password for decryption
So dumb me ignored it and "Advance Wiped" all partitions except "Internal Memory" and flashed the rom from "USB OTG"
then problems started to appear
first the rom didn't boot and was stuck in a boot loop
so I wiped and reflashed the original "miui_DAVINCIGlobal_V12.1.4.0.RFJMIXM_e0ac13ed89_11.0" rom via TWRP from "USB OTG" to be able to back up my files and do a proper format/decrypt
but the internal storage is now still encrypted and cannot be accessed
I tried twrp decrypt command with all combinations of passwords pins pattern numbers that I used since first bought the phone but none of them worked
I know I should have backed up my files
Now I want to know how can decrypt /data/media/0 aka /sdcard aka Internal Memory and get my files
like mounting it in windows through some adb and other software and decrypting with known key combinations and passwords
or through twrp or whatever that maybe work
I really can't afford to lose my data AGAIN
yes, that wasn't my first time!!!!!
I promise if this gets right I devote the rest my life to the open-source community
excuse me for my bad English.
When flashing a custom ROM, or going back from, you HAVE to Format (not just Wipe) Data
(And you don't need to wipe System because new ROM will overwrite it anyway, and you better never wipe Persist and so)
Obviously, you must backup your photos, data, etc, before switching the ROM
Data on Internal memory is encrypted, and not by your unlock pin (unlock pin just serves to verify and read the key).
New ROM reinitializes the encryption key
Hence, AFAIK, you cannot decrypt anymore because you don't know the encryption key that was used for data on your Internal memory
Seems you have similar problem as I have
zgfg said:
When flashing a custom ROM, or going back from, you HAVE to Format (not just Wipe) Data
(And you don't need to wipe System because new ROM will overwrite it anyway, and you better never wipe Persist and so)
Obviously, you must backup your photos, data, etc, before switching the ROM
Data on Internal memory is encrypted, and not by your unlock pin (unlock pin just serves to verify and read the key).
New ROM reinitializes the encryption key
Hence, AFAIK, you cannot decrypt anymore because you don't know the encryption key that was used for data on your Internal memory
Click to expand...
Click to collapse
ok
a question
why the twrp was not asking for decryption in first place?
ehsan1326 said:
ok
a question
why the twrp was not asking for decryption in first place?
Click to expand...
Click to collapse
No idea - ask devs of your custom ROM how they implement encryption and what is the proper way to install the ROM

Categories

Resources