Hi all, I just got an x4 A1 and I'm just a little confused about the A/B partition thing. This phone is definately different than the previous phones that I've played with. I noticed that you can switch between A and B in TWRP. So do I have to back both up separately? Is it good enough to just back up the partition you're currently on? Any insight would be appreciated.
Just backup the currently running ROM. You should not need to think about if you are in A or B partition.
The only time you need to think about it is when you install a ROM, it installs to the opposite partition. You will need to reboot recovery before installing other zips - except for TWRP (which installs to both partitions).
Edit: In the current version of TWRP, the ability to manually change partitions doesn't work, but it isn't normally needed anyway. The function is there for seemless updating while the ROM is running.
Related
My Nexus 6 was running TWRP 2.8.X.X and on CM13. I decided to flash a different ROM but first, I updated TWRP to 3.0.2.0.
When I did the "Wipe" before flashing the new ROM, TWRP apparently wiped my entire system. Now TRWP is telling me that there is no OS installed???.
I'm going to "Sideload" a ROM so that I may re-flash my phone but my question is that TWRP is telling me that my system is "Read Only". Should I first let TWRP change my system to "Read/Write" or will I be able to flash my ROM and restore my phone if I leave it "Read Only"??
I'm a little confused because TWRP never asked me before about modifying my system. It wasnt until I updated that TWRP asked me this?.
It's not bricked. I wipe my os all the time. You will need to use an otg to flash a rom and you'll be fine. Or you need to use add pull/push to get a rom into the internal storage then flash.
Changing your system to read/write should be no problem. I'm no expert but, I would imagine writing to your system partition requires writing permissions to be enabled.
I "adb sideloaded" a ROM and restored my Nexus 6 but everytime I reboot from recovery, TWRP tell me that there is no "OS installed"???. I'm not going to worry about it since everything is working. Must be a bug that happened when I updated TWRP??
you'll find your answers in the TWRP thread...
so firstly, let me make this clear, i had Android 6 stock rom working initially, i installed TWRP and rooted the phone with SU
All was working fine until i decided to try and wip the phone to test either a lineage os build or the new EMUI 5
However after performing factory reset, the /data partition is now broken.
I know i'm not the only one that has encountered this issue, but i would at least like a straight forward answer in order to resolve the problem.
Stock recovery now doesn't seem to be an option as when i send it to the phone, i reboot and TWRP still exists.
i have tried via fastboot and from within TWRP, i still get the /data partition error if trying in TWRP to flash recovery.
surely there is a proper solution for this, as this is a software issue not a hardware issue.
i would appreciate your assistance and can provide whatever required information necessary.
i did not pay $500 for this phone for it to be a useless brick
I noticed something here about modaco-rc3 recovery, which i am downloading to try, if it flashes properly, as i suspect this /data partition issue is preventing much of anything from being modified now.
i look forward to your responses and will reply to this with an update after trying to flash modaco recovery if successful
The data partition of the EMUI roms are different than what for example lineageos needs (I think because of encryption).
You need to flash the stock recovery via fastboot, then wipe and format data from there, then TWRP should be able to mount the partition again. In TWRP you can format the partition again to the format according to what is necessary for the rom you want to install.
christopherpfister said:
You need to flash the stock recovery via fastboot, then wipe and format data from there, then TWRP should be able to mount the partition again. In TWRP you can format the partition again to the format according to what is necessary for the rom you want to install.
Click to expand...
Click to collapse
I am just downloading 4.1 stock rom i found finally on Huawei website after much buggering around last night, clearly it was a long day.
Will get this flashed with the stock recovery that I was able to put back on thanks to SRKTool
Will update again shortly, thank you for the reply.
failed to mount system for rom install
now this is just getting silly...
so i was able to restore stock rom with the dload folder procedure and EMUI recovery restored with SRKTool
successfully then unlocked bootloader, put on twrp-3.0.2-0-eva-modaco-rc3, did the data wipes and tried to install lineage os zip.
(the original problem of going back to stock rom is solved, but this is still ongoing as to now why a custom rom will not load)
now i get the infamous ERROR: 7
after
could not detect filesystem for /dev/block/bootdevice/by-name/system, assuming ext4
mount: failed to mount /dev/block/bootdevice/by-name/system at system: no such file or directory
....this is all seeming far too difficult to install any custom rom on this unit, what is happening?
same issue
I'm having a similar issue, any updates?
Rooting this moto x4 is a whole new learning curve. I've noticed that this is the only phone that doesn't let twrp recover stick. I can flash a rom and everything is fine phone works perfectly. But later on if I need to flash something else when I boot back into recovery I'm back at the stock recover. Never had this happen before. So what I do for now is flash the ROM gapps then reflash twrp installer till I find a more permanent solution
jmcandrews83 said:
Rooting this moto x4 is a whole new learning curve. I've noticed that this is the only phone that doesn't let twrp recover stick. I can flash a rom and everything is fine phone works perfectly. But later on if I need to flash something else when I boot back into recovery I'm back at the stock recover. Never had this happen before. So what I do for now is flash the ROM gapps then reflash twrp installer till I find a more permanent solution
Click to expand...
Click to collapse
Yes, that is what you have to do.
As recovery is no longer a separate partition, it gets replaced when the boot partition gets updated.
I believe this is the way it will be with any device with a/b partition.
After unlockling bootloader and rooting my spare (Blue) X4 XT1900-1 with Magisk (patched boot.img), I attempted to restore /data via TWRP (3.3.1-0 payton) from a backup taken from my other daily driver X4 (Black). Both phones are identical Android One versions on the same build PPWS29.69-39-6-2 Nov. 1 patch. This initially failed with extractTarFork() process ended with ERROR: 255. I am booting TWRP via fastboot, as I am trying to keep the phones as close to stock as possible while having root.
Apparently some of the data.ext4.win00x files in the may have been corrupt or incomplete—I had copied them from the black X4 to my PC via wifi.
I re-copied the Black X4 backup to the Blue X4 folder on SD via PC and did another restore, wiping data & cache. It completed successfully according to TWRP. This time the phone initially went into a bootloop. I tried restoring a TWRP backup taken from Blue X4 just prior to flashing /data, that resulted in the phone hanging on the Android One splash screen but not bootlooping per se. I can get the phone into fastboot, recovery and boot TWRP via fastboot. I’ve tried various wipe and restore protocols, factory reset, flashing the stock unpatched boot.emmc.win, All yield the same Android One hang. Finally tried switching from slot A to slot B (the phone recently had several updates), that gave Error changing bootloader boot slot to B. However, hitting the Back button then shows Current Slot: B. Rebooting, still hangs on Android One. Back in TWRP, changing back to slot A in TWRP gives same error message: Error changing bootloader boot slot to A.
I saw a thread of similar issues with TWRP 3.2.3-1 from 2018, but no definitive fix short of factory flash and no working way to restore only /data.
https://forum.xda-developers.com/moto-x4/help/bootloop-restore-twrp-3-2-3-1-payton-img-t3853419
No mention of TWRP 3.3.1-0 having same issues.
Wondering if the bootloader is somehow borked? Any suggestions on a fix would be great. If I could find a recent X4 factory Pie firmware to flash would that get it working again?
One thing I am unclear on is which, if any, partitions should be mounted/unmounted while TWRP restoring. I’ve done the /data partition migration before on identical devices running MM and below with no issues. This is my first soft brick in 30 or more device unlockings, rootings and ROM flashings the past 7 years. Very humbling.
TWRP log from one of the attempts attached.
Other than Pie on the X4 having 2 sets of partitions and you maybe restoring it to the wrong one, no idea.
Factory FW flash solved boot hang
KrisM22 said:
Other than Pie on the X4 having 2 sets of partitions and you maybe restoring it to the wrong one, no idea.
Click to expand...
Click to collapse
I checked that carefully before restoring, chose the active slot.
Tonight I flashed the latest factory FW and all is good, phone updating now.
The TWRP restore problem is worrisome (what good is a backup you can't restore?) Anyone else out there had bootloops after restoring a TWRP backup on the X4? I've seen posts about similar problems from 2017-2018 on several devices, but I would hope that whatever the problem was has been sorted out.
redwoodie said:
I checked that carefully before restoring, chose the active slot.
Tonight I flashed the latest factory FW and all is good, phone updating now.
The TWRP restore problem is worrisome (what good is a backup you can't restore?) Anyone else out there had bootloops after restoring a TWRP backup on the X4? I've seen posts about similar problems from 2017-2018 on several devices, but I would hope that whatever the problem was has been sorted out.
Click to expand...
Click to collapse
Glad you got it back! Dunno about TWRP - maybe a pre or early Treble problem? Scary!
EDIT: I wonder if maybe stuff like that won't really be sorted for a couple more releases when most folks will be on a full Treble.
I'm a long time user of custom roms. I've bricked and subsequently rescued more android phones than I can remember and I always managed to get myself out of trouble before. But, I've been away from them for a while and I never had a phone with this dual slot setup before, and I'm stumped with this one
Before I start with the real issue, can I ask what the purpose of two slots is? Is it for dual booting, or something to do with the dual sims??
So, I'm on Lineageos. When I first flashed it I used the lineageos recovery. Now I would like TWRP permanently installed but can't get it to stick.
I've flashed the rom, and TWRP, so many times now. It's been a mess. My rom is working so no panic but if I go into recovery I'm back on the lineageos recovery and the text is too tiny to read (it wasn't like that when I used it before - the text was big).
Anyway, about half an hour ago I flashed the TWRP image in fastboot mode.
Then started twrp and copied the twrp zip over to the phone.
Then I flashed the zip and it flashed to both slots.
Then I couldn't get into my rom. It seemed to overwrite the boot.
So then I reflashed lineage and my rom is back and working fine, but I have the lineageos recovery again.
I thought that with TWRP in both slots, and me then flashing the rom, that the rom would only use one slot and TWRP would remain in the other and would be accessed when I boot to recovery.
Another thing. In fastboot mode (or the bootloader I should say) I have a black screen. The only feedback I get is from the terminal window on my linux computer. I can't see **** on the phone.
buachaille said:
I'm a long time user of custom roms. I've bricked and subsequently rescued more android phones than I can remember and I always managed to get myself out of trouble before. But, I've been away from them for a while and I never had a phone with this dual slot setup before, and I'm stumped with this one
Before I start with the real issue, can I ask what the purpose of two slots is? Is it for dual booting, or something to do with the dual sims??
So, I'm on Lineageos. When I first flashed it I used the lineageos recovery. Now I would like TWRP permanently installed but can't get it to stick.
I've flashed the rom, and TWRP, so many times now. It's been a mess. My rom is working so no panic but if I go into recovery I'm back on the lineageos recovery and the text is too tiny to read (it wasn't like that when I used it before - the text was big).
Anyway, about half an hour ago I flashed the TWRP image in fastboot mode.
Then started twrp and copied the twrp zip over to the phone.
Then I flashed the zip and it flashed to both slots.
Then I couldn't get into my rom. It seemed to overwrite the boot.
So then I reflashed lineage and my rom is back and working fine, but I have the lineageos recovery again.
I thought that with TWRP in both slots, and me then flashing the rom, that the rom would only use one slot and TWRP would remain in the other and would be accessed when I boot to recovery.
Another thing. In fastboot mode (or the bootloader I should say) I have a black screen. The only feedback I get is from the terminal window on my linux computer. I can't see **** on the phone.
Click to expand...
Click to collapse
1. Don't use lineage official because many users have had different problems. Use the unofficial one from the Telegram chat
2. The reason for the two slots is for updating your stock ROM without any risk of bricking
*When you get a stock update the system flashes it to the dormant slot ..if it bricks it boots back to active slot ...if it boots fine you switch slots and your dormant becomes your active .So you have a duplicate of all partitions but only one data partition ..so regardless of which slot you're using your data is there ..(+ and importantly doesn't get wiped ) so the concept is/was that you can flash stuff without bricking nor losing any data
3.The concept is simple : *usually because not always* your recovery flashes a rom or update to the slot you are not using ... But be careful .. ANYTHING ELSE like magisk or gapps or whatever gets flashed to the active slot ..so after flashing your ROM you need to change to the other slot in recovery then continue flashing gapps and magisk there ...so
SLOT A - flash ROM zip to B
*Reboot to slot B RECOVERY
SLOT B - flash gapps & magisk
___BOOT TO NEW ROM
*YOU ARE NOW USING SLOT B
#your old rom is still sleeping in slot A
In emergency you could go back there
4. Recovery ...this and other A/B devices and even other devices dont have a recovery partition ..so the recovery is inside the boot partition or recovery_ramdisk partition...which yes gets overwritten when flashing a new ROM or kernel etc
_the solution is easy_
Flash recovery back in recovery after flashing a custom ROM
*Some have twrp included and it gets flashed automatically
5. The not booting with recovery must have something to do with either bugs in the rom you are using or an old or bugged recovery or encryption/secure boot data problem ...either way you need to try different roms and recoveries and kernels - magisk combos
#see 7 # maybe you can't boot cos ARB 4 needs custom kernel on pie roms to boot
6. The black screen in fastboot is not a good sign ...sounds like your device got converted from Android 1 to MIUI and it triggered ARB 4
fastboot getvar anti
7. YOU CAN READ UP ON THAT ..all this info is available for our device in this forum and this is very lazy of you and I shouldn't be spoon feeding you .
***You can always sideload or backup sideways
fastboot boot recovery.img
*Go to advanced tab activate adb sideload
adb sideload "filename"
*File must be in adb folder
KevMetal said:
1. Don't use lineage official because many users have had different problems. Use the unofficial one from the Telegram chat
2. The reason for the two slots is for updating your stock ROM without any risk of bricking
*When you get a stock update the system flashes it to the dormant slot ..if it bricks it boots back to active slot ...if it boots fine you switch slots and your dormant becomes your active .So you have a duplicate of all partitions but only one data partition ..so regardless of which slot you're using your data is there ..(+ and importantly doesn't get wiped ) so the concept is/was that you can flash stuff without bricking nor losing any data
3.The concept is simple : *usually because not always* your recovery flashes a rom or update to the slot you are not using ... But be careful .. ANYTHING ELSE like magisk or gapps or whatever gets flashed to the active slot ..so after flashing your ROM you need to change to the other slot in recovery then continue flashing gapps and magisk there ...so
SLOT A - flash ROM zip to B
*Reboot to slot B RECOVERY
SLOT B - flash gapps & magisk
___BOOT TO NEW ROM
*YOU ARE NOW USING SLOT B
#your old rom is still sleeping in slot A
In emergency you could go back there
4. Recovery ...this and other A/B devices and even other devices dont have a recovery partition ..so the recovery is inside the boot partition or recovery_ramdisk partition...which yes gets overwritten when flashing a new ROM or kernel etc
_the solution is easy_
Flash recovery back in recovery after flashing a custom ROM
*Some have twrp included and it gets flashed automatically
5. The not booting with recovery must have something to do with either bugs in the rom you are using or an old or bugged recovery or encryption/secure boot data problem ...either way you need to try different roms and recoveries and kernels - magisk combos
#see 7 # maybe you can't boot cos ARB 4 needs custom kernel on pie roms to boot
6. The black screen in fastboot is not a good sign ...sounds like your device got converted from Android 1 to MIUI and it triggered ARB 4
fastboot getvar anti
7. YOU CAN READ UP ON THAT ..all this info is available for our device in this forum and this is very lazy of you and I shouldn't be spoon feeding you .
***You can always sideload or backup sideways
fastboot boot recovery.img
*Go to advanced tab activate adb sideload
adb sideload "filename"
*File must be in adb folder
Click to expand...
Click to collapse
Thanks. I really appreciate your detailed reply. Sorry I didn't answer sooner. I've been unbelievably busy with work and other things and only just logged into XDA again 10 minute ago.
Yes I know it's lazy of me, BUT, a problem I always have with information on roms is that there is so much contradictory information. One post contradicts another a lot of the time, often because methods change over time. Anyway, this leads to me doing the wrong thing and bricking my phones
Thanks again :good:
I got to this link from telegram chat after searching it up. Is this where you are saying I should get Lineageos?
https://github.com/LineageOS
buachaille said:
I got to this link from telegram chat after searching it up. Is this where you are saying I should get Lineageos?
https://github.com/LineageOS
Click to expand...
Click to collapse
https://sourceforge.net/projects/shoukolate-los17-1-builds/files/jasmine_sprout/
KevMetal said:
https://sourceforge.net/projects/shoukolate-los17-1-builds/files/jasmine_sprout/
Click to expand...
Click to collapse
Thanks. Once I get TWRP to stick I will flash this.
buachaille said:
Thanks. Once I get TWRP to stick I will flash this.
Click to expand...
Click to collapse
Sure . It will be easy . Put magisk and twrp.zip and gapps on your PC .
Put recovery.img in the adb folder
1. Connect phone to pc in normal mode and enable adb
2. Open adb and authorize device
3. Adb reboot bootloader
4. Fastboot boot recovery.img
5. Transfer recovery.zip to phone internal
6. Wipe - flash zip - format data - reboot recovery - transfer lineage ROM to phone - flash - flash recovery.zip - format data - reboot to the INACTIVE slot in reboot section ..then choose reboot recovery - flash gapps and magisk - reboot to lineage ...then recovery should be stuck
*If you wanna keep data back it up when you boot recovery first time
**Restore it after all the steps
***Recovery will only stick if you do the data formatting
Use this recovery:
https://drive.google.com/drive/mobile/folders/1NRlv58EiQ_YlMjrpLYKzOqIob2Vq3kYE
I'm on linux but I don't think that makes any difference here.
I've got the fastboot screen fixed. I downloaded and flashed the stock MI image. So I'm pleased with that.
I've flashed 3 different versions of TWRP. 3.4.0.0 and a couple of older ones. 3.4.0.0 gives me the TWRP screen but doesn't actually load into TWRP. With the other I get a black screen. Trying as we speak to fix.
I believe I have the command correct - sudo fastboot boot twrp-3.4.0-0-jasmine_sprout.img
<<edit>> This one worked ------ twrp-3.3.0-0-jasmine_sprout.img
In TWRP now and following your instructions. Would be done by now but rom taking ages to download. Anyway, thanks. I'll post back once I'm done and let you know what happened.
I owe you a post to let you know what happened. It took me hours and hours but it's finally done. I now have the following:
Bootloader image showing as it should (fixed this by using the MI flash tool and restoring a stock rom.
TWRP is installed and hasn't disappeared. I had a hard time with TWRP. The older version, that was the only one I could get to boot up initially, refused to flash a rom. I tried the Lineageos unofficial and the official, but no way. So I used TWRP, to flash the newest version of TWRP, and then it worked.
Lineageos unofficial is installed and rooted with Magisk.
Your list of instructions (quoted below) was extremely useful and I wouldn't have managed with it. Many thanks :good:
Put recovery.img in the adb folder
1. Connect phone to pc in normal mode and enable adb
2. Open adb and authorize device
3. Adb reboot bootloader
4. Fastboot boot recovery.img
5. Transfer recovery.zip to phone internal
6. Wipe - flash zip - format data - reboot recovery - transfer lineage ROM to phone - flash - flash recovery.zip - format data - reboot to the INACTIVE slot in reboot section ..then choose reboot recovery - flash gapps and magisk - reboot to lineage ...then recovery should be stuck
*If you wanna keep data back it up when you boot recovery first time
**Restore it after all the steps
***Recovery will only stick if you do the data formatting
Click to expand...
Click to collapse
I would say that flashing roms has become more complicated during the time I've been away. I think the last phone I used a custom rom on was my Galaxy S5. I can't believe how hard a time I had getting this to work.
buachaille said:
I owe you a post to let you know what happened. It took me hours and hours but it's finally done. I now have the following:
Bootloader image showing as it should (fixed this by using the MI flash tool and restoring a stock rom.
TWRP is installed and hasn't disappeared. I had a hard time with TWRP. The older version, that was the only one I could get to boot up initially, refused to flash a rom. I tried the Lineageos unofficial and the official, but no way. So I used TWRP, to flash the newest version of TWRP, and then it worked.
Lineageos unofficial is installed and rooted with Magisk.
Your list of instructions (quoted below) was extremely useful and I wouldn't have managed with it. Many thanks :good:
I would say that flashing roms has become more complicated during the time I've been away. I think the last phone I used a custom rom on was my Galaxy S5. I can't believe how hard a time I had getting this to work.
Click to expand...
Click to collapse
No yes I understand I had to pick up all what was discussed by trial and error.
Therr are two big changes ..more security measures ...more complicated workarounds.
But the A/B thing is a mission. I converted my phone completely and repartitioned it to A only . Now it has a dedicated recovery partition. And I have an extra 4GB of space .
By the way .Please remember you will need to reflash the twrp zip after every ROM if you don't want to lose it.
KevMetal said:
No yes I understand I had to pick up all what was discussed by trial and error.
Therr are two big changes ..more security measures ...more complicated workarounds.
But the A/B thing is a mission. I converted my phone completely and repartitioned it to A only . Now it has a dedicated recovery partition. And I have an extra 4GB of space .
By the way .Please remember you will need to reflash the twrp zip after every ROM if you don't want to lose it.
Click to expand...
Click to collapse
Thanks for the reminder about reflashing TWRP. I will keep that in mind. I shouldn't be reflashing much now though. I hope I got that out my system last time. I was always changing roms - constantly.
I mainly wanted TWRP installed as I remember sometimes my roms would just go into a bootloop for no reason that I could discover, and I'd need my TWRP backups.
How do you re-partition a Xiaomi. With the MI flash tool? I'm guessing that as I remember I had to do that once with Odin (I always had Samsung phones back then). I was forced to do it as I had bricked my phone much MUCH more seriously than usual. Got it fixed though
I still am quite confused with the A/B thing, but I'll pick it up as I go along I'm sure. For now I'm happy. Rom working fine so I can get on with other things in life.
And thanks again - you totally got me out of the **** :good::good: