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
Related
How to find which slot is active and how to change the active slot? Im new to this a/b nougat partitions xD
You don't need to do this. A/B partitions are used for quicker updates and fallback if an update fails. If you're rooted then I don't know.
Hi all ..
I was thinking that the only difference between the 2 devices is the partitions setup .. so, if there were a script to adjust the partitions before flashing the other ROM it should work ..
Or even a script to make the device has both needed list of partitions available ( with the loss of a few extra space )
Steps for Mi A1 should be :
Unlock bootloader
Flash custom recovery
Run Repartitioning from A1 to 5X
Push 5X recovery and Bootloader
Flash 5x Official ROM
Done.
Note: I have done something similar to HTC Desire about 4 years ago and it worked fine
Would be interested in that repartition script
This article might be helpful ..
https://www.xda-developers.com/curr...o-receive-android-ns-seamless-update-feature/
Why not install Mi5x ROM on one of the two available partition instead?
jack_21 said:
Why not install Mi5x ROM on one of the two available partition instead?
Click to expand...
Click to collapse
This won't work.
Mi 5X official ROM is expecting a certain partition structure that is set for Mi 5X but not for Mi A1. For example, it is expected a "/system" and a "/recovery" partition .. but instead in Mi A1, you have 2 system partitions "/system_a" and "/system_b" .. so you can't just flash it directly .. some modification has to be done ..
First option is customizing: You get the official ROM, and adjust it to work on the A/B structure .. and vice versa, get the stock Mi A1 official ROM and edit it to work on old normal partition structure (which is already done, and is ready for 5X as we speak).
Second option, is the one am asking about above .. if we could repartition the devices itself, and use the Ready software from Xiaomi and Google without customizing ..
Yet am not sure if that is possible and doable or not, hence am asking ..
anyways, am hoping it is .. and waiting for a skilled developer to purchase the device and give it a try ..
or for Xiaomi and Google to provide a good solution ..
Peace
KhaledAbdo said:
This won't work.
Mi 5X official ROM is expecting a certain partition structure that is set for Mi 5X but not for Mi A1. For example, it is expected a "/system" and a "/recovery" partition .. but instead in Mi A1, you have 2 system partitions "/system_a" and "/system_b" .. so you can't just flash it directly .. some modification has to be done ..
First option is customizing: You get the official ROM, and adjust it to work on the A/B structure .. and vice versa, get the stock Mi A1 official ROM and edit it to work on old normal partition structure (which is already done, and is ready for 5X as we speak).
Second option, is the one am asking about above .. if we could repartition the devices itself, and use the Ready software from Xiaomi and Google without customizing ..
Yet am not sure if that is possible and doable or not, hence am asking ..
anyways, am hoping it is .. and waiting for a skilled developer to purchase the device and give it a try ..
or for Xiaomi and Google to provide a good solution ..
Peace
Click to expand...
Click to collapse
Will Mi A1 get project treble?
nilkanth.marshiwane said:
Will Mi A1 get project treble?
Click to expand...
Click to collapse
I do hope so ..
Miui on mi a1
Anyone try this
You can repartition the device easily. Just flash the factory image in EDL mode via MiFlash, it will write partition table.
But I do NOT recommend this unless:
1) You first make a FULL BACKUP of ALL partitions with EMMCDL tool. This will backup all the stuff that cannot be recovered with a factory flash (e.g. IMEI)
2) You are willing to disassemble the device to get testpoints access to get device out of diagnostic mode and into QDFlash mode if the device gets a semi-hard brick.
I know this for a fact because I manually repartitioned my device while working on Project Treble, which worked fine, but then when I messed around with GPT table some more I got a hard brick. Upon flashing A1 firmware via EDL mode once I succeeded in testpoints method, I got stock partition table back, then I restored my EMMCDL backup.
So, if anyone is daring enough and has the time, you could just try flashing 5x firmware in EDL mode. But I'm pretty sure someone already tried this and it resulted in the firm-brick I speak of.
CosmicDan said:
You can repartition the device easily. Just flash the factory image in EDL mode via MiFlash, it will write partition table.
But I do NOT recommend this unless:
1) You first make a FULL BACKUP of ALL partitions with EMMCDL tool. This will backup all the stuff that cannot be recovered with a factory flash (e.g. IMEI)
2) You are willing to disassemble the device to get testpoints access to get device out of diagnostic mode and into QDFlash mode if the device gets a semi-hard brick.
I know this for a fact because I manually repartitioned my device while working on Project Treble, which worked fine, but then when I messed around with GPT table some more I got a hard brick. Upon flashing A1 firmware via EDL mode once I succeeded in testpoints method, I got stock partition table back, then I restored my EMMCDL backup.
So, if anyone is daring enough and has the time, you could just try flashing 5x firmware in EDL mode. But I'm pretty sure someone already tried this and it resulted in the firm-brick I speak of.
Click to expand...
Click to collapse
Do you think this could work from mi 5X to mi A1?
jaozze said:
Do you think this could work from mi 5X to mi A1?
Click to expand...
Click to collapse
do you have repartition script for Mi A1? have used project treble & not getting any script to repartition it
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
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
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