Flashing & slot A/B - ASUS ZenFone 6 (2019) Questions & Answers

Hi all,
now, I started modifying the phone and trying around with custom ROMs. And after several fails, I could indeed install one ROM properly, but I have to admit that I am puzzled about how this slot management works.
Can someone please explain me how this works? Considering, I am running a custom rom, unlocked bootloader (of course), I would like to install a new ROM, don't care about data/apps/etc. Just tell me what I should do, please.
Thanks,
abprie
PS: I thought, wiping and flashing ROM and TWRP would suffice, but it does somehow not (I am always ending up in the bootloader).

This is quite a common thread, there are many sources available to search. There's even an explaining thread here: https://forum.xda-developers.com/ze...uide-how-to-root-asus-zenfone-6-twrp-t3940168 . If it's still not enough for you, search for "A/B partitions flashing" or "how does A/B slot works".

aleksander002 said:
This is quite a common thread, there are many sources available to search. There's even an explaining thread here: https://forum.xda-developers.com/ze...uide-how-to-root-asus-zenfone-6-twrp-t3940168 . If it's still not enough for you, search for "A/B partitions flashing" or "how does A/B slot works".
Click to expand...
Click to collapse
OK, thanks for the link. I understand now why this was introduced, but not how to use twrp with this.
Considering, I am booting into recovery and see slot A to be active. If I wipe anything, does this affect slot A or B? Same for install, backup or recover. Also: will the next boot be slot B?

It depends on what you wipe. /data is independent but /vendor, /system and /boot partitions will be wiped on the active slot. Backup will work on data+currently active slot. Recovery too. Installation is not so easy. Every zip that isn't a ROM will be flashed on the active slot. If it is a ROM, it will be flashed on inactive one and after a reboot the phone will switch currently active slot. That's why you have to reboot the phone after flashing if you want to add any mods to the device, otherwise they'll flash on inactive one and won't work.

aleksander002 said:
It depends on what you wipe. /data is independent but /vendor, /system and /boot partitions will be wiped on the active slot. Backup will work on data+currently active slot. Recovery too. Installation is not so easy. Every zip that isn't a ROM will be flashed on the active slot. If it is a ROM, it will be flashed on inactive one and after a reboot the phone will switch currently active slot. That's why you have to reboot the phone after flashing if you want to add any mods to the device, otherwise they'll flash on inactive one and won't work.
Click to expand...
Click to collapse
Thank a lot, this helps!

Related

[Questions]-Recovery Included in ROM and Slots

Hey all,
1. Now that recovery is included in the ROM can TWRP be included in custom ROMs to save reflashing it separately?
2. Also what causes ROMs to be flashed to the inactive slot? Does anything flashed via TWRP go to the inactive slot or does it only count for full ROMs?
3. How does app and app data work with the slots? I take it that it is shared between both slots?
Can any developers answer these questions please?
Thanks very much
greetings
I also have the same question, Iam coming from regular ONE partition phone so, the new idea of 2 slots and no recovery and no cache is hard to understand (at least for me)
Looks like some experimentation is in order to answer these questions.
twrp must be included in oem rom !!
Shame on Oneplus and in Google !!

Many questions on the A/B slots Which caused a fastboot bootloop

Man,i hate that oneplus did this with the A/B slots..
Had successfully unlocked the bootloader,installed twrp and had tryed the few roms that are out for the oneplus 6..with no problems..
Then,i thought i'd make a backup of my data from my oneplus 3T and restore that to my oneplus 6 (Big mistake)
At first it would bootloop back into twrp,so i did a system and data wipe,and tryed flashing a rom.before flashing i checked to see which slot i was in,and it would say "A"
But after flashing the rom and twrp,and booting back into twrp,it says slot "B" was active and no OS was on slot "B".I tryed flashing the rom to both "A" and "B" slot,then it just bootlooped back into fastboot mode..Thanks to whoever uploaded that unbrick tool,so now i'm back to stock,with a locked bootloader.I really don't understand this A/B slot thing and how it works..
1)Does the stock OS reside in one of the slots all the time?Or when you flash a rom,does it install to both the slots?
2)Do you have to always make sure you only flash to one certain slot?
3)When you do a system and data wipe,does it also wipe the vendor.img on both slots?
Any help would be greatly appreciated..Thanks
Wäre auch für mich interessant.
saleappeal said:
Wäre auch für mich interessant.
Click to expand...
Click to collapse
English only noob.
bobbylo said:
Man,i hate that oneplus did this with the A/B slots..
Had successfully unlocked the bootloader,installed twrp and had tryed the few roms that are out for the oneplus 6..with no problems..
Then,i thought i'd make a backup of my data from my oneplus 3T and restore that to my oneplus 6 (Big mistake)
At first it would bootloop back into twrp,so i did a system and data wipe,and tryed flashing a rom.before flashing i checked to see which slot i was in,and it would say "A"
But after flashing the rom and twrp,and booting back into twrp,it says slot "B" was active and no OS was on slot "B".I tryed flashing the rom to both "A" and "B" slot,then it just bootlooped back into fastboot mode..Thanks to whoever uploaded that unbrick tool,so now i'm back to stock,with a locked bootloader.I really don't understand this A/B slot thing and how it works..
1)Does the stock OS reside in one of the slots all the time?Or when you flash a rom,does it install to both the slots?
2)Do you have to always make sure you only flash to one certain slot?
3)When you do a system and data wipe,does it also wipe the vendor.img on both slots?
Any help would be greatly appreciated..Thanks
Click to expand...
Click to collapse
Ok let me answer your three questions here.
1. The rom resides on both partitions. The whole point of A/B partitions is seamless updates. It let you use your phone on one slot while the update downloads and updates on the other slot. Then after the update when you restart the phone it boots up the other slot (the one that updated) and you are running the updated software. It also checks the update and if taking the update causes a bootloop it reloads the old slot so you don't end up bricked from a bad OTA update.
2. When flashing a new custom rom meant for this device, it should flash it to both slots.
3. Vendor partition is separate now (thank you project treble) from system and data. Wiping system and data should never affect the vendor partition.
Any other questions please feel free to ask. I would rather answer questions this way than dealing with a panicking person who bricked their phone and can't unbrick it.
tabletalker7 said:
Ok let me answer your three questions here.
1. The rom resides on both partitions. The whole point of A/B partitions is seamless updates. It let you use your phone on one slot while the update downloads and updates on the other slot. Then after the update when you restart the phone it boots up the other slot (the one that updated) and you are running the updated software. It also checks the update and if taking the update causes a bootloop it reloads the old slot so you don't end up bricked from a bad OTA update.
2. When flashing a new custom rom meant for this device, it should flash it to both slots.
3. Vendor partition is separate now (thank you project treble) from system and data. Wiping system and data should never affect the vendor partition.
Any other questions please feel free to ask. I would rather answer questions this way than dealing with a panicking person who bricked their phone and can't unbrick it.
Click to expand...
Click to collapse
I’m sorry i don’t want to hijack this thread but i want to make a Nandroid backup in TWRP and saw an option to choose from slot A or B.. my question is: Is there any difference between those two or does it matter what slot you are backing up in? Edit: i looked on google and could't find any information about this.
jdorp18 said:
I’m sorry i don’t want to hijack this thread but i want to make a Nandroid backup in TWRP and saw an option to choose from slot A or B.. my question is: Is there any difference between those two or does it matter what slot you are backing up in? Edit: i looked on google and could't find any information about this.
Click to expand...
Click to collapse
It doesn't matter what slot you are on you will be making the backup of the current slot by default, and that is exactly what you want
Everything you need to know is here:
https://forum.xda-developers.com/oneplus-6/how-to/guide-noobs-guide-to-b-partitions-op6-t3816123
In most cases you should not worry which slot you're on, just let the system take care of that. On some custom roms, it matters, and in those cases carefully follow the installation instructions.
Thanks guys, this answers my question. (Edit: I've just read the Generic Noob Advice. i don't think i can delete this comment.)

Partitions

Hello everyone,
I don't know much about partitions but I know something is not right with mine
So, A few days ago my phone got bricked because I flashed crDroid rom. (I did something wrong)
So, after a lot of research, I found an solution to unbrick my phone. So it worked, I booted into software again and I was free to use.
So later, I decided to install an custom rom again (Havoc OS). I installed the rom but after I clean flashed the rom, I got stuck on booting logo.
So, I thought lets see what partition B does. So I booted into partition B and I got stuck on the logo of TWRP. Not sure why.
I really wanna know why this happend and how to fix my device.
(Btw, now my phone is working again and I am on stock os with rooted using Magisk 16,7.)
But just wanna know what I did wrong
I used the instruction in this thread: https://forum.xda-developers.com/oneplus-6/development/enchilada-romcrdroid-t3827070. And after I did that it got bricked.
I hope anyone knows what happend and how to fix my partition!
Friendly regards,
Crewz
Hi, why you get stuck and what not is because you simply do not follow the instructions 100%
After rom install and twrp install did you reboot? When you reboot at that point it will change partition.
If you get stuck on boot again, try reflash rom (without wipes), flash twrp, reboot to recovery, flash gapps and start the device. Apply root after setup this time just to be sure. Another thing could also be magisk, some roms require a later magisk version. But like I said, root after setup just to be sure where the issue is . Happy flashing mate!
whizeguy said:
Hi, why you get stuck and what not is because you simply do not follow the instructions 100%
After rom install and twrp install did you reboot? When you reboot at that point it will change partition.
If you get stuck on boot again, try reflash rom (without wipes), flash twrp, reboot to recovery, flash gapps and start the device. Apply root after setup this time just to be sure. Another thing could also be magisk, some roms require a later magisk version. But like I said, root after setup just to be sure where the issue is . Happy flashing mate!
Click to expand...
Click to collapse
I did the exact steps as in the thread.
ItsCrewz said:
I did the exact steps as in the thread.
Click to expand...
Click to collapse
If you're booted up and stable there's nothing wrong with your partitions.
What version of twrp are you using?
iElvis said:
If you're booted up and stable there's nothing wrong with your partitions.
What version of twrp are you using?
Click to expand...
Click to collapse
The newest one.
Look when I boot into TWRP and switch to partition B. I am stuck at logo of twrp
ItsCrewz said:
The newest one.
Look when I boot into TWRP and switch to partition B. I am stuck at logo of twrp
Click to expand...
Click to collapse
Which version? There are multiple "newest" ones.
Just because you have two slots doesn't mean both are bootable. The intent of the A/B arrangement is to allow seamless updates, not create a dual-boot phone. The inactive slot is often not bootable or will boot up with things broken. It's inactive because it's not suppose to be booted.
Switching slots manually is rarely necessary anyway. Why do you need to do it?
iElvis said:
Which version? There are multiple "newest" ones.
Just because you have two slots doesn't mean both are bootable. The intent of the A/B arrangement is to allow seamless updates, not create a dual-boot phone. The inactive slot is often not bootable or will boot up with things broken. It's inactive because it's not suppose to be booted.
Switching slots manually is rarely necessary anyway. Why do you need to do it?
Click to expand...
Click to collapse
Yes I know what it means. But it isn't normal that it boots into twrp and get stuck on the logo

Thread for problems in flashing custom Android 9 ROMs in OP6

Hello,
I am gathering information here for people having problems with flashing Android 9 ROMs to their Oneplus 6 phones. I am among them. I've browsed through a big bunch of threads and still can't get to a working custom ROM OS.
I've noticed that there are very differing instructions on this forum on how to do the flashing properly. Here are some:
https://forum.xda-developers.com/showpost.php?p=77987633&postcount=2370
https://forum.xda-developers.com/showpost.php?p=77114327&postcount=127
https://forum.xda-developers.com/showpost.php?p=78021561&postcount=2404
Part of the problems seem to be because in older threads, guides and videos people flash older ROM versions, older Magisk etc. that might contribute to different results.
To give a context, I'll start with my own story.
Status before my attempt
Phone model ONEPLUS A6003 = the EU/US model (not A6000 if that makes any difference)
Phone unlocked already (fastboot oem unlock reports: "Device already : unlocked!" whenever I check)
The OOS I am talking about == OnePlus6Oxygen_22_OTA_014_all_1810301355_5a3cd838ad89482d.zip
The TWRP I am talking about = twrp-3.2.3-x_blu_spark_v9.86_op6.zip
The Magisk I am talking about == Magisk 17.1.
My attempt
fastboot booted to blu_spark TWRP img (TWRP SHOWS CURRENT SLOT = A)
Wiped System, Data and Dalvik / ART Cache
Flashed OOS (from Oneplus downloads) and TWRP (OOS FLASH 1/2 DONE)
Booted to OOS up to the pin code screen
Booted back to TWRP (TWRP SHOWS CURRENT SLOT = B)
Wiped System, Data and Dalvik / ART Cache
Flashed OOS (from Oneplus downloads) and (OOS FLASH 2/2 DONE)
Booted to OOS up to the pin code screen
Booted back to TWRP (TWRP SHOWS CURRENT SLOT = A)
I am pretty certain that up to this point everything is done properly: we have a booting OOS on both A and B system partitions and also the A/B boot partitions contain TWRP.
Where it all goes wrong
This is where the instructions diverge. Some say that:
I should now wipe System, Data and Dalvik / ART Cache
I should just do a factory reset wipe without wiping System
After doing either of these steps all the guides agree on me having to flash the ROM and TWRP to the current slot.
So, after this step, if we forget about Gapps, Magisk etc. We should have a working ROM in the current slot. But when I boot to system, I am always thrown back to TWRP and can never boot any custom ROM.
Questions
I have a couple of questions I'd love to get answers to clarify and build a definitive guide for flashing:
Since the wipes (wiping System or doing just factory reset) in TWRP do not touch the Vendor partition, am I correct in assuming that the reason why OOS flashing to both slots is required because the OOS rom provides content for the Vendor partition and possibly updates radio firmware or something else?
If my previous assumption is correct, can't we assume that once we have flashed OOS in slots A/B their contents are permanently and we do not need to start EACH custom ROM flash by flashing OOS twice?
I would really appreciate clear answers to these two questions and especially hints on where my procedure goes wrong (why am I left with a phone that will always and only boot back to TWRP).
I thought it was just me. Im a new OP6 owner, but I have flashed a hundred other Android phones. The A/B thing changes the landscape a little, but nothing fundamental has really changed, and many things are a great deal easier. The guides are all over the map and often claim things like 'when flashing a Magisk Module you should clear your cache', which is crap.
electroblood said:
I thought it was just me. Im a new OP6 owner, but I have flashed a hundred other Android phones. The A/B thing changes the landscape a little, but nothing fundamental has really changed, and many things are a great deal easier. The guides are all over the map and often claim things like 'when flashing a Magisk Module you should clear your cache', which is crap.
Click to expand...
Click to collapse
Thank you, I have had the same feeling. People treat many of the steps like parts of a magic recipe where it doesn't matter if something is sensible, they just do it "because someone in some forum post told so" or "this is the way it has always been done".
Same thing here, i've flashed a lot of phones but none that had the A/B partitioning scheme. What has complicated things here is that I really wanted to find out which steps in the processes are really necessary and which ones are simply redundant.
Also, many people write their instructions in a confusing way that only causes more people to write questions and many threads turning into back-and-forth between unclear answers and confused questions. A good example is how many people write "just flash OOS twice" which has led to people flashing OOS zip two times in a row without booting and not understanding that both partitions do not get populated this way.
I managed to flash HavocOS to my OP6 today finally, and shall be updating this thread first post to reflect the situation. I hope others also contribute so that we can start pointing to this thread as the source for newbie friendly flash instructions.
What I would do here is start over. Download the MSM Download Tool (also called the unbrick tool) and open it and flash the stock rom that comes with it (5.1.11). Then take the ota update to the latest version of Pie. Then do what you've done to get oos on both slots and then flashing a custom rom should work.
I've done this a few times and it always solved any issues I had. Also if you're running a custom rom like Havoc and it's on the November security patch and you flash back to any rom in twrp that is in an older security patch your internal storage will have to be wiped or else you'll have issues and you'll never be able to restore a twrp backup or get the phone to boot.

A/B slot issue, TWRP only on one... unrooted rom on other. Can't mount from TWRP

TWRP is on slot B but not slot A. I can only reboot to system from TWRP when I've got in on Slot A so my ROM seems to be on A,
But from TWRP I can't see the storage device, it says 0MB. It won't let me mount. From what I gather, this is because it's failing to decrypt the device from TWRP? I trying resetting my pin but it didn't work.
I'm trying to figure out how to root my slot A image that doesn't seem to be rooted anymore after an update. How can I get TWRP from Slot B to see the device?
I'm a bit confused about the whole A/B images. What is the function of having two images, besides one being the backup?
Thanks for any suggestions anyone might have.
el80ne said:
I'm trying to figure out how to root my slot A image that doesn't seem to be rooted anymore after an update. How can I get TWRP from Slot B to see the device?
Click to expand...
Click to collapse
So it sounds like slot A is booting to OS (and the updated OS version)?
My suggestion would be to: on slot A, fastboot boot TWRP img, and flash TWRP installer zip again. Then (still booted TWRP) flash Magisk.
Make sure it is a recent version TWRP (latest is unofficial version -76), as it seems that some of the data partition issues are related to using old TWRP.
el80ne said:
I'm a bit confused about the whole A/B images. What is the function of having two images, besides one being the backup?
Click to expand...
Click to collapse
Yeah, the A/B partition scheme was new to me for this device as well (and lots of other folks).
The main purpose is to have what Google calls "seamless updates". Where on a stock device, it is just installing the update in the background and you can still use the phone as it updates. Then once the update is complete, just reboot, and you are on the new OS version. And yes, if something goes wrong, it still has the other (not updated) slot to fall back to. The following xda article is a good read, and explains the basic premise of A/B partitions:
https://www.xda-developers.com/how-...ess-updates-affect-custom-development-on-xda/
The A/B partitions do makes things more complicated when modifying/rooting, etc. But there is a pretty easy way to do an OTA update on this phone, and keep TWRP/root. But let's get the current situation fixed up, before I confuse you with other scenarios.

Categories

Resources