Help to solve a|b partitions issue! - Xiaomi Mi A1 Questions & Answers

Hi i got pixel experience installed on my Mi A1 and it comes with twrp. When i entered twrp to root i got a message saying encryption failed. Changed slot and discovered that i have android one installed on another slot. So i am confuse, i have two roms on the same device? its stuck on android one logo now!

Every time you upgrade the slot is changed, new OS is installed on the slot not in use and following installation the slot is changed, the old OS remains on the unused slot.
If I am on Android O on slot A and upgrade to Android P, the new Android P is installed on slot B and following a reboot I will be on slot B using Android P, even though I an on Android P, Android O remains on Slot A and is not used unless the upgrade fails in which case Android has a fall back working OS on slot A.
You will always have the old OS on the other slot, its an emergency fall back.

kudos1uk said:
Every time you upgrade the slot is changed, new OS is installed on the slot not in use and following installation the slot is changed, the old OS remains on the unused slot.
If I am on Android O on slot A and upgrade to Android P, the new Android P is installed on slot B and following a reboot I will be on slot B using Android P, even though I an on Android P, Android O remains on Slot A and is not used unless the upgrade fails in which case Android has a fall back working OS on slot A.
You will always have the old OS on the other slot, its an emergency fall back.
Click to expand...
Click to collapse
thx

Just for curiosity... What prevents from a dual boot system?

bodhi3 said:
Just for curiosity... What prevents from a dual boot system?
Click to expand...
Click to collapse
Shared data and other partitions. Only boot and system partitions are dual A/B. Two different systems can't share the same data partition (this is why it's needed to perform a factory reset when switching ROMs).

kudos1uk said:
Every time you upgrade the slot is changed, new OS is installed on the slot not in use and following installation the slot is changed, the old OS remains on the unused slot.
If I am on Android O on slot A and upgrade to Android P, the new Android P is installed on slot B and following a reboot I will be on slot B using Android P, even though I an on Android P, Android O remains on Slot A and is not used unless the upgrade fails in which case Android has a fall back working OS on slot A.
You will always have the old OS on the other slot, its an emergency fall back.
Click to expand...
Click to collapse
Thanks for the explanation!
A re-flash using Mi-Flash with original FW, does it it erase/overwrite the contents of both slots?
If not, how to delete the the contents of both slots?

Tiemichael said:
Thanks for the explanation!
A re-flash using Mi-Flash with original FW, does it it erase/overwrite the contents of both slots?
If not, how to delete the the contents of both slots?
Click to expand...
Click to collapse
No it won't, why do you want to erase the unused slot?
The unused slot is a failsafe should the update fail, as such it remains redundant and unused following a successful update, what is your reasoning for wanting to do this?
Although a failsafe the A/B setup is more about performing a seamless update, allowing you to use Android while the phone is updating to the unused slot, ie no more watch that "updating" message, just a simple reboot, once updated the old slot is unimportant and not worth worrying about.

Tiemichael said:
Thanks for the explanation!
A re-flash using Mi-Flash with original FW, does it it erase/overwrite the contents of both slots?
If not, how to delete the the contents of both slots?
Click to expand...
Click to collapse
Mi Flash script will overwrite both slots with the same FW version and set slot A as active. Check the content of flash_all_lock.bat file to see what is being flashed and how. You can remove lock command from the script to keep bootloader unlocked.
OTA update reflashes only the inactive slot.

@kudos1uk, @_mysiak_:
Thanks for your reply!
Background of my question is this: Somehow I might have screwed up the slot assignment ...
Before I installed Magisk, I used 'fastboot set_active a', and I see Magisk is using slot A. But maybe my OTA upgrade before went to slot B , which could explain why the OTA-upgrade became obsolete/invisible/...

Sorry, I was not aware the Mi Flash script overwrites both slots.
Either way it's certainly the right advice to start over.

fabiofloyd said:
Hi i got pixel experience installed on my Mi A1 and it comes with twrp. When i entered twrp to root i got a message saying encryption failed. Changed slot and discovered that i have android one installed on another slot. So i am confuse, i have two roms on the same device? its stuck on android one logo now!
Click to expand...
Click to collapse
can i get the script for repartition of Mi A1 ROM?? I'm unable to find it anywhere

Related

[Discussion] DualBootPatcher

I created this thread in order to get some discussion going with the possibility to use DualBootPatcher for our Device. The device is supported and so far i got roms to patch but no luck to get it booting.
I hope we can share some information here to get us some dual booting.
Device must be rooted and decrypted for starters.
Got now rr as primary rom and will try later on to flash some roms on the second space... Let you know if that works out.
Tried to dual RR and liquid rom ..No luck. Just reboots to twrp..
Skickat från min ONEPLUS A5010 via Tapatalk
superior8888 said:
Tried to dual RR and liquid rom ..No luck. Just reboots to twrp..
Skickat från min ONEPLUS A5010 via Tapatalk
Click to expand...
Click to collapse
I have also rr as primary but second rom install ended in error 1 in twrp. Maybe you can try to reset data of second rom with the dualboot patcher zip.
It might be helpful to read the Dual Boot Patcher thread for the OP5, as there may be some important info there that is relevant for getting it to work on the 5T.
I tried rr as primary, no problem. Tried adding 2nd rom as secondary, as data slot 1, and no dice. Even tried removing assert lines in the updater script as suggested in op5 with rr as 2nd rom but that didn't work either; either booted back to twrp or booted to a black screen. If anyone makes it work please document and share your work. I'm encrypted by the way, even though you're "supposed" to be decrypted I was able to switch between primary and the non-booting rom just fine.
Anyone having any luck with this?
matteosaeed said:
Anyone having any luck with this?
Click to expand...
Click to collapse
Nope primary install goes good with a oos rom not stock. But when you try to install a second rom it gives error 1 in twrp and rom don't boot up.
That's great! Old MultiROM user here!
Ok, so I was able to successfully patch and boot into LOS and RR. LOS as primary and as slot 1 ROM, and RR as slot 2 ROM while encrypted. This wouldn't allow me to access any files in the phone via file managers for either slot ROMs, only in primary, so you must be decrypted if you're wanting to use/see the data in your internal memory on secondary ROMs. By the way I was only able to boot Nougat ROMs, dualpatcher doesn't work for Oreo ROMs yet. I'll do a small write up tomorrow, it's 1 am here ?
superior888 said:
I created this thread in order to get some discussion going with the possibility to use DualBootPatcher for our Device. The device is supported and so far i got roms to patch but no luck to get it booting.
I hope we can share some information here to get us some dual booting.
Device must be rooted and decrypted for starters.
Click to expand...
Click to collapse
Here is what I did:
IF YOU DON'T KNOW HOW TO DECRYPT, BACK UP YOUR STUFF, FLASH, ROOT, ETC, STOP READING NOW, THIS IS SOME HEAVY STUFF GETTING READY TO HAPPEN ?
If you want functional internal storage and have access to it on all secondary ROMs you must be decrypted. This guide assumes you have all required files on phone and/or computer
1. Flash bluspark recovery (wouldn't work on codeworkx for me)
2. Back up all your data, including internal storage somewhere safe
3. Wipe system, cache, and data (not internal)
4. Coming from Phoenix, so I flashed the Nougat firmware and then LOS 14.1 and booted it
5. Flash magisk 14.0, then install dualbootpatcher app
6. After granting root permission to dualbootpatcher go ahead and go to ROMs and set kernel now
7. Now you must patch another Nougat ROM as data-slot, ID 1 or 2 or 3, whatever you want. You can use the same LOS 14.1 as a test, or the RR Nougat version
8. Transfer the patched ROM to your PC or laptop and without unzipping/extracting the zip go to META-INF/com/google/android and open updater-script with notepad++. Delete the first two lines that's start with the word "assert" and save
9. It should now ask you if you want to update the zip, hit yes. Then transfer the updated patched ROM back to your phone
(you can do this from your phone too using winrar and your favorite file manager; it s a tad easier on your computer as you don't have to extract anything)
10. Now reboot into recovery and flash the patched ROM (do not flash from within the app)
11. Now flash the dualboot utilities in recovery and it should take you to an Aroma menu where you can see both primary and and data slot ROM. Tap the data slot ROM and choose "switch to". If you did everything right it should say "succeeded" and now you can reboot your phone and should boot into the secondary ROM.
12. To root data slot ROMs you must patch the magisk zip for that data slot ROM and then flash it in recovery, the same goes for gapps. Make sure whatever you patch does not have the "assert" lines in the updater script after patching it, else you must delete these lines.
Try it and report back. I can hardly debug my own device so I can't provide much support for you. The above is what I did while encrypted, so again, if you want functional internal storage for the additional ROMs must be decrypted before you try this.
cubandanger05 said:
Ok, so I was able to successfully patch and boot into LOS and RR. LOS as primary and as slot 1 ROM, and RR as slot 2 ROM while encrypted. This wouldn't allow me to access any files in the phone via file managers for either slot ROMs, only in primary, so you must be decrypted if you're wanting to use/see the data in your internal memory on secondary ROMs. By the way I was only able to boot Nougat ROMs, dualpatcher doesn't work for Oreo ROMs yet. I'll do a small write up tomorrow, it's 1 am here ?
Click to expand...
Click to collapse
Thanks for updating us, I'm an old multirom user as well and I'm going to keep my eye on this.
cubandanger05 said:
Here is what I did:
IF YOU DON'T KNOW HOW TO DECRYPT, BACK UP YOUR STUFF, FLASH, ROOT, ETC, STOP READING NOW, THIS IS SOME HEAVY STUFF GETTING READY TO HAPPEN
If you want functional internal storage and have access to it on all secondary ROMs you must be decrypted. This guide assumes you have all required files on phone and/or computer
1. Flash bluspark recovery (wouldn't work on codeworkx for me)
2. Back up all your data, including internal storage somewhere safe
3. Wipe system, cache, and data (not internal)
4. Coming from Phoenix, so I flashed the Nougat firmware and then LOS 14.1 and booted it
5. Flash magisk 14.0, then install dualbootpatcher app
6. After granting root permission to dualbootpatcher go ahead and go to ROMs and set kernel now
7. Now you must patch another Nougat ROM as data-slot, ID 1 or 2 or 3, whatever you want. You can use the same LOS 14.1 as a test, or the RR Nougat version
8. Transfer the patched ROM to your PC or laptop and without unzipping/extracting the zip go to META-INF/com/google/android and open updater-script with notepad++. Delete the first two lines that's start with the word "assert" and save
9. It should now ask you if you want to update the zip, hit yes. Then transfer the updated patched ROM back to your phone
(you can do this from your phone too using winrar and your favorite file manager; it s a tad easier on your computer as you don't have to extract anything)
10. Now reboot into recovery and flash the patched ROM (do not flash from within the app)
11. Now flash the dualboot utilities in recovery and it should take you to an Aroma menu where you can see both primary and and data slot ROM. Tap the data slot ROM and choose "switch to". If you did everything right it should say "succeeded" and now you can reboot your phone and should boot into the secondary ROM.
12. To root data slot ROMs you must patch the magisk zip for that data slot ROM and then flash it in recovery, the same goes for gapps. Make sure whatever you patch does not have the "assert" lines in the updater script after patching it, else you must delete these lines.
Try it and report back. I can hardly debug my own device so I can't provide much support for you. The above is what I did while encrypted, so again, if you want functional internal storage for the additional ROMs must be decrypted before you try this.
Click to expand...
Click to collapse
Thanks! I'll try this next days.
Thanks. Nothing works with Oreo as of yet i suppose :/
superior888 said:
Thanks. Nothing works with Oreo as of yet i suppose :/
Click to expand...
Click to collapse
It may be possible to have oreo as primary and flash Nougat as data slot roms. I tried with Phoenix as primary and I could boot into rr Nougat in data slot but Phoenix wouldnt boot. If someone can try rr oreo as primary and report back. I'm tempted to try with otg and see if I can install secondary roms using extsd option
*Quick update*
I was able to keep latest Phoenix oreo ROM as primary and install and boot Nougat RR as data-slot and as secondary using the latest dualbootpatcher app which may have fixed the "failed to update mbtool" error I was getting on Phoenix ROM. Also I used Magisk 14.0 for root as the latest version 16.0 kept booting back to recovery on non primary ROMs.
I'm still unable to flash Oreo ROMs as data-slot or secondary. At least we're able to keep Oreo as primary and test Nougat ROMs until dualbootpatcher app is compatible with Oreo or until some other fix is released.
Internal storage/data is still encrypted and unreadable on all non-primary ROMs; you must be decrypted prior to installing additional ROMs to have access to it, which I haven't tested yet.
See screenshots
Thanks for keeping up with this. I'm really interested but traveling without my PC so don't want to get stuck without a backup plan. Hopefully it's sorted by the time I get back home or I'll help test some more too.
es0tericcha0s said:
Thanks for keeping up with this. I'm really interested but traveling without my PC so don't want to get stuck without a backup plan. Hopefully it's sorted by the time I get back home or I'll help test some more too.
Click to expand...
Click to collapse
It's been relatively "safe" all the testing that I've done, not many scares, but you can never be too careful.
Edit: Now that it's working almost as intended we should make an official "how to" thread
cubandanger05 said:
It's been relatively "safe" all the testing that I've done, not many scares, but you can never be too careful.
Click to expand...
Click to collapse
If I wasn't out of the country, it'd probably be different. I've customized 100s of phones, 1000s of times but sometimes it's better safe than sorry. I'm great at fixing stuff because I've broken about everything I can (sometimes on purpose, sometimes not lol) but I need navigation and translation more than another custom rom I suppose.
es0tericcha0s said:
If I wasn't out of the country, it'd probably be different. I've customized 100s of phones, 1000s of times but sometimes it's better safe than sorry. I'm great at fixing stuff because I've broken about everything I can (sometimes on purpose, sometimes not lol) but I need navigation and translation more than another custom rom I suppose.
Click to expand...
Click to collapse
? understandable

How do I know which system partition slot is booting?

I am aware that Mi A1 uses A/B partition for seamless updates like pixel. I would like to know if there is a way of determining which partition the phone is booting from or what is the current active partition. Is there a terminal command for that or better, an app in determining which slot I am on? I read somewhere that you can change current partition slot in TWRP but is there any way to know the active slot without TWRP? My phone is rooted, running stock 8.1.0 with july update. Thanks
rexendz said:
I am aware that Mi A1 uses A/B partition for seamless updates like pixel. I would like to know if there is a way of determining which partition the phone is booting from or what is the current active partition. Is there a terminal command for that or better, an app in determining which slot I am on? I read somewhere that you can change current partition slot in TWRP but is there any way to know the active slot without TWRP? My phone is rooted, running stock 8.1.0 with july update. Thanks
Click to expand...
Click to collapse
Yes we can. There might be a way to know it phone booted but I don't know it
All I know is the fastboot command
fastboot getvar all
You'll see on which partition you are and which one is damaged

[ROOT] Slot A not booting but B yes

Don't know if this is the correct thread category but as title I can't boot with slot A.
I'm using OOS 9.0.17 with unlocked bootloader and Magisk. After messing up with the partitions, I've restored the phone using MSMDownloadTool. Now I've noticed that slot A is not booting, but B is booting. I've tried copying the symlink of slot B to slot A without any chance.
Any advice?
Thanks
dreamwhite said:
Don't know if this is the correct thread category but as title I can't boot with slot A.
I'm using OOS 9.0.17 with unlocked bootloader and Magisk. After messing up with the partitions, I've restored the phone using MSMDownloadTool. Now I've noticed that slot A is not booting, but B is booting. I've tried copying the symlink of slot B to slot A without any chance.
Any advice?
Thanks
Click to expand...
Click to collapse
This is a question and should be in Question and Answer section
Fastboot the whole rom in slot a. Simlinks won't have a chance to work. And why do you need this slot booting? On next update OOS will be fleshed on slot a if you are running on slot b for now. That's the point of A/B phones.
Don't mess with partitions I don't see a single reason to do that.
Striatum_bdr said:
This is a question and should be in Question and Answer section
Fastboot the whole rom in slot a. Simlinks won't have a chance to work. And why do you need this slot booting? On next update OOS will be fleshed on slot a if you are running on slot b for now. That's the point of A/B phones.
Don't mess with partitions I don't see a single reason to do that.
Click to expand...
Click to collapse
Yeah I know but if I break the build.prop of slot A, I can't boot it and I need B
dreamwhite said:
Yeah I know but if I break the build.prop of slot A, I can't boot it and I need B
Click to expand...
Click to collapse
Don't mess with build.prop that's the second rule after don't mess with partitions. If you break both of them not surprising you have issues. A/B slots phones are very tricky and easily upset. Every time I saw people having issues in this forum it was because of unconventional use of recovery, slots etc ..
Well but the strange issue is that if I edit the build.prop in system_b and I choose slot_a it doesn't boot
dreamwhite said:
Well but the strange issue is that if I edit the build.prop in system_b and I choose slot_a it doesn't boot
Click to expand...
Click to collapse
Why would you do this?
Assuming the edited build.prop, hence the os, is on slot b, boot slot b. It should boot unless your tweaks to the build.prop broke something.
Well, I have modded Android until Cyanogenmod 14. And I remember that there were some tweaks in build.prop which I wanted to apply on Op6T :laugh:
Rules to remember for me:
- don't mess up with A/B
- don't edit build.prop
I have messed with both of that (boot slot partitions and build.prop), and I kind of agree, however I rarely have problems as the keyword is experience. I learned quickly what not to do on dual-boot setup, on the Google Pixel, as the Slot B was bricked for a while until I figured out how to fix it, now both boot slots are functional. (And yes, I still have the still-functioning Google Pixel, too bad development activities over there on XDA have actually died down.)
It's wise not to mess with it unless you really know what you are doing, like me. And always back up. Back up. Back up. I mean, everything can go wrong, even on the traditional Slot A only phones (apparently due to the UEFI bootloaders' touchy nature, even the personal computer owners would be familiar with the UEFI bootloader boot failure).
Sent from my ONEPLUS A6013 using Tapatalk
what system are you on 9 or 10 are you rooted some twrps dont work right on older systems get the ota flash in settings then do twrp a/b retention then install magisk directly then do ota it will boot to other system dont forget to turn off all magisk mods first

Question Need help with broken slot and verity mode issue

Hello guys.
I need some help and advice with a broken slot and verity mode issue. A/B partitions and AVB are somewhat new to me, so please excuse my ignorance.
I have previously unlocked and rooted my phone without problems, and have been using it for a month. Two days ago, I wanted to start over and flashed the 1.1.7 Global ROM from https://reindex-ot.github.io/ as I have used this package twice before with no errors.
First, I did a wipe but forgot to unroot Slot B (my big mistake) and since it was on the current 1.1.7 OS, I switched slots and flashed the files to Slot A and rebooted directly (fastboot boot) with a patched boot image. After this point, I am no longer sure which slot I was on, as I assumed I would be on Slot A. I don't know if Slot A was already damaged, and I was actually booted into Slot B.
After a successful boot, I installed Magisk, but the restart dialog came up and I accidentally clicked without patching the original boot image. I did another direct boot with a patched boot image, and then patched the supposedly untouched boot image directly and installed it, then rebooted to the OS successfully.
Next, I went to fastboot to check "getvar all" but here's where two errors came up. FIrst, I realized my verity mode was now set to "false", whereas it was always "true" during two other root attempts in the past month. Second, I realized I was in Slot B instead of the one I previously switched to.
I tried to switch back to Slot A, but it boots for a few seconds, fails, then falls back to Slot B. I then tried twice to flash all the usual partitions back to both slots and try them again, and Slot A consistently fails. It is my belief I may have patched a previously rooted boot image in Slot B, and somehow, verity was messed up during that step. At one point, Slot B also failed and I was dumped back to the bootloader. Now, I have one failed slot and verity mode off, so I need some help or advice.
Is there anyway I can re-enable verity, and are there any special partitions I need to flash to get Slot A working?
I previously made a backup of all smaller partitions (eg "modem" "persist" etc) except the "super" and "userdata" partitions with Wanam's partition backup tool. I believe this backup was made directly after I unlocked while on Slot A with 1.1.7 ROM after an OTA update, whereas Slot B at that time would be on 1.1.6 ROM. I think this is true because the sizes of some compressed images (the "abl" "align to 128k" and "boot") differs slightly for each slot's backup.
Will manually flashing the backups to both slots fix anything? Can I revert back to that point in time just after unlock? I am hesitant to do so because I no longer trust my backups in case flashing them qualifies as a "downgrade" (in the case of Slot B using 1.1.6 ROM). Or will manually flashing the backups for Slot A (the 1.1.7 ROM backup) to both slots ensure they are both considered "identical" to the current bootloader and not cause it to trip?
If this is not possible, will flashing a third party ROM to both slots before flashing NothingOS again help, especially if one slot has gone bad? I realize some third party ROMS first require both slots to have the current 1.1.7 ROM before flashing any third party software. I saw someone mention using RiceDroid to "downgrade" from his NothingOS 1.5 beta back to 1.1.7, but I am unsure if this works. I don't particularly mind not using NothingOS and can live with a third party ROM permanently, but I need to fix the damaged slot and maybe get verity back. I assume verity is useless in a systemless root setup with an unlocked bootloader (true or false?) but I wish to get everything back like it was before.
I apologize if my post is too lengthy, I have never posted to forums before, but I wish to be as accurate in describing my issue. Please advise if you can and thank you for any assistance.
Not an expert but I don't think you can make both slots work at the same time. One is for your rom, the other for OTA update. It doesn't matter on wich you are, when you flash, it flashes the other one on wich you are, if I was you, I would have flashed Rice (because of twrp recovery in case something is wrong) two times in a row to make sure your partitions are okay on both slots, then use your reindex link to flash 1.1.7 on one of them if you really want to go back on NOS

[pixel 6 Android 13] - Slot B corrupted, slot B look like to have android 12

Hi, guys how are you, my phone is root with magisk on Android 13 from august security update.
When i try to make OTA update using magisk my update research tell me, your phone will updated to Android 13, but my phone il allready on Android 13.
When i update and reboot using Magisk OTA reboot option my phone boot on a slot B and said my phone was corrupted press power buttom to continue.
I get a boot loop. when i switch to my Slot A everything is ok and my phone work perfectly on Android 13.
So what i think is my slot B is on Android 12 and my slot A on Android 13.
So my question is can i copy my slot A to the slot B without lost anydata or reinstall latest android 13 on the slot B without wipe everything?
Thank Guys

Categories

Resources