how to fix twrp Backup & restore problem? - OnePlus 5T Questions & Answers

createTarFork() process ended with ERROR=255

First, make sure you disable finger print and change security to swipe or none. Also, make sure you are not encrypting your backup. I don't think that feature is working, at least it's not for me.

Download terminal emulator, then type
su
pm remove-user 999
That will delete all 999 folders which causes issues with TWRP, its a parallel app issues, so as long as u don't use parallel apps u r fine

the solution to this was to boot to your previous rom that u have made nandroid backup with and then setting up the same password/pin in settings > security. When you then boot into twrp it will ask you for the pin/password to decrypt your data partition and then you can flash the nandroid backup(you have to have the same password there). here it is obvious that you are trying to flash data partition that uses different encryption password (in case of stock rom there is non) and this obviously wont happen.

I sometimes have this issue if the TWRP backup gets stuck at the end of backing up /data. The only solution for me is fo abort and start the backup again. After 2 to 5 times it works.

Related

Password changes after TWRP backup/reboot (?)

Recently I started trying out a few custom nougat roms, and as the title says, if I choose to backup my current rom with TWRP (official 3.0.3), and reboot back to system, the password will have changed and some system settings will be reset (hardware keys swap)
As far as I can tell, data/data still has my app folders in it, so I'm not sure if all the apps are reset too. One thing to note is that the backup size for data partition was only 70mb.
I can't really tell if it was caused by rebooting or initiating the backup process.
Data is not encrypted.
Anyone have any ideas?
https://forums.oneplus.net/threads/fix-wrong-pin-pattern-when-restoring-twrp-nandroid-backup.452384/
I can't say anything about your backup,
but this is probably the solution for your password issue.
It is a known issue when restoring rom backups on the OP3.
So far I don't know a fix for this other than following the linked method.
For the future It is best you disable password / fingerprint before making a TWRP backup.
Be careful. It will delete the function of your Home Button (secon methode) and its not able to restore this function. So if youre going to delete the key.files you have the chance to enter the System but also have to go back to oos after back up your files -> the mega unbrick-thread
Its the best way to Backup your files before you restore the whole System if nothing's working.
www.howtogeek.com/240657/how-to-fix-pin-errors-after-restoring-from-twrp-android-backups/amp/

"Encryption Unsuccessful" Boot Loop after installing TWRP.

So I decided to take my first steps to rooting, custom recoveries and ROMs and followed a stickied thread on the OnePlus forums here.
I firstly downgraded from Nougat to Marshmallow using the official Stock ROM. Afterwards, I flashed the recovery.img for TWRP from the official TWRP site. All is good.
I boot into TWRP and it asks me for a decryption password, I enter it and get "Incorrect Password". I try to boot normally and the same thing happens - weird. One member on another forum, from another question, suggested to wipe data through TWRP, and so I did. This cleared the decryption message through TWRP but then I got a boot loop with a simple message of "Decryption Unsuccessful". I press reset and the phone repeats everything.
Anywho, I flashed stock recovery and a fresh Marshmallow ROM which sorted my phone back to safeland.
Question is, how can I bypass all this? I followed the guide to the tee but no mention of this. I'm a n00b to flashing and only really know as far as the instructions on the OnePlus support page for flashing a stock ROM.
Use TWRP 3.0.4-1, it has decryption support.
If you are planning on rooting with SuperSU, use v2.79, not the first one that pops up when you Google "SuperSU". Not sure why, but the first link that pops up on Google directs you to an older version on Chainfire's site, which causes bootloops if you flash it on Nougat.
Other than the versions of the above files, the steps in rooting are the same as in the original guide.
I personally keep my phone decrypted, since I don't have anything super important on it. Not only do I not run into any encryption issues, the phone boots faster is decrypted. Decrypting does have its downsides though (you have to wipe your phone, also less security), so I would recommend that you research about it some more prior to deciding. There are methods of decrypting without losing all data though.
Anova's Origin said:
Use TWRP 3.0.4-1, it has decryption support.
If you are planning on rooting with SuperSU, use v2.79, not the first one that pops up when you Google "SuperSU". Not sure why, but the first link that pops up on Google directs you to an older version on Chainfire's site, which causes bootloops if you flash it on Nougat.
Other than the versions of the above files, the steps in rooting are the same as in the original guide.
I personally keep my phone decrypted, since I don't have anything super important on it. Not only do I not run into any encryption issues, the phone boots faster is decrypted. Decrypting does have its downsides though (you have to wipe your phone, also less security), so I would recommend that you research about it some more prior to deciding. There are methods of decrypting without losing all data though.
Click to expand...
Click to collapse
Thanks for the reply. I agree with you, I'm not fussed about Encryption and would rather have my device decrypted, the problem is I'm not sure how to decrypt it, or if it would be possible to revert and re-encrypt afterwards. As far as I know, Encryption is enabled by default on anything Marshmallow. In addition whether Decrypting would cause further issues down the line.
My reasoning for reverting to Marshmallow was Xposed and is the main reason I'd like to root with the possibility of flashing a new ROM.
In reply to your other points, I used the official TWRP from here if that makes a difference or should I be using the build you provided, surely if I can decrypt my device it makes it pointless for something with decryption support, yes?
Nonetheless, appreciate the reply!
The TWRP build from the official site is a little outdated, it is known to have decryption issues. Try the one from the XDA page.
To decrypt, you have to either root or flash a dm-verity-no-encrypt.zip that is floating somewhere around on XDA, there's probably a copy of it in the root guide in your first post. If you have no data on your phone that you mind losing (after saving a copy somewhere off your phone), the easiest way to decrypt is to go into TWRP and wipe your /data partition. If your phone is rooted or flashed with the no-encrypt.zip, the /data partition will not be encrypted the next time you boot.
There is a way to decrypt while maintaining your data, you can follow this guide. It involved saving a nandroid (saves all info in /data partition except /data/media, where all your media files and certain app data is stored). You can then save anything in /data/media by transferring it to your computer prior to wipe. You can actually restore a nandroid from an encrypted phone onto the same decrypted phone without having all your files encrypted. You can then transfer all your files from the /data/media folder back to your phone, though you'll need to give all the files and folders the proper permissions.
Once decrypted, you phone will remain decrypted until you flash OOS again, such as when updating. To prevent the phone from automatically encrypting its /data partition, you'll have to flash SuperSU or the no-encrypt.zip immediately after flashing an OOS ROM everytime you flash it.
If at some point down the road, you'd like to encrypt your phone again, that's really easy. You can go into the settings app -> secuity -> scroll to bottom to "encrypt". Clicking that option will encrypt your phone without data loss.
I personally have not had any issues after decrypting my phone. I can't speak for others though.
Anova's Origin said:
The TWRP build from the official site is a little outdated, it is known to have decryption issues. Try the one from the XDA page.
To decrypt, you have to either root or flash a dm-verity-no-encrypt.zip that is floating somewhere around on XDA, there's probably a copy of it in the root guide in your first post. If you have no data on your phone that you mind losing (after saving a copy somewhere off your phone), the easiest way to decrypt is to go into TWRP and wipe your /data partition. If your phone is rooted or flashed with the no-encrypt.zip, the /data partition will not be encrypted the next time you boot.
There is a way to decrypt while maintaining your data, you can follow this guide. It involved saving a nandroid (saves all info in /data partition except /data/media, where all your media files and certain app data is stored). You can then save anything in /data/media by transferring it to your computer prior to wipe. You can actually restore a nandroid from an encrypted phone onto the same decrypted phone without having all your files encrypted. You can then transfer all your files from the /data/media folder back to your phone, though you'll need to give all the files and folders the proper permissions.
Once decrypted, you phone will remain decrypted until you flash OOS again, such as when updating. To prevent the phone from automatically encrypting its /data partition, you'll have to flash SuperSU or the no-encrypt.zip immediately after flashing an OOS ROM everytime you flash it.
If at some point down the road, you'd like to encrypt your phone again, that's really easy. You can go into the settings app -> secuity -> scroll to bottom to "encrypt". Clicking that option will encrypt your phone without data loss.
I personally have not had any issues after decrypting my phone. I can't speak for others though.
Click to expand...
Click to collapse
Brilliant. On a side note, I'm sure I did a /data wipe, which caused the boot loop I was having - weird. Anywho, I'll try the TWRP build you mentioned and see how I get on. I did watch one video which suggested to use the fastboot erase userdata as another way of unencrypting the phone.
Either way I'll give it all a try!
Anova's Origin said:
The TWRP build from the official site is a little outdated, it is known to have decryption issues. Try the one from the XDA page.
To decrypt, you have to either root or flash a dm-verity-no-encrypt.zip that is floating somewhere around on XDA, there's probably a copy of it in the root guide in your first post. If you have no data on your phone that you mind losing (after saving a copy somewhere off your phone), the easiest way to decrypt is to go into TWRP and wipe your /data partition. If your phone is rooted or flashed with the no-encrypt.zip, the /data partition will not be encrypted the next time you boot.
There is a way to decrypt while maintaining your data, you can follow this guide. It involved saving a nandroid (saves all info in /data partition except /data/media, where all your media files and certain app data is stored). You can then save anything in /data/media by transferring it to your computer prior to wipe. You can actually restore a nandroid from an encrypted phone onto the same decrypted phone without having all your files encrypted. You can then transfer all your files from the /data/media folder back to your phone, though you'll need to give all the files and folders the proper permissions.
Once decrypted, you phone will remain decrypted until you flash OOS again, such as when updating. To prevent the phone from automatically encrypting its /data partition, you'll have to flash SuperSU or the no-encrypt.zip immediately after flashing an OOS ROM everytime you flash it.
If at some point down the road, you'd like to encrypt your phone again, that's really easy. You can go into the settings app -> secuity -> scroll to bottom to "encrypt". Clicking that option will encrypt your phone without data loss.
I personally have not had any issues after decrypting my phone. I can't speak for others though.
Click to expand...
Click to collapse
Thought I'd post a little update, I managed to install TWRP and Root. I used fastboot erase userdata which fixed my decryption issue - everything was working! Back to stock Nougat now but am going to be trying Magisk.

If I TWRP backup everything except System will a Restore work later on?

I dont know what I did but I know it was my fault.
Whenever I try to create a full backup of all partitions I get "createTarFork() process ended with ERROR=255"
But when I exclude the System partition it works fine.
So if I restore everything else later on will everything work fine? I'm not exactly sure whats getting left out in the partition.
Btw, my bootloader is unlocked, I'm currently on FreedomOS 2.1, I have Magisk, Xposed, all the good stuff...
ALSO! I did an ADB backup on my computer with "adb backup -apk -shared -all -system -f"
I'd be fine with the ADB backup but "backup.ab is only 1.5 GB and my nandroid backups are usually around 11GB...
lit_lee said:
I dont know what I did but I know it was my fault.
Whenever I try to create a full backup of all partitions I get "createTarFork() process ended with ERROR=255"
But when I exclude the System partition it works fine.
So if I restore everything else later on will everything work fine? I'm not exactly sure whats getting left out in the partition.
Btw, my bootloader is unlocked, I'm currently on FreedomOS 2.1, I have Magisk, Xposed, all the good stuff...
ALSO! I did an ADB backup on my computer with "adb backup -apk -shared -all -system -f"
I'd be fine with the ADB backup but "backup.ab is only 1.5 GB and my nandroid backups are usually around 11GB...
Click to expand...
Click to collapse
Team Win recommends using the system image backup instead of just system for dm-verity devices, but I still get the same problem as you when trying to perform a backup. What you could try is clean flashing the ROM and then just restore data from ur backup. That should work.
Airwolf79 said:
Team Win recommends using the system image backup instead of just system for dm-verity devices, but I still get the same problem as you when trying to perform a backup. What you could try is clean flashing the ROM and then just restore data from ur backup. That should work.
Click to expand...
Click to collapse
Yeah I read in other places a fresh flash would work but I wanted to weight my options.
How does one go about doing the image backup? That sounds a lot better.
lit_lee said:
Yeah I read in other places a fresh flash would work but I wanted to weight my options.
How does one go about doing the image backup? That sounds a lot better.
Click to expand...
Click to collapse
When you select backup in TWRP, it's one of the available boxes to check. Uncheck system, check system image. This hasn't solved my problem of backups not completing though. I always remove my fingerprints and pin before a backup, and I've been able to complete backups before, but usually the problem lies in encrypting the backup itself. However, I've still had backups hang at 95% even without encryption. Maybe someone else can shed some light on to why this is happening.
the createTarFork() process ended with ERROR=255 is not from system its from data and issues with parallel apps on ur OP5T
download Android Terminal and type
Code:
su
pm remove-user 999
then u can backup with twrp, never tried to do a restore yet though

[UNOFFICIAL][ARM64] TWRP 3.2.3-2 with decrypt [cedric]

Hello
This is a TWRP recovery for Motorola Moto G5 Cedric for arm64 ROMS, with encryption support, backup support for persist and efs partitions and possibility to flash/backup logo boot image.
I need review and test, especially for the storage decryption and/with LineageOS fingers-crossed. I was able to test it on my device (XT1676 3Go).
It is my first ROM so it is possible that there are bugs.
- Be carefull, there are problems with the backup system :
Just wish to come here and tell you guys to AVOID using this recovery, it seems to have a serious bug.
I just backed up my entire data partition (and enable digest verification) and restored the partition afterwards and the phone didn't boot.
Then I tried restoring it with verification enabled and the hashes didn't match.
In other words, for some reason, the generated backup was corrupt.
- freeZbies
Click to expand...
Click to collapse
Changelog
TWRP 3.2.3-2
add sdcardfs
add FB2PNG for screenshot
fix brightness path and define it at 160
fix time zone error
fix incorrect lun path for USB
You can download it here :
TWRP 3.2.3-2 (md5: 0dbd3846593ae907d3391596876c1f35)
TWRP 3.2.3-1 (md5: 404b54d27653b5a1ec5b59023f53d3cb)
TWRP 3.2.3-0
Sources :
https://github.com/Akipe/twrp_android_device_motorola_cedric
https://github.com/Akipe/twrp_android_device_motorola_msm8937-common
Manifest :
https://github.com/Akipe/android_development_manifest
Would it be possible for you to compile a version capable of backing up all partition, including persist and efs? see here: https://forum.xda-developers.com/showpost.php?p=78695191&postcount=95
Guttergorm said:
Would it be possible for you to compile a version capable of backing up all partition, including persist and efs? see here: https://forum.xda-developers.com/showpost.php?p=78695191&postcount=95
Click to expand...
Click to collapse
Hi!
Sorry for the delay, I added the functions you wanted. Can you try and tell me if everything is ok?
Hi,
tested your recovery image with my installed LOS 15.1. (32bit) Device: XT1676 16GB P5
- storage decryption: OK
- backup support for persist and efs partitions and possibility to flash/backup logo boot image: OK
nice work, thx for you effort
mikefive said:
Hi,
tested your recovery image with my installed LOS 15.1. (32bit) Device: XT1676 16GB P5
- storage decryption: OK
- backup support for persist and efs partitions and possibility to flash/backup logo boot image: OK
nice work, thx for you effort
Click to expand...
Click to collapse
Thx for testing :good:
Akipe can u help us to build treble rom for cedric???
Works nicely, thanks.
I just tested it and it decrypts my internal storage normally.
Just wish to come here and tell you guys to AVOID using this recovery, it seems to have a serious bug.
I just backed up my entire data partition (and enable digest verification) and restored the partition afterwards and the phone didn't boot.
Then I tried restoring it with verification enabled and the hashes didn't match.
In other words, for some reason, the generated backup was corrupt.
Of course I could make another test but it'll take just a long time to backup everything again, so if anyone wants to test it, feel free, but beware, you could have a hell of a headache finding out the backups you made were useless.
freeZbies said:
Just wish to come here and tell you guys to AVOID using this recovery, it seems to have a serious bug.
I just backed up my entire data partition (and enable digest verification) and restored the partition afterwards and the phone didn't boot.
Then I tried restoring it with verification enabled and the hashes didn't match.
In other words, for some reason, the generated backup was corrupt.
Of course I could make another test but it'll take just a long time to backup everything again, so if anyone wants to test it, feel free, but beware, you could have a hell of a headache finding out the backups you made were useless.
Click to expand...
Click to collapse
Hello ! Thank you for your test and sorry for your backup
I will test the backup system and add a warning
freeZbies said:
Just wish to come here and tell you guys to AVOID using this recovery, it seems to have a serious bug.
I just backed up my entire data partition (and enable digest verification) and restored the partition afterwards and the phone didn't boot.
Then I tried restoring it with verification enabled and the hashes didn't match.
In other words, for some reason, the generated backup was corrupt.
Of course I could make another test but it'll take just a long time to backup everything again, so if anyone wants to test it, feel free, but beware, you could have a hell of a headache finding out the backups you made were useless.
Click to expand...
Click to collapse
I have backup up data partition from my TWRP, reboot one time to recovery, restore the data backup with digest verification, and reboot to LineageOS, with no problem (my rom is LineageOS 16.0 without encryption.)
I think there may be 2 errors (maybe more) :
1) There is a problem with data restore when encryption is enable. I can not test this scenario for now, but i will do it as soon as i can
2) Was your backup stored on your SD card? if so, it is possible that the sd card may be damaged, because it is too old or of poor quality (more info here : https://photo.stackexchange.com/questions/40489/what-causes-an-sd-card-to-go-corrupt )
if you have other information or other ideas, do not hesitate to share it!
if people want to participate, try to save the data partition and restore it, especially with the encrypted partition :good::good:
be careful, make a backup of your data before test
Akipe said:
I have backup up data partition from my TWRP, reboot one time to recovery, restore the data backup with digest verification, and reboot to LineageOS, with no problem (my rom is LineageOS 16.0 without encryption.)
I think there may be 2 errors (maybe more) :
1) There is a problem with data restore when encryption is enable. I can not test this scenario for now, but i will do it as soon as i can
2) Was your backup stored on your SD card? if so, it is possible that the sd card may be damaged, because it is too old or of poor quality (more info here : https://photo.stackexchange.com/questions/40489/what-causes-an-sd-card-to-go-corrupt )
if you have other information or other ideas, do not hesitate to share it!
if people want to participate, try to save the data partition and restore it, especially with the encrypted partition :good::good:
be careful, make a backup of your data before test
Click to expand...
Click to collapse
I agree it may be any of the 2 problems.
My data partition was indeed encrypted, and yes, my SD card is not what I would call genuine, though I think that's not the case since the card is relatively new and I never had any problem related to data corruption.
Anyways, thanks for your effort.
freeZbies said:
I agree it may be any of the 2 problems.
My data partition was indeed encrypted, and yes, my SD card is not what I would call genuine, though I think that's not the case since the card is relatively new and I never had any problem related to data corruption.
Anyways, thanks for your effort.
Click to expand...
Click to collapse
I have test backup the data partition with encryption on LineageOS 16 (arm64), backup and restore work without issue
What ROM did you use when you made the backup, and with what arch (arm or arm64) ?
Akipe said:
I have test backup the data partition with encryption on LineageOS 16 (arm64), backup and restore work without issue
What ROM did you use when you made the backup, and with what arch (arm or arm64) ?
Click to expand...
Click to collapse
I was on stock oreo, so its arm, not arm64
freeZbies said:
I was on stock oreo, so its arm, not arm64
Click to expand...
Click to collapse
Oh ok, there are chances that's why the backup did not work .
This recovery is mainly intended for arm64 rom !
Just wanted to say that everything worked well for me in backing up and restoring the OmniROM, on both decrypted and encrypted phone.
Thanks @Akipe for the great job
Can you update it to latest TWRP?
Sent from my cedric using XDA Labs
forgot password to decrypt??
hi,
first, sorry if this is the wrong place to post this. right now, when i install the 64 bit twrp i am asked for a password to decrypt my data. i have tried some passwords i think i would have used, but those don't work and i get a message also saying that the default password didn't work - i haven't typed a default password, though, so i assume there is a default one that twrp tries automatically. in the past, i did try a rom requiring 64 bit twrp and i am guessing i set a password other then the default to encrypt/decrypt, but i went back to stock without issues so have not thought about the password and cannot remember what i would have used. i wanted to try dotos on my phone, which i assume requires 64 twrp because i got error 255 when i tried to flash without twrp64. so i installed twrp64 but cannot get any further. so here are my questions:
is there any way to decrypt the data if i forgot my password?
if not, can i format the data while encrypted to install the new rom? if i can do that, what should i back up? i have pictures and other necessary files backed up, so i am not worried about completely wiping the phone to start over. however, should i back anything else up before formatting? do i need to worry about losing imei or losing any partitions that would make phone inoperable or not have any signal? should i back up with twrp64 or the non-64 bit twrp currently installed? any help or point in the right direction is greatly appreciated.
tia,
nurvus
nurvus said:
hi,
first, sorry if this is the wrong place to post this. right now, when i install the 64 bit twrp i am asked for a password to decrypt my data. i have tried some passwords i think i would have used, but those don't work and i get a message also saying that the default password didn't work - i haven't typed a default password, though, so i assume there is a default one that twrp tries automatically. in the past, i did try a rom requiring 64 bit twrp and i am guessing i set a password other then the default to encrypt/decrypt, but i went back to stock without issues so have not thought about the password and cannot remember what i would have used. i wanted to try dotos on my phone, which i assume requires 64 twrp because i got error 255 when i tried to flash without twrp64. so i installed twrp64 but cannot get any further. so here are my questions:
is there any way to decrypt the data if i forgot my password?
if not, can i format the data while encrypted to install the new rom? if i can do that, what should i back up? i have pictures and other necessary files backed up, so i am not worried about completely wiping the phone to start over. however, should i back anything else up before formatting? do i need to worry about losing imei or losing any partitions that would make phone inoperable or not have any signal? should i back up with twrp64 or the non-64 bit twrp currently installed? any help or point in the right direction is greatly appreciated.
tia,
nurvus
Click to expand...
Click to collapse
You need to format data
Push back button when it asks for decrypt
Goto wipe and select the option on the right to format data
This will erase everything on internal storage so copy any files you want to keep to pc first (pictures music etc)
Once formatted data restart back to recovery to check encryption has been removed and data partition is mountable
TWRP backups do not save personal files (pictures music etc) They only backup data and system files (and other named partitions)
Once you have flashed a new rom you can encrypt again if you want to via the security settings menu in phone settings
TheFixItMan said:
You need to format data
Push back button when it asks for decrypt
Goto wipe and select the option on the right to format data
This will erase everything on internal storage so copy any files you want to keep to pc first (pictures music etc)
Once formatted data restart back to recovery to check encryption has been removed and data partition is mountable
TWRP backups do not save personal files (pictures music etc) They only backup data and system files (and other named partitions)
Once you have flashed a new rom you can encrypt again if you want to via the security settings menu in phone settings
Click to expand...
Click to collapse
thanks for the quick response! and just for clarification and for me to be sure, should i back up any partitions before formatting? right now i have 32 (or non64 i guess) bit twrp installed, stock rom and bootloader unlocked. do i need to take any precautions with data/imei/signal before reinstalling twrp64, formatting data, and installing a new rom? if it matters any i have the international version of the moto g5. thanks again!!
nurvus
nurvus said:
thanks for the quick response! and just for clarification and for me to be sure, should i back up any partitions before formatting? right now i have 32 (or non64 i guess) bit twrp installed, stock rom and bootloader unlocked. do i need to take any precautions with data/imei/signal before reinstalling twrp64, formatting data, and installing a new rom? if it matters any i have the international version of the moto g5. thanks again!!
nurvus
Click to expand...
Click to collapse
Backup efs if you want to preserve your current emei state or need to restore it in future

xiaomi mi a2 lite how to take full backup with TWRP or any other method

hello
as title is showing i want to take to take full backup with TWRP or any other method and restore whenever i want it if something happens
like
rom with data for example contains
installed apps,contacts,photos...etc
thanks
I don't have TWRP so I backup my data using Migrate.
owais16 said:
hello
as title is showing i want to take to take full backup with TWRP or any other method and restore whenever i want it if something happens
like
rom with data for example contains
installed apps,contacts,photos...etc
thanks
Click to expand...
Click to collapse
Google back-up is integrated on the phone and does a great job.
Stores app list + app data to be restored on a later date.
Sync contacts, calling lists and messages in your cloud.
Photos are getting stored in the cloud also, you just need to make sure you selected the right settings in the Photos app.
I have a paid subscription to Google for just 10 euros per month and I have 60gb of storage on their cloud, more than I need, and all the data from the phone is going there. If for some reason I change even brands, my data will migrate to the new device without any worries.
Also, with TWRP is pretty damn straight forward. Get TWRP, click back-up, select storage for the back-up and wait. You can select what partitions you want to back-up and that's it. But note that, this back-up is only for your device and that's about it. Also installing TWRP tampers with your system and may affect OTAs.
I use a combination of titanium backup and rsync for off-device backup of apps and data. Very custom. It's not complete but it's close enough for me. Takes about an hour to put everything back when I break the phone.
Because of the encryption, you can't do a 'nandroid' (raw) backup of the data partition and restore it later. You'll need some extra partitions for the encryption keys, and that's assuming there isn't an on-SoC flash chip involved.
I suspect it would be feasible to just tarball the decrypted data partition and restore that afterwards, though that would be a bit non-trivial to restore.
Complete RAW Storage Backup/Restore using TWRP & ADB
EDIT: Apologies, confirmed as per @a1291762 above that it complains about encryption after restoring the backup image, even if encryption was turned off before backing up.
You can do a raw dump of the entire storage, but the output file will be the total size of your storage (e.g. 32GB - which you could zip on your PC to save space).
You can also then restore that raw image back to the phone. I've confirmed this works with my older Redmi 2. Haven't yet confirmed the restore process on my Mi A2 Lite, but it does back up fine.
Connect phone to PC with USB and reboot to bootloader
Boot into TWRP using "fastboot boot [twrp-xxxx.img]" (e.g. "fastboot boot twrp-3.3.1-dees_troy-daisy.img")
Confirm phone is available in recovery mode using "adb devices" command (it'll show serial # and "recovery")
[To Back Up] Type in "adb pull /dev/block/mmcblk0 backup.img"
[To Restore] Type in "adb push backup.img /dev/block/mmcblk0"
Reboot to System from TWRP menu
I suggest running your CMD window (or Minimal ADB and Fastboot) as Admin to avoid write issues to that folder.
The backup image (backup.img) can be opened/extracted with 7zip, as well as some contained partition images.

Categories

Resources