backing up/restoring roms in twrp - OnePlus 7 Pro Questions & Answers

do i have to unencrypt my device in order to restore/backup and maybe even flash from on it? I've seen in twrp it tells me backups and restores may not work fully due to being encrypted

No, I guess.
The only partition encrypted is your internal storage and twrp can't take a backup of that.
So, you can try by yourself, just remember to take your cautious.
in old devices I always made a backup of this partitions:
Boot
System
Data
Vendor
And restored without problems, just make a factory reset before and maybe flash magisk after restoration

Related

Nandroid backup..

I did a nandroid backup bit it said fatal error while backing up bpws...or something like that...(one more thing...will nandroid backup...backup my apps if I lost them??)
Sent from my XT720 using XDA App
vari9 said:
I did a nandroid backup bit it said fatal error while backing up bpws...or something like that...(one more thing...will nandroid backup...backup my apps if I lost them??)
Click to expand...
Click to collapse
For some reason we can't back up all the partitions in nandroid. It should be enough to backup system and data. Optional: boot, logo (if you modified M boot logo), cache (usually not necessary), sd data (if you use ext partition on SD card).
With nandroid of system and data (and the others, but only if you use them) you should expect to be able to go back to exactly how your phone was at the time you made the backup. But you will lose changes you made after you made the backups.
When I'm about to start testing ROMs, I backup system and data. To go back to my pre-testing ROM I restore system and data and then wipe cache partition.
Mioze7Ae said:
When I'm about to start testing ROMs, I backup system and data. To go back to my pre-testing ROM I restore system and data and then wipe cache partition.
Click to expand...
Click to collapse
You want to say system and boot ?
Because changing a room modify system.img and boot.img
The boot.img is the same on all the ROMs thanks to the locked bootloader.
Yeah, I never even bother changing boot.img from the sbf version. If I did I'd probably use the Russian one because I think it was the most recently compiled.
Ok, I wasn't knowing that I always flash boot.img that come with ROM.

WARNING! TWRP RESTORE Can Corrupt System

This is a psa about restoring backups with our version of TWRP. I would advise anybody who can help it NOT to do a full system restore I am on EVR_AL00.
I do not know the details of its implementation but I do know that trying to restore a full system backup from 3 days ago become a huge problem when TWRP failed to properly restore the system and system image partition and the device could not mount them because of corruption. No combination of formatting and restoring seemed to have an impact on the results, but after painfully re-writing my drive many times I saw that the results inconsistently affected /vendor, /data, /system, and /system_image. TWRP did eventually give me a bootable system after running e2fsck -fv on my system partition, BUT it managed to kill the performance of my phone. There was noticeable lag on boot up before I could get full control of my system, but I might not have known if I did not use more cpu intensive tasks, such as viewing videos inside a linux chroot environment. The affect was not small by any means, it destroyed the usability of my environment. I believe that this was do to a failure to properly restore the block information, therefore killing read/write speed. Furthermore, the system was no longer able to boot with the stock boot.img, only through magisk. When I formatted the system_root partition, not realizing it was not included in the backup, it was no longer able to do that....
This become more of a pain in the ass when after restoring the stock erecovery it failed to restore the device, and the inconsistent performance of the huawei bootloader made it at times impossible to access either recovery or the system partition as I went about trying to get a stable system back on my device without erecovery or emui flasher. After messing around flashing different recovery images, eventually erecovery was able to restore the stock rom and I was able to re root my device and restore my TWRP /data backup.
I'm not complaining, as I do appreciate these tools for what they are, but I wanted to put this out there so that somebody could be saved from this experience. Due to my previous experience with TWRP I was happy to do a full system restore, even when I didn't need to, if only just to make sure I could. Turns out that was ill-advised.
I would highly advise that you only restore the /data partition through TWRP unless you absolutely must restore other partitions to recover a device. Through all of this I probably put near a full write cycle on my disk
AllanRSS said:
This is a psa about restoring backups with our version of TWRP. I would advise anybody who can help it NOT to do a full system restore I am on EVR_AL00.
I do not know the details of its implementation but I do know that trying to restore a full system backup from 3 days ago become a huge problem when TWRP failed to properly restore the system and system image partition and the device could not mount them because of corruption. No combination of formatting and restoring seemed to have an impact on the results, but after painfully re-writing my drive many times I saw that the results inconsistently affected /vendor, /data, /system, and /system_image. TWRP did eventually give me a bootable system after running e2fsck -fv on my system partition, BUT it managed to kill the performance of my phone. There was noticeable lag on boot up before I could get full control of my system, but I might not have known if I did not use more cpu intensive tasks, such as viewing videos inside a linux chroot environment. The affect was not small by any means, it destroyed the usability of my environment. I believe that this was do to a failure to properly restore the block information, therefore killing read/write speed. Furthermore, the system was no longer able to boot with the stock boot.img, only through magisk. When I formatted the system_root partition, not realizing it was not included in the backup, it was no longer able to do that....
This become more of a pain in the ass when after restoring the stock erecovery it failed to restore the device, and the inconsistent performance of the huawei bootloader made it at times impossible to access either recovery or the system partition as I went about trying to get a stable system back on my device without erecovery or emui flasher. After messing around flashing different recovery images, eventually erecovery was able to restore the stock rom and I was able to re root my device and restore my TWRP /data backup.
I'm not complaining, as I do appreciate these tools for what they are, but I wanted to put this out there so that somebody could be saved from this experience. Due to my previous experience with TWRP I was happy to do a full system restore, even when I didn't need to, if only just to make sure I could. Turns out that was ill-advised.
I would highly advise that you only restore the /data partition through TWRP unless you absolutely must restore other partitions to recover a device. Through all of this I probably put near a full write cycle on my disk
Click to expand...
Click to collapse
You only need to backup data and system image in TWRP. Don't mess with vendor, cust etc as they don't backup or restore properly on Huawei devices with TWRP. I've backed up and restored data and system plenty of times now.
Of course which partitions you need to backup or restore would depend entirely on the use case of the utility . I tend to 'mess with' alot of things for various purposes and it is good knowing that anything can be recovered quickly and easily if need be. I have been doing nandroid backups for a long time and it has always 'just worked' as long as you use it sensibly. Unfortunately, whatever the difference is with this device, that seems not to be the case. I'm sure if someone took a look at it it would be clear as a dd backup isn't exactly rocket science, but unfortunately I am far too preoccupied with my business and there isn't exactly a flourishing development scene for this phone
I'm bricking my device same way that you describe.... Restoring all partition that is possible to backup with TWRP. There is a way to put some files in the memory - "base folder" and something "no check ....." And seen a bunch of commands from "ADB shell" and it's restored. Will put a video of the process soon to be useful for anyone with not enough skills to bring back the device to live!
Thanks for checking in Ronin. Seeing as this is affecting multiple users it's good to get the word out so that new users don't end up messing up their device.
1. format of the "system" and "vendor" sections
2.restore only the "system" and "vendor"
3.restore only the "system image and vendor image"
4. restore the OEM
*otherwise it is a bootloop without OEM.
---------- Post added at 02:54 PM ---------- Previous post was at 02:52 PM ----------
i have used this order for restoring my phone succesfully.

HELP PLZ...Orangefox/twrp backups

I keep trying to do backups but it gets about half way through and the error 255. I don't understand what I'm doing wrong. Is it not possible to backup through twrp on xt1955-5. If not any suggestions on other means. Something that would include my accounts as well would be great. I have an google acct that google refuses to give back. Be cause they say can't verify. I know password but 2sv got messed up. Which is a bunch of bs. They track everything. I would prefer to never have to go through this again. Any help would be great.
First question. What all are you trying to backup? Second, to where? Third, do you have adequate space for said backup?
Also, if you have a pin or code enabled for access to the device I would disable it for the backup process.
I'm trying to back up system and data only to my ext sd with 50g avail but only needing 12g
Pbsipher1 said:
I'm trying to back up system and data only to my ext sd with 50g avail but only needing 12g
Click to expand...
Click to collapse
I was able to use TWRP to create a backup on an SD card. I'm running Android 10 and rom RR.
You might try other avenues like titanium or migrate. A quick internet search might lead you to a better procedure and app.
I've been having the same trouble. I just restored my XT1955-5 to stock RETAIL. Then installed TWRP and Magisk. I set my phone up as I like it, and want to back it up - everything I can possibly backup - boot, data, system, system image, efs, persist1, persist2, fsg, vendor, vendor image, dsp, and boot logo.
Before I tried to backup anything, I made sure that I mounted all of the partitions in TWRP.
The first few times I tried to back them all up at once, I got the error 255. So I started backing up the partitions one by one. The only partition that would NOT backup was the data partition. I still get the error 255 on the data partition backup. But all the others worked fine. I even went back and selected all the partitions except the data partition, and it backed up in one large backup just fine. So I don't know what the deal is with the data partition, but I can grab it with adb pull, so I guess I'm good to go.
I even booted back into the system and turned off the screen lock PIN - changed it to none. But I still couldn't backup the data partition via TWRP.
This should work for you from adb to backup your data partition:
Code:
adb push mmcblk0p64-data.img /dev/block/mmcblk0p64
Thanks tom2112 I'll give it a try what can it hurt. I also heard u have to be decrypted in order to backup data but can't seem to get decryption to stick
i was no able to backup using that command got
adb: error: stat failed when trying to push to /dev/block/mmcblk0p64: permission deni
Tom2112 said:
I've been having the same trouble. I just restored my XT1955-5 to stock RETAIL. Then installed TWRP and Magisk. I set my phone up as I like it, and want to back it up - everything I can possibly backup - boot, data, system, system image, efs, persist1, persist2, fsg, vendor, vendor image, dsp, and boot logo.
Before I tried to backup anything, I made sure that I mounted all of the partitions in TWRP.
The first few times I tried to back them all up at once, I got the error 255. So I started backing up the partitions one by one. The only partition that would NOT backup was the data partition. I still get the error 255 on the data partition backup. But all the others worked fine. I even went back and selected all the partitions except the data partition, and it backed up in one large backup just fine. So I don't know what the deal is with the data partition, but I can grab it with adb pull, so I guess I'm good to go.
I even booted back into the system and turned off the screen lock PIN - changed it to none. But I still couldn't backup the data partition via TWRP.
This should work for you from adb to backup your data partition:
Code:
adb push mmcblk0p64-data.img /dev/block/mmcblk0p64
Click to expand...
Click to collapse
ed
Hmm... if it is "permission denied" that sounds like you need root permissions to back it up. I'm sorry, but I'm not good enough with ADB to tell you how to get higher privs. Maybe ADB SHELL then SU, but I don't honestly know.

Restoring old backups

Dear all,
I wonder whether you have solutions to restore old TWRP backups (by old, I mean, of different security patch level). I failed to do it on my Mix 2S device. After restoration, the system simply fails to boot.
First backup everything on your phone to external storage (computer or usb drive).
Try wiping everything including data partition (the one where you have to type YES to format). Then reboot to recovery and format everything but data partition. If backup is on usb drive restore from it. If backup is on computer then copy it to phone and restore. If that doesn't work try installing the full rom and if it boots restore backup.
I find this new Android feature quite annoying, in fact. Previously, a restoration only costs me a bunch of minutes, but now, in order to format `/data` etc, I need to do it for at least several hours.

Stuck in recovery after rom update

Hello,
I just updated the rom Evolution X 11 on my Xiaomi Mi 9T Pro after using an older version for about half a year.
Now my phone does not boot anymore, its stuck in recovery (TWRP). Also all data seems to be encrypted and TWRP is not asking for a password.
Is there a way to get my phone to boot again or at least backup my data before I do a full wipe?
You should always do a full twrp backup before messing with roms.
The best solution would be to backup the "Data" and "Internal Storage" partitions. Data contains all apps, their appdata and settings, while internal storage contains all of your own files (photos, videos etc.). After you back these up, wipe your phone (system, data, cache, dalvik) and flash the version of evolution x you were using previously. Now restore data and internal storage and your device should be back to normal.
If you get a bootloop while booting after restoring data and internal storage, then wipe the device again and this time flash evolution x, but only restore internal storage. This way, it should boot and you will be able to recover your files, though your apps will be gone.
If you only restore internal storage then it will no doubt boot up and you will have access to your files, but since you'll have already backed up the important stuff (data + internal storage), you might as well try restoring data as well, as there is no harm, and if the phone boots correctly after restoring both partitions, your phone will be as it was before your updated your rom.
This happened a while back to me with my J5, the issue was that I made a full TWRP backup, then began to test other roms. After I was done, I tried to restore my backup, but it would constantly fail. I sat down for a while, confused and sad about how my TWRP backup had failed me. I tried every solution I could think of, eventually this solution I've mentioned in the above paragraph came to my mind. Thank god for putting it into my mind, otherwise I would've lost a lot of stuff (mainly whatsapp chats which werent backed up, and a lot of apps which I took the time to pain-stakingly configure in the best way for my device).
Anyways, enough of my story, hope this helps you out! If it does, message back here and let us know, and also mark my post as the solution if it was able to help you, so that anyone else who stumbles upon this thread can be saved too!
Cheers!
PhotonIce said:
You should always do a full twrp backup before messing with roms.
The best solution would be to backup the "Data" and "Internal Storage" partitions. Data contains all apps, their appdata and settings, while internal storage contains all of your own files (photos, videos etc.). After you back these up, wipe your phone (system, data, cache, dalvik) and flash the version of evolution x you were using previously. Now restore data and internal storage and your device should be back to normal.
If you get a bootloop while booting after restoring data and internal storage, then wipe the device again and this time flash evolution x, but only restore internal storage. This way, it should boot and you will be able to recover your files, though your apps will be gone.
If you only restore internal storage then it will no doubt boot up and you will have access to your files, but since you'll have already backed up the important stuff (data + internal storage), you might as well try restoring data as well, as there is no harm, and if the phone boots correctly after restoring both partitions, your phone will be as it was before your updated your rom.
This happened a while back to me with my J5, the issue was that I made a full TWRP backup, then began to test other roms. After I was done, I tried to restore my backup, but it would constantly fail. I sat down for a while, confused and sad about how my TWRP backup had failed me. I tried every solution I could think of, eventually this solution I've mentioned in the above paragraph came to my mind. Thank god for putting it into my mind, otherwise I would've lost a lot of stuff (mainly whatsapp chats which werent backed up, and a lot of apps which I took the time to pain-stakingly configure in the best way for my device).
Anyways, enough of my story, hope this helps you out! If it does, message back here and let us know, and also mark my post as the solution if it was able to help you, so that anyone else who stumbles upon this thread can be saved too!
Cheers!
Click to expand...
Click to collapse
Thank you for your help but backing up the data and internal storage doesnt seem possible right now because all the data is encrypted in TWRP...
If you can't backup anything, then wipe system, cache and dalvik, and flash the version of evolutionx you were previously using. Then boot, it should be fine. If it wont boot (give it some time, it will take the time of a fresh install), then this time wipe system+data+cache+dalvik, then flash whichever rom you like and you'll be able to access the files.
You can also try using platform tools and fastboot or adb ( i dont remember exactly which one) to copy the filess from your phone onto your pc.
Sorry if this doesn't apply to your situation, I've never used a phone which has been encrypted, as such I have no experience with them.
PhotonIce said:
If you can't backup anything, then wipe system, cache and dalvik, and flash the version of evolutionx you were previously using. Then boot, it should be fine. If it wont boot (give it some time, it will take the time of a fresh install), then this time wipe system+data+cache+dalvik, then flash whichever rom you like and you'll be able to access the files.
You can also try using platform tools and fastboot or adb ( i dont remember exactly which one) to copy the filess from your phone onto your pc.
Sorry if this doesn't apply to your situation, I've never used a phone which has been encrypted, as such I have no experience with them.
Click to expand...
Click to collapse
That sounds like a good idea. I found the old version on my PC.
Now I just need a way to install it... because twrp cant read the file. I tried with adb sideload but that results in an error for some reason. Flashing Magisk for example with adb sideload is possible.
Edit: Got it to work by using a tool called "Large Address Aware". Now waiting for the results...
PhotonIce said:
If you can't backup anything, then wipe system, cache and dalvik, and flash the version of evolutionx you were previously using. Then boot, it should be fine. If it wont boot (give it some time, it will take the time of a fresh install), then this time wipe system+data+cache+dalvik, then flash whichever rom you like and you'll be able to access the files.
You can also try using platform tools and fastboot or adb ( i dont remember exactly which one) to copy the filess from your phone onto your pc.
Sorry if this doesn't apply to your situation, I've never used a phone which has been encrypted, as such I have no experience with them.
Click to expand...
Click to collapse
This did not help unfortunately... Im still in the same recovery-bootloop and my data is still encrypted.
It's probably still bootlooping as the data partition got modified when you flashed the newer version of evolutionx, and now it will not work with the old one. You can try wiping system+data+cach+dalvik and then flashing any rom of your choice. This will give you access to your internal storage (photos, media etc), but it will remove your apps and their settings. Whatsapp images are stored in the internal storage so you won't need to worry about those.
Again, this is risky, as it may not work (I don't know much about encryption), or you might still not be able to access your files after flashing the new rom. Proceed at your own risk.
PhotonIce said:
It's probably still bootlooping as the data partition got modified when you flashed the newer version of evolutionx, and now it will not work with the old one. You can try wiping system+data+cach+dalvik and then flashing any rom of your choice. This will give you access to your internal storage (photos, media etc), but it will remove your apps and their settings. Whatsapp images are stored in the internal storage so you won't need to worry about those.
Again, this is risky, as it may not work (I don't know much about encryption), or you might still not be able to access your files after flashing the new rom. Proceed at your own risk.
Click to expand...
Click to collapse
Thank you for still helping me out but I already did a full reset yesterday. I did not lose much except for the time setting it all up again.
I still dont really get the point of encrypting all your data if you cant decrypt it even if you know the password...

Categories

Resources