Restoring Backup (Android P) with TWRP - possible solution found (updated) - OnePlus 6 Questions & Answers

Edit: Since I am the impatient guy of course I still meddled with the backup after posting this thread. By chance I found a solution that finally worked for me. Latest Oxygen Os 9.0.2 stable without root.
Note that I will list every step even it may be that it hasn't contributed anything to the solution:
1. From fastboot I booted into latest blu_sparc TWRP.
2. I plugged the phone into USB and copied all files from my backup into the usual TWRP folder.
3. I flashed only DATA, nothing else.
4. From TWRP I rebooted directly into bootloader/fastboot.
5. Then I ram the flash-all-partitions.bat from Mauronofrio provided by this thread https://forum.xda-developers.com/oneplus-6/how-to/rom-stock-fastboot-roms-oneplus-6-t3796665 .
6. Crucial step: At the beginning, it asks "Wipe all data?". SELECT NO. It will start "restoring" all other partitions.
7. Reboot the phone and it should work as you left it before creating the backup.
Note that this method worked the restoration of backup data from the same OS and same version. Feel free to try it out on other system images. It's ugly and inconvenient, but it seems to work.
Hey guys,
is there a fail safe way to restore data from a clean twrp backup without soft bricks or PIN error?
I tried to restore a very recent TWRP backup but had serious trouble. At first, it rebooted just fine but upon trying to unlock the device with 4-digit pin it suddenly told me that my usual pin isn't working.
Then I tried deleting the lockscreen.db and other related files. Rebooted and got into the OS, but it got stuck at "starting up device".
The I did a complete wipe without internal storage and tried it again. Then it wouldn't even boot and I had to use the flash-all.bat to flash all partitions "manually" to get it working again.
Now I am afraid of using Oneplus 6 if it's impossible to make a seamless backup/recovery. Is there a guide on how to do this?
Thank you in advance!

This is a known issue though. If you want to make a usable backup in TWRP: Remove the PIN (screen lock), do the backup, and then activate the screen lock again.

efex said:
This is a known issue though. If you want to make a usable backup in TWRP: Remove the PIN (screen lock), do the backup, and then activate the screen lock again.
Click to expand...
Click to collapse
I remember having read a thread with this hint too and disabled my security pin in a temporary working OS. Then I did the flashing stuff and I just noticed that my now working restored phone doesn't have a pin anymore. So basically removing this pin on a data backup will make things go smooth? I will keep this in mind, thank you

Related

Bootloop (Stuck at "Preparing Apps x of xxx")

Hello,
I have an issue with my phone and any help or insight is appreciated!
I have a Oneplus One. Rooted with TWRP and MultiROM installed. I have two CyanogenMod ROMs installed. One is my primary one where I have all my apps, and another one that is almost empty (has few apps).
Few days ago, my battery drained and I charged it. Then when I turned it on, the phone started booting, passed through the MultiROM window (where you choose the booting ROM), then passed through the Boot animation, and then a screen appears where it says "Preparing Apps x of xxx". After the phone goes through all of my apps (optimizing/preparing them), it shuts down and starts all over again.
This was random. I didn't install a new update or anything. Note, that this only happens with my primary ROM. When I boot to my secondary ROM everything works fine. I had a backup of all my app data (~ 6GB) using Titanium Backup. However, I was running out of space and I deleted the backup from Google Drive few days earlier. I am very unlucky.
I tired the following to fix this issue and nothing helped:
1. Cleared chase and Dalvik chase.
2. Installed a CyanohenMod update. Apparently, my phone wasn't up to date.
3. Drained the battery completely and charged the phone.
4. Booted the phone while charing and while not charging.
I just want to get my apps data back. So is there anyway to fix this issue so that I can boot to my primary ROM?
If not, is there a way to fully backup my apps data in the primary ROM (the one that is not booting) and transfer this backup (install these apps with their data) to another ROM?
I can't back up my apps data using TWRP and save the backup in Internal Storage, because I don't have enough space. Maybe I can back up my apps data to my laptop somehow? Also, if I do a backup through TWRP, will the issue still persist when I do a restore (I am backing up a broken ROM)? I am afraid to do this step because in order to restore through TWRP (after backing up the ROM), I have to delete this broken Primary ROM first due to insufficient amount of space. If it ends up not working I will lose all my data! So I prefer to fix the ROM if possible instead of going through all of this.
Any help is appreciated. Sorry for the long post.
Thank you in advance.
@ali282h
Sorry for the delay and for the issue you are having at the first place.
I read your post completely.
I will answer Your Questions in points:
1)You can take Apps backup , dont worry if the roms works or not.
2)i will suggest you to use a single rom first , dont use multi rom that can make it difficult to analyse the root cause of the bootloop,
3)Use a toolkit called Wug fresh and flash a stock firmware and then check if itss booting correctly or not.If not ???
Follow the 4 step
4)U can boot into the Twrp, then use ADB commands.
Fastboot erase persist
fastboot flash persist persist.img
Again If you have problem You can follow the next step
5)You can type these commands in adb
adb shell
make_ext4fs /dev/block/mmcblk0p15
Report back..... Gudluk
Hello.. I actually ended factory resetting my phone. Thanks for taking the time to write a very helpful answer.
adarsh58 said:
@ali282h
Sorry for the delay and for the issue you are having at the first place.
Report back..... Gudluk
Click to expand...
Click to collapse
Hey thanks for the reply. I am also facing the same issue. Where can I get this persist.img to flash it from fastboot?
This issue keep on popping every week and almost every week I am wiping everything completely and installing new ROM. Kindly help. I am currently using Resurrection Remix 5.7.4 MM. No MutiRom.
Thanks.
i had it, but i dont think it is related to persist as after each update i flash i erase wipe persist folder, tho i did a titanium backup and wiped data/cache/dalvik/system and flashed it all over again.
badboy4a2 said:
Hey thanks for the reply. I am also facing the same issue. Where can I get this persist.img to flash it from fastboot?
This issue keep on popping every week and almost every week I am wiping everything completely and installing new ROM. Kindly help. I am currently using Resurrection Remix 5.7.4 MM. No MutiRom.
Thanks.
Click to expand...
Click to collapse
Hi ali,
Follow this link and get to the post no 8, u will find
https://forums.oneplus.net/threads/afx-zip-containing-persist-img-reserve4-img.198286/
guidoido004 said:
i had it, but i dont think it is related to persist as after each update i flash i erase wipe persist folder, tho i did a titanium backup and wiped data/cache/dalvik/system and flashed it all over again.
Click to expand...
Click to collapse
Ya You may be right :angel::angel:, but correct me if i am wrong
Persist partition is not like other partitions in android like /system,/data,/cache etc.
so integrity checks wont run on it ,results into
"if its get corrupted it will remain corrupted"
in that case we need erase and flash it all over again,
You can do it by typing one line cmd in ur twrp terminal emulator
make_ext4fc /dev/block/mmcblk0p15.
:good::good::good:
LINKS:
http://droid-bug.blogspot.in/2014/10/oneplus-one-boot-loop-0mb-no.html
adarsh58 said:
Ya You may be right :angel::angel:, but correct me if i am wrong
Persist partition is not like other partitions in android like /system,/data,/cache etc.
so integrity checks wont run on it ,results into
"if its get corrupted it will remain corrupted"
in that case we need erase and flash it all over again,
You can do it by typing one line cmd in ur twrp terminal emulator
make_ext4fc /dev/block/mmcblk0p15.
:good::good::good:
LINKS:
http://droid-bug.blogspot.in/2014/10/oneplus-one-boot-loop-0mb-no.html
Click to expand...
Click to collapse
i use commands in the Recovery terminal to do so, as theres not a easy way to do it on the recovery itself

There is apparently no way to restore a Nandroid backup under OOS 9.0.4...???

So I did what I thought was a routine thing, trying to restore system, boot, and data like I have on many phones before only to ended up in a bootloop or bootloader only not even able to boot a TWRP from fastboot.
After several hours of trying just about everything I finally faced the fact that I was not going to be able to restore any NANDROID backup I had do to A/B, encryption or the latest Android security patch?
However, you can get you phone running again quite easily with this thread: https://forum.xda-developers.com/oneplus-6/how-to/rom-stock-fastboot-roms-oneplus-6-t3796665 and using the flash-all option from a WIndows 10 VM (I am a Mac/Linux guy, but this does work from a Windows VM and is quick).
Before I re-installed anything I wanted to just verify that I could do a simple NANDROID backup of an empty phone with twrp / blu_spark and I can't under any case. Here's what I tried (with latest stock TWRP and latest Blu_Spark TWRP):
1) simple restore of data, system, boot -- > boots only to fastboot, need to recover with thread above
2) Recover with thread above, re-root (Magisk 18.1) and reinstall TWRP, boot ROM, then try restoring just data -- > same as #1
3) Recover using thread above, re-install TWRP, restore NANDROID, and re-run Magisk (suggest by a few) --> same as #1
My device is encrypted, and I could turn off encryption, but that is somewhat scary on a daily driver.
So has anyone successfully restored a NANDROID on a 9.0.4 rooted phone with the latest Android security patch and if so, what's the trick?
Thanks,
MW
MetroWestMA said:
So I did what I thought was a routine thing, trying to restore system, boot, and data like I have on many phones before only to ended up in a bootloop or bootloader only not even able to boot a TWRP from fastboot.
After several hours of trying just about everything I finally faced the fact that I was not going to be able to restore any NANDROID backup I had do to A/B, encryption or the latest Android security patch?
However, you can get you phone running again quite easily with this thread: https://forum.xda-developers.com/oneplus-6/how-to/rom-stock-fastboot-roms-oneplus-6-t3796665 and using the flash-all option from a WIndows 10 VM (I am a Mac/Linux guy, but this does work from a Windows VM and is quick).
Before I re-installed anything I wanted to just verify that I could do a simple NANDROID backup of an empty phone with twrp / blu_spark and I can't under any case. Here's what I tried (with latest stock TWRP and latest Blu_Spark TWRP):
1) simple restore of data, system, boot -- > boots only to fastboot, need to recover with thread above
2) Recover with thread above, re-root (Magisk 18.1) and reinstall TWRP, boot ROM, then try restoring just data -- > same as #1
3) Recover using thread above, re-install TWRP, restore NANDROID, and re-run Magisk (suggest by a few) --> same as #1
My device is encrypted, and I could turn off encryption, but that is somewhat scary on a daily driver.
So has anyone successfully restored a NANDROID on a 9.0.4 rooted phone with the latest Android security patch and if so, what's the trick?
Thanks,
MW
Click to expand...
Click to collapse
apparently is not matter of factly, i do nandroids and have restored from them various times with only 2-3 settings that i had to reset my way thereafter, hence it's apparently worth to retry, it works.
sometimes it helps to know that things are possible to put some more effort into something, knowing it can be worth it in case of success.
perhaps some remarks:
if your' phone is "empty" as you stated i recommend to first install factory image / stock rom latest OOS, i.e. 9.0.4
make nandroids of each partiton speparately and also restore them separately while don't nandroid the images, and cerrtainly don't restore those, only common partitions like system, boot, vendor, data.
system and vendor are present as normal partition as well as image partition, don't touch the later in any way.
all this only works if you restore on a phone that was bootable before you restore, for restoring to empty phones there are other procedures via fastboot commands and or stock rom via stock recovery if it's on device, else ADB comes in handy.
last but not least if you restore you have to restore everything, not only one partition especially not only system partition, won't work well or not at all depending.
1. Modem if corrupted, else not needed
2. EFS if corrupted, else not needed
3. Vendor start here if the previous rom was running well and make sure it's not been altered or you have to correct vendor backup in case you have more than one
4. System
5. Boot
6. Data
good luck
magnamentis said:
apparently is not matter of factly, i do nandroids and have restored from them various times with only 2-3 settings that i had to reset my way thereafter, hence it's apparently worth to retry, it works.
sometimes it helps to know that things are possible to put some more effort into something, knowing it can be worth it in case of success.
good luck
Click to expand...
Click to collapse
OK -- do tell, what settings did you use? And you have done this on OOS 9.0.4 with encryption, or did you disable decryption?
I'll happily delete or edit the post...it seems many are having problems with few solutions starting with 9.0.4...
Thanks,
MW
MetroWestMA said:
OK -- do tell, what settings did you use? And you have done this on OOS 9.0.4 with encryption, or did you disable decryption?
I'll happily delete or edit the post...it seems many are having problems with few solutions starting with 9.0.4...
Thanks,
MW
Click to expand...
Click to collapse
the last restore i did on 9.0.3, since then i gave up on custom roms since OOS rooted + a few useful apps make OOS close to perfect for me
i'd not delete the thread, many reported issues with nandroids because the normal procedure to take one single backup and restore from twrp to an empty device does not work, one always need to first flash stock OOS to a clean slate before installing anything else or restoring anything.
and backups should be in increments not one single backup like it was possible on single slot devices.
restoring one single partition usuelly ends up in a mess except boot partition, boot, efs and modem can be restored as standalone restores without issues in most cases while flashing a kernel + magisk is still easier and safer than restoring a boot partition.
as to setttings i dunno what you mean, exactly and as to encryption, my device is and has bee encrypted at all times.
it's most important to use twrp- recovery by blue_spark, official standard recovery has issues ( at least always had as long as i tried using it) especially with verification in TWRP on encrypted devices. there is a risk to end up encrypted without any way to boot back into system or into twrp menu, hence use blue_spark's and all is well, user error exempt of course
Since reinstalling everything is going to take forever (at least another 4 hours)...I am going to disable encryption and do some more testing. I am now more certain than ever, no-one has successfully restored a NANDROID on an encrypted OOS 9.0.4 phone ever.
I am going to disable Force Encryption and AVB 2.0/dm-verity and try my restore again -- maybe then I can use one of my NANDROIDS. But doing this on an encrypted phone seems impossible. I guess if you use a screen PIN you files are still vulnerable to someone that knows bootloader and / or recovery, but I'll have to live with that.... Not being able to NANDRIOD restore is a killer...
I know is an old discussion but I believe we still have this issue. I have a 6T, oos10.3.6 and neve succeeded to restore a nandroid backup. Does anyone found a working solution?
Thanks

Stuck in a bootloop, please help

Hey,
Quick rundown: Stuck in a bootloop to some sort of empty bootloader screen which has the readout:
"Start/Restart Bootloader/Recovery Mode/Power Off"
"Press volume key to select, and press power key to select"[Regarding above options]
"FastBoot Mode
PRODUCT_NAME - sdm845
VARIANT - SDM UFS
BOOTLOADER VERSION -
BASEBAND VERSION -
SERIAL NUMBER - [Gonna leave this out for now]
SECURE BOOT - yes
DEVICE STATE - unlocked" [this line is in red]​
Every choice besides Power Off returns me to the same window. What can I do to recover from this?
Background:
So I was trying to update my OP6 to the current OxygenOS while keeping my root using TWRP and Magisk, which I've done in the past without any issue(i.e. go in recovery flash OS, flash current TWRP, reboot back to recovery, flash current Magisk as I understand it). However this time I was running into an issue flashing the Oxygen update getting an error that said it "failed to map file" for the zip. My first instinct was to update TWRP to see if the newest version didn't run into this issue so I flashed that followed by the current Magisk(no reboot in between). After booting back to standard operations everything seemed fine. I went back into recovery and tried the OS update again, but hit the same issue.
I couldn't find anything specific to OP6 with this issue, but similar questions with other devices suggested clearing the dalvik cache, which I tried to no useful effect. Then I came across this thread (forums.oneplus.com/threads/oxygen-os3-i-have-a-problem-please-help.440587/page-2 too new to hyperlink) and did what I think really messed me up which was boldly follow this guy's advice to do an advanced wipe of everything but internal storage(I also left USB storage intact) from TWRP. This failed to fix the issue with the file mapping error when I subsequently tried to flash the update, though I was able to flash TWRP and Magisk successfully again before rebooting and ending up in this loop.
Any assistance in fixing this or general tips on how to not be foolish when messing around with this stuff is greatly appreciated.
Update:
So I followed the advice gleaned from the resourceful person here(https://forum.xda-developers.com/oneplus-6t/help/bootloader-baseband-versions-blank-t3927565) to try working with the device from my computer with fastboot. At first it would recognize the device as "Android" but be unable to find a driver for it and adb/fastboot both failed to recognize it as a device. After installing MiniTool(more as a way to backup what was on the SD card) the proper device driver also got installed and I was able to access it with fastboot; I ran into similar issues as the linked thread above, solved it by switching to b(still failed) then back to a.
Currently I've got it booted into TWRP and I'm working on getting the current Oxygen .zip copied onto the phone storage but the transfer keeps failing after moving a negligible amount.
Update 2:
Via TWRP was able to sideload the current up-to-date standard OS onto it, however my Google backup seems to have decided to disappear on me and the only OP backup I have is ages old. Anyone have recommendations on data recovery tools?
next time just dont change the build.prop file.
serious, it just breaks the system.
heppened to me too.
NickTheHuy said:
next time just dont change the build.prop file.
serious, it just breaks the system.
heppened to me too.
Click to expand...
Click to collapse
Good to know, thanks for the info!
I assume that happened when I messed around with advanced wipe, do you know which of the folders I selected that would have been under? And just for future awareness, would that have not occurred had I just used TWRP's standard wipe instead?
You can run a program that will install 9.0.6 from scratch, running a batch file...
Save my life before yesterday....
Your device is bricked
If able to access the TWRP recovery then boot into twrp and try to get all the data stored in your computer.
Then use the Qualcomm flash tool to completely recover from your hard bricked OP6.
from here https://forum.xda-developers.com/oneplus-6/how-to/op6-collection-unbrick-tools-t3914109
Then its easy, again unlock boot-loader flash TWRP and magisk.

Messed up upgrading to 10.3.4 - can't do anything now

Spent about 1 entire day now and I think am in worse shape than when started.
Rooted with Magisk went from 10.3.3 to 10.3.4, and the phone was working, but didn't have TWRP recovery.
So, putting that back on is when the trouble started. Got TWRP on, and all the phone would do was boot to recovery.
Have since tried lots of things, and learned, apparently a TWRP backup is of no use whatsoever - can't restore the phone from the backup. (Restore "restores" but it doesn't boot.)
As I tried different things (flashing the full 10.3.3 and/or 10.3.4 OTA), at one point I got the phone back booted, but wifi wouldn't turn on and the cell signal didn't work - and now, I'm at a point where with TWRP in either slot A or slot B, cannot mount Data partition.
Really stuck now - don't know what to do.
I have TWRP backup of 10.3.3 before I did the upgrade - but doesn't seem like it can be restored, and now I don't know if there's anything I can do to mount Data partition again?
What can I do?
Do I have to basically factory reset the phone? Any suggestions?
TIA!
relaxable said:
Spent about 1 entire day now and I think am in worse shape than when started.
Rooted with Magisk went from 10.3.3 to 10.3.4, and the phone was working, but didn't have TWRP recovery.
So, putting that back on is when the trouble started. Got TWRP on, and all the phone would do was boot to recovery.
Have since tried lots of things, and learned, apparently a TWRP backup is of no use whatsoever - can't restore the phone from the backup. (Restore "restores" but it doesn't boot.)
As I tried different things (flashing the full 10.3.3 and/or 10.3.4 OTA), at one point I got the phone back booted, but wifi wouldn't turn on and the cell signal didn't work - and now, I'm at a point where with TWRP in either slot A or slot B, cannot mount Data partition.
Really stuck now - don't know what to do.
I have TWRP backup of 10.3.3 before I did the upgrade - but doesn't seem like it can be restored, and now I don't know if there's anything I can do to mount Data partition again?
What can I do?
Do I have to basically factory reset the phone? Any suggestions?
TIA!
Click to expand...
Click to collapse
If you still have the cellular and wifi problem then you are not alone. Simply flashing android 9 image via edl mode and installing update to android 10 locally fixed for me. As you boot to 9 don't turn on wifi or cellular just download the update packages via pc, copy to internal storage then local update via system updates. Once you are on android 10 then install TWRP and root. TWRP backup only work if your data partition is decrypted.
relaxable said:
Spent about 1 entire day now and I think am in worse shape than when started.
Rooted with Magisk went from 10.3.3 to 10.3.4, and the phone was working, but didn't have TWRP recovery.
So, putting that back on is when the trouble started. Got TWRP on, and all the phone would do was boot to recovery.
Have since tried lots of things, and learned, apparently a TWRP backup is of no use whatsoever - can't restore the phone from the backup. (Restore "restores" but it doesn't boot.)
As I tried different things (flashing the full 10.3.3 and/or 10.3.4 OTA), at one point I got the phone back booted, but wifi wouldn't turn on and the cell signal didn't work - and now, I'm at a point where with TWRP in either slot A or slot B, cannot mount Data partition.
Really stuck now - don't know what to do.
I have TWRP backup of 10.3.3 before I did the upgrade - but doesn't seem like it can be restored, and now I don't know if there's anything I can do to mount Data partition again?
What can I do?
Do I have to basically factory reset the phone? Any suggestions?
TIA!
Click to expand...
Click to collapse
Hi,
Just a suggestion, was in this predicament before and the the thing that save me was my OTG USB stick with a USB C adapter, moved the latest rom(full rom 2.4gig) to it with TWRP installer , wiped( factory reset in twrp and installed the full update followed by TWRP installer. Reboot into recovery and did the same steps,
Reboot system,
Could never get MSM to work always param preload nonsense.... LOL.
relaxable said:
Spent about 1 entire day now and I think am in worse shape than when started.
Rooted with Magisk went from 10.3.3 to 10.3.4, and the phone was working, but didn't have TWRP recovery.
So, putting that back on is when the trouble started. Got TWRP on, and all the phone would do was boot to recovery.
Have since tried lots of things, and learned, apparently a TWRP backup is of no use whatsoever - can't restore the phone from the backup. (Restore "restores" but it doesn't boot.)
As I tried different things (flashing the full 10.3.3 and/or 10.3.4 OTA), at one point I got the phone back booted, but wifi wouldn't turn on and the cell signal didn't work - and now, I'm at a point where with TWRP in either slot A or slot B, cannot mount Data partition.
Really stuck now - don't know what to do.
I have TWRP backup of 10.3.3 before I did the upgrade - but doesn't seem like it can be restored, and now I don't know if there's anything I can do to mount Data partition again?
What can I do?
Do I have to basically factory reset the phone? Any suggestions?
TIA!
Click to expand...
Click to collapse
I'm not sure what you did.
How I normally upgrade is:
1. Local install
2. Install Magisk after OTA option
3. Reboot
4. Local install again, the other slot
5. TWRP zip install from Magic (do not reboot)
6. YOU ARE NOW UNROOTED.
7. Use Magisk Manager to do direct install (do not reboot)
8. Use Magisk Manager to do OTA install
9. Now reboot.
You have same firmware, TWRP and root on both slots.
If you can flash the stock boot image from 10.3.4 you can recover.
Thanks for all the replies.
I wish I could have done what Tech_Head wrote, but it wasn't happening for me.
I couldn't flash using OTG either as I couldn't mount USB with TWRP.
In the end, I was able to get back to life using the Fastboot flash method from This Thread, but, also not without complication

How to bypass recovery password

Hello,
This is my story:
I have my Mix 2S for few months for now and I have been trying many custom roms (Pixel Experience, LineageOS etc.). Today I wanted to restore backup with PE and then my problems begin.
Everything was fine until I rebooted, after that I could only boot into recovery. So I got into recovery and decided to format data. Data formatted without any problems, I copied by backup with all files from computer, wiped everything and then tried to restore PE. It couldn't restore data, so I decided to restore ROM only (I have lost clean zip, my connection is slow, so I have to download it for an hour (tomorrow I will try). Then I tried to reboot, the effect was similar but...
I can't get into my recovery because there is a password. I know my password because I set it by myself but I believe that restore was not fully fine.
I use OrangeFox recovery (10.3 if I remember good), my phone has an unlocked bootloader, I can get into fastboot but I can't flash anything because nothing happens. I tried to install driver for it but I don't see the difference.
I had a fingerprint set in system. I have the whole backup.
My phone version is 6/128.
I can't find anything, maybe stress makes me a fool.
EDIT
I found a solution, the whole problem was caused by Windows 10 feature that blocks files from the Internet. I had to unlock recovery file (TWRP) and now I can do anything with my phone.

Categories

Resources