Can't restore TWRP backup - Nexus 4 Q&A, Help & Troubleshooting

I have two N4s with broken screens, one of which has USB debugging enabled etc.
I created a TWRP backup of boot, system & data on the one with USB enabled and transferred it over to the other one.
I now can't restore that backup. I have to use TWRP's open recovery script in an ADB shell because the screens are broken. I am using:
Code:
adb shell twrp restore /data/media/0/TWRP/BACKUPS/"serial no"/
but which initially works, then says "no partitions selected for restore".
If I put "SDBM" after the path, it says "setting restore options: SDBM" then the same thing - "no partitions selected for restore".
If I put "SDBM" after "restore" i.e. before the path name it says "Restoring SDBM... Unable to locate backup 'SDBM'"
I can't find any help via google and I'm stuck now - how can I restore a backup with adb shell twrp?

mrmrchoice said:
I have two N4s with broken screens, one of which has USB debugging enabled etc.
I created a TWRP backup of boot, system & data on the one with USB enabled and transferred it over to the other one.
I now can't restore that backup. I have to use TWRP's open recovery script in an ADB shell because the screens are broken. I am using:
Code:
adb shell twrp restore /data/media/0/TWRP/BACKUPS/"serial no"/
but which initially works, then says "no partitions selected for restore".
If I put "SDBM" after the path, it says "setting restore options: SDBM" then the same thing - "no partitions selected for restore".
If I put "SDBM" after "restore" i.e. before the path name it says "Restoring SDBM... Unable to locate backup 'SDBM'"
I can't find any help via google and I'm stuck now - how can I restore a backup with adb shell twrp?
Click to expand...
Click to collapse
From what you wrote, I see that you provided the path to the backup directory instead of to the specific backup directory.
Your path is too short because it does not contain the name of the directory that was created during the backup.
If possible, always try to paste a significant piece of text from the terminal where you performed the action, it really makes it easier to find a solution.

ze7zez said:
From what you wrote, I see that you provided the path to the backup directory instead of to the specific backup directory.
Your path is too short because it does not contain the name of the directory that was created during the backup.
If possible, always try to paste a significant piece of text from the terminal where you performed the action, it really makes it easier to find a solution.
Click to expand...
Click to collapse
Hi, thanks, I got there not long after I posted this HOWEVER adding the specific backup directory now gives me an error about digest verification (I didn't generate an MD5 hash when I made the backup). This is when trying to restore using the same flag that I used to skip MD5 generation when I made the backup.
It asks me to deselect digest verification but I can't do that on the touch screen (as it's broken) and don't know if it's possible to do this via abd?
Thanks!

Related

Nandroid Question

I recently did a nandroid backup and it worked. I then flashed a theme that I thought I liked but didn't so I ended up using the restore nandroid process in recovery mode and it worked. I then changed the name of the first folder inside of the Nandroid folder so I know which ROM it is. I then ended up flashing another theme that I did not like. I tried to do a nandroid restore but this time I get an error says to do "nandroid-mobile.sh restore" or something like that from ADB.
How do I do the restore from ADB? I would use the CMD correct? I tried looking for possible command using CMD but could find nothing. Anyone know why this happened. Why I get this error? I use to get this error all the time on my G1 so I instead would use SwitchRom, but does anyone know if a SwitchRom exists for NexusOne?
I got this same error tonight!
unfortunately my computer no longer recognises my nexus one in either windows or linux, so i can't use ADB anymore.
MFK DGAF said:
I recently did a nandroid backup and it worked. I then flashed a theme that I thought I liked but didn't so I ended up using the restore nandroid process in recovery mode and it worked. I then changed the name of the first folder inside of the Nandroid folder so I know which ROM it is. I then ended up flashing another theme that I did not like. I tried to do a nandroid restore but this time I get an error says to do "nandroid-mobile.sh restore" or something like that from ADB.
How do I do the restore from ADB? I would use the CMD correct? I tried looking for possible command using CMD but could find nothing. Anyone know why this happened. Why I get this error? I use to get this error all the time on my G1 so I instead would use SwitchRom, but does anyone know if a SwitchRom exists for NexusOne?
Click to expand...
Click to collapse
if you are using RA recovery, just open CMD and type
Code:
adb shell
# switchrom
when you are in recovery... from there you can do what you need to do... but if you are only restoring a nandroid, use BART (also built into RA recovery)
Code:
adb shell
# bart
a list of options will come up, for nandroid backup i think it is just
Code:
bart -n
but im not entirely sure.
you can also restore the backup from the actual recovery... scroll down to nandroid/backup and then choose bart nand restore or whatever the option is.
Sometimes that happens to me when my phone is low on battery try fully charging your phone.
Does changing the name somehow cause this problem?
I have noticed that when you change the name of the folder that contains the nandroid backup it will fail to restore it.
McFroger3 said:
I have noticed that when you change the name of the folder that contains the nandroid backup it will fail to restore it.
Click to expand...
Click to collapse
The name of the folder has to be "Nandroid" or its will not properly restore. I never had to noticce this, it was actually obviously since the G1 days.. don't know how I already knew.
You'll get that error if you battery is <30%
Full charge when you flash people, full charge.
(Edit: and search)

[Solved] cant restore nand backup

if in recovery use "Nand restore" i get "Error: run ' nandroid- mobile. sh restore ' via console!"
i connect to Hero via adb, i use "cd" to navigate to folder where backup is (/sdcard/nandroid/HT97WL903118/BDES-20100917-2023/) but when i run
"nandroid-backup.sh restore"
and i press enter i get this:
"nandroid.md5 not found, cannot verify backup data"
i try search it but in nandroid folder i found only 3 files (boot.img data.img system.img) in folder /sdcard/nandroid/HT97WL903118/BDES-20100917-2023/
Did you rename the backup?
If you did, change it back (their name is the time and date they were made, go on properties to find out.)
If not, you may have no option but to ask a dev to apply it to a MOD...
I'm not that good at giving advice but I have had the same problem and did solve it.
i dont rename anything or change
Create the .md5 manually. There are plenty of programs that can create md5 hashes from files, google for them. Create another nanodrid snapshot and see how the file is formated. Then just apply it to the backup you wish to restore.
i "cd" to folder where is images, run "md5sum *img > nandroid.md5" and everything seems fine now, thanks for help

Unable to restore my phone

Hi
I did a backup with nexus 4 toolkit before rooting but now when I try to restore my backup it starts backing up but just 1 app and then reeboots without adding any of the other apps. Anyone know an alternate method or whats wrong?
c2h5oh2 said:
Hi
I did a backup with nexus 4 toolkit before rooting but now when I try to restore my backup it starts backing up but just 1 app and then reeboots without adding any of the other apps. Anyone know an alternate method or whats wrong?
Click to expand...
Click to collapse
thats reason # 84261 why you should never use a toolkit.
Well, whats done is done. It seems like it tries to recover some system file that causes a reebot. I will try to restore from recovery mode if the bootloader can restore .ab-files.
Failed to restore .ab file in bootloader. Does anyone have any idea how I can restore the .ab file?
Why would you want to go back to stock? You want to get back the apps you had?
I guess you will have to re-download them... This is what I did : I made a Titanium backup save for my apps, before rooting, and restored it, after rooting.
To restore .ab files install adb and open a command window (or a terminal on linux). Then navigate to the folder where the .ab file is or open the command window there. Connect your phone now powered on to your PC and be sure unknown sources and usb debugging are enabled
Now type
Code:
adb restore nameofyourbackup.ab
Unlock your device, confirm the restore and wait until it has finished
Sent from my Nexus 4 running Android 4.2.2
I shouldn't have used a toolkit :S
I'm having the same issue, I used the toolkit, created a backup from all apps (including system and data) in a .BAK, unlocked, rooted, and now I try to restore with the toolkit, the process triggers my phone's backup but then it restarts and nothing has been restored! I tried HOLO Backup as well, and I'm trying with the SDK method right now.
Is .BAK compatible with full backup? Is there any other way (other than ADB) to restore my info?
Thanks
Edit: Trying with SDK as command prompt didn't recognize adb as a valid command.
Edit: SDK did not work, I guess I just did the same in 3 different ways... any ideas?
Got it!
Titanium tools pro version has an ADB backup extraction. Move the .BAK file to your SD card folder, and then restore the extracted info

createTarFork() process ended with ERROR: 255 on backup

Hiya XDA, So i'm trying to back up my phone (Running CM13) to my memory stick, and it worked before, but now it seems to have broken and I don't know what the issue is. My log (adb pull /tmp/recovery.log) is below
Heres what I've tried
Reflashing TWRP
Going to a slightly older version (3.0.2-1)
Enabling and disabling encryption
with and without compression
Skipping MD5 and leaving it on
[BACKUP STARTED]
* Backup Folder: /usb-otg/TWRP/BACKUPS/ENU7N15A10005575/2016-12-10--16-58-06_cm_angler-userdebug_6.0.1_MOB30Z_b4fbca03c0/
Backing up Boot...
I:Reading '/dev/block/mmcblk0p34', writing '/usb-otg/TWRP/BACKUPS/ENU7N15A10005575/2016-12-10--16-58-06_cm_angler-userdebug_6.0.1_MOB30Z_b4fbca03c0/boot.emmc.win'
Iartition Backup time: 4
Backing up System...
Error opening: '/system/addon.d' (Not a directory)
I:Error in Generate_TarList!
Error creating backup.
I:InfoManager saving '/usb-otg/TWRP/BACKUPS/ENU7N15A10005575/2016-12-10--16-58-06_cm_angler-userdebug_6.0.1_MOB30Z_b4fbca03c0/system.info'
createTarFork() process ended with ERROR: 255
Backup Failed. Cleaning Backup Folder.
I:Copying file /tmp/recovery.log to /usb-otg/TWRP/BACKUPS/ENU7N15A10005575/recovery.log
I:Set page: 'action_complete'
Iperation_end - status=1
E:error opening '/usb-otg/LOST.DIR' -- error: No such file or directory
E:error opening '/usb-otg/TWRP' -- error: No such file or directory
Looks as though your memory stick isn't formatted correctly. Try Fat32 or possibly EXT4
It is Fat32?
frap129 said:
Looks as though your memory stick isn't formatted correctly. Try Fat32 or possibly EXT4
Click to expand...
Click to collapse
I don't have access to a Linux machine, but I could format it in my phone?
I'll try that. and will post any updates.
UPDATE:
Formatted it in Android, still same error
UPDATE 2:
Tried a different USB stick, same error.
The USB sticks I am using are:
amazon.com/SanDisk-Cruzer-Orbit-Drive-SDCZ58-032G-B35/dp/B00BPHTH4C
and
amazon.com/SanDisk-Ultra-Flair-Performance-SDCZ73-064G-G46/dp/B015CH1NAQ/
Remove /system/addon-d in twrp ?
Will my phone work properly after doing that?
UPDATE:
Renamed it to addon-dee in my prefered Filemanager (ES) and it's backing up now.
(thank god I decided to use a USB3 stick this time)
UPDATE 2:
Phone backed up and now is working fine! thanks.
I was having the same error until I updated TWRP to the unofficial 3.0.2-3
I have this problem and l have 17g free space in my internal storage but receive error 255 and i don't find addon in my storage plz help me for fixing this error
Sent from my Le X820 using XDA-Developers mobile app
m890 said:
I have this problem and l have 17g free space in my internal storage but receive error 255 and i don't find addon in my storage plz help me for fixing this error
Sent from my Le X820 using XDA-Developers mobile app
Click to expand...
Click to collapse
Should be under /system/ . Are you rooted? I don't know if you can see that part of system if you're not rooted.
My device is rooted but this file isn't there.
Sent from my Le X820 using Tapatalk
m890 said:
I have this problem and l have 17g free space in my internal storage but receive error 255 and i don't find addon in my storage plz help me for fixing this error
Sent from my Le X820 using XDA-Developers mobile app
Click to expand...
Click to collapse
It's not always the same file. Look at your log to see which file/dir is problematic.
SOLVED createTarFork() process ended with ERROR=255
SOLUTION
This solution worked on my Zenfone 3, running lineage Android 7.1.2.
I tried many other things, like flashing different versions of TWRP, deleting the recovery directory, renaming files and all the like.
You may deselect compression, change the TWRP-date / time : nothing works !
You need an PC / Notebook with adb installed.
- start your phone in recovery-mode (TWRP)
- connect to PC and get the recovery.log with following adb command
adb pull /tmp/recovery.log
You will find a copy of the file recovery.log in the directory, from which you started the command
- open an editor or choose your favourite file viewer to open recover.log
- search for the last entry of the word "Error"
- in the line before that, the recovery.log states the name of the file that causes the problem
(in my case it was /system/addon.d)
- disconnect phone from PC.
- restart your phone in "normal" restart (do NOT boot to recovery mode)
- use a root file browser (I used ES-explorer with root enabled) and navigate to that directory/file
- delete the file (which I did not do - I tried some other steps)
- restart phone
This took 3-4 minutes, but I did not delete the file addon.d right away. Instead, I did this:
step 1
navigated to /system/addon.d and copied addon.d to SD-card
step 2
in /system/ , I renamed addon.d "addon_BU.d".
This was successful. In /system/ , the only file visible was now "addon_BU.d"
step 3
tried to create a directory named addon.d inside /system/ because my recovery.log said quote\ ... system/addon.d (not a directory) ... \unquote
FAILED. The directory could not be created by ES-explorer
step 4
copied my backup file addon.d from SD-card back into its original location /system/.
This, I though, would work just fine, because I had renamed the original addon.d to addon_BU.d.
So after restoring addon.d , the only thing left to do would be delte addon_BU.d.
ES-explorer reported no error, but - surprise - there was no file "addon.d" present in /system/
The only file still there was "addon_BU.d"
well, let's go to
step 5
rename addon_BU.d back to it's original name "addon.d" using ES-explorer
FAILED.
addon_BU.d could not be renamed - this file really was screwed up big time !!!
I ended up with no addon.d - so I could have deleted it right away istead of starting my trial with step 1 ...
step 6
Anyway. Shut dowm my phone.
Rebooted my phone normally (not to recovery mode !!!)
This took considerably longer than normal - my heart rate had began to increase slightly if not to say I began to feel like a squirrel on red bull...
After roughly 3 minutes, I had a successful reboot to my OS (lineage Android 7.1.2)
step 7
Reboot again, this time to recovery mode (=TWRP)
and: backups work again.
Don't ask me why this worked and if it will work for you, but hey, give it a triy and let me know...
TheLMGN said:
Hiya XDA, So i'm trying to back up my phone (Running CM13) to my memory stick, and it worked before, but now it seems to have broken and I don't know what the issue is. My log (adb pull /tmp/recovery.log) is below
Heres what I've tried
Reflashing TWRP
Going to a slightly older version (3.0.2-1)
Enabling and disabling encryption
with and without compression
Skipping MD5 and leaving it on
[BACKUP STARTED]
* Backup Folder: /usb-otg/TWRP/BACKUPS/ENU7N15A10005575/2016-12-10--16-58-06_cm_angler-userdebug_6.0.1_MOB30Z_b4fbca03c0/
Backing up Boot...
I:Reading '/dev/block/mmcblk0p34', writing '/usb-otg/TWRP/BACKUPS/ENU7N15A10005575/2016-12-10--16-58-06_cm_angler-userdebug_6.0.1_MOB30Z_b4fbca03c0/boot.emmc.win'
Iartition Backup time: 4
Backing up System...
Error opening: '/system/addon.d' (Not a directory)
I:Error in Generate_TarList!
Error creating backup.
I:InfoManager saving '/usb-otg/TWRP/BACKUPS/ENU7N15A10005575/2016-12-10--16-58-06_cm_angler-userdebug_6.0.1_MOB30Z_b4fbca03c0/system.info'
createTarFork() process ended with ERROR: 255
Backup Failed. Cleaning Backup Folder.
I:Copying file /tmp/recovery.log to /usb-otg/TWRP/BACKUPS/ENU7N15A10005575/recovery.log
I:Set page: 'action_complete'
Iperation_end - status=1
E:error opening '/usb-otg/LOST.DIR' -- error: No such file or directory
E:error opening '/usb-otg/TWRP' -- error: No such file or directory
Click to expand...
Click to collapse
1gnc said:
SOLUTION
This solution worked on my Zenfone 3, running lineage Android 7.1.2.
I tried many other things, like flashing different versions of TWRP, deleting the recovery directory, renaming files and all the like.
You may deselect compression, change the TWRP-date / time : nothing works !
You need an PC / Notebook with adb installed.
- start your phone in recovery-mode (TWRP)
- connect to PC and get the recovery.log with following adb command
adb pull /tmp/recovery.log
You will find a copy of the file recovery.log in the directory, from which you started the command
- open an editor or choose your favourite file viewer to open recover.log
- search for the last entry of the word "Error"
- in the line before that, the recovery.log states the name of the file that causes the problem
(in my case it was /system/addon.d)
- disconnect phone from PC.
- restart your phone in "normal" restart (do NOT boot to recovery mode)
- use a root file browser (I used ES-explorer with root enabled) and navigate to that directory/file
- delete the file (which I did not do - I tried some other steps)
- restart phone
This took 3-4 minutes, but I did not delete the file addon.d right away. Instead, I did this:
step 1
navigated to /system/addon.d and copied addon.d to SD-card
step 2
in /system/ , I renamed addon.d "addon_BU.d".
This was successful. In /system/ , the only file visible was now "addon_BU.d"
step 3
tried to create a directory named addon.d inside /system/ because my recovery.log said quote\ ... system/addon.d (not a directory) ... \unquote
FAILED. The directory could not be created by ES-explorer
step 4
copied my backup file addon.d from SD-card back into its original location /system/.
This, I though, would work just fine, because I had renamed the original addon.d to addon_BU.d.
So after restoring addon.d , the only thing left to do would be delte addon_BU.d.
ES-explorer reported no error, but - surprise - there was no file "addon.d" present in /system/
The only file still there was "addon_BU.d"
well, let's go to
step 5
rename addon_BU.d back to it's original name "addon.d" using ES-explorer
FAILED.
addon_BU.d could not be renamed - this file really was screwed up big time !!!
I ended up with no addon.d - so I could have deleted it right away istead of starting my trial with step 1 ...
step 6
Anyway. Shut dowm my phone.
Rebooted my phone normally (not to recovery mode !!!)
This took considerably longer than normal - my heart rate had began to increase slightly if not to say I began to feel like a squirrel on red bull...
After roughly 3 minutes, I had a successful reboot to my OS (lineage Android 7.1.2)
step 7
Reboot again, this time to recovery mode (=TWRP)
and: backups work again.
Don't ask me why this worked and if it will work for you, but hey, give it a triy and let me know...
Click to expand...
Click to collapse
Hi, thank you for a fix but this is an 10 month old thread. The issue was with TWRP 3.0.2-2. Along with an EFS issue that plagued TWRP 3.0.1-2, both issues have long since been resolved.
Sent from my Nexus 5X using Tapatalk
simple and working solution :
by @yannick818
"looks like it's an error with parallel apps oder multiple users. since i do not use something like that, i just removed this user with the android terminal emulator:
su
pm remove-user 999
everything was fine after that"
I could resolve my nandroid /data backup error on my EMUI 8.0 Mediapad M5 device with those following steps:
1 - Use a correct TWRP implementation
TWRP need to access the uncyphered partition /data.
There no possibility to backup it, if TWRP does not implement deciphering user data partition.
2 - Remove all users except user 0 (the administrator)
You can verify that there is no unwanted users, looking at directory /data/user : the only subdirectory should be "0".
To remove the others users :
Remove the PrivateSpace if you have one (Settings > Security & Privacy > PrivateSpace, and tap on the garbage can).
Remove all the secondary users (Settings > Users & accounts > users, and tap on each users to delete them). Keep just the main administrator user.
On EMUI, remove all twins applications (Settings > Apps & Notifications > App Twin, and disable all twin apps).
On OxygenOS, remove all parallel apps (Settings > Apps > Parallel Apps, and disable all parallel apps).
On MIUI, remove all dual apps (Settings > Dual Apps, and disable all dual apps)
On others devices ... you must find all parameters that create those unwanted users.
If you are not able to get the correct settings to suppress those users, in last resort you can try this command : "pm remove-user user-no. (For example "pm remove-user 999").
3 - Do not forget to protect your backups by a password
This would be stupid to cipher your /data partition and keep backups of this partition unprotected.
These steps fixed the nandroid backup problem for /data partition on my Huawei Mediapad M5 device.
I post on this forum because I hope that this will be helpful for others devices owners.

How to do full system backup to PC?

Before I handing in my OnePlus 6T for repair, I want to create a full system backup and reset the phone to factory defaults. Afterwards, I want to restore the original state. My phone is rooted with Magisk.
How do I do a full system backup?
What I tried:
adb backup -apk -obb -shared -all -system: This finishes, but at 5.5GB, even if compressed, the backup file is suspiciously small. According to the settings app, my phone uses 55GB of storage, so ten times that!
OK, so I thought adb root needs to be run before. However, that doesn't work: adbd cannot run as root in production builds
So I installed the adb_root module. But now when I run the above backup command, then it simply quits. No backup is created.
feklee said:
Before I handing in my OnePlus 6T for repair, I want to create a full system backup and reset the phone to factory defaults. Afterwards, I want to restore the original state. My phone is rooted with Magisk.
How do I do a full system backup?
What I tried:
adb backup -apk -obb -shared -all -system: This finishes, but at 5.5GB, even if compressed, the backup file is suspiciously small. According to the settings app, my phone uses 55GB of storage, so ten times that!
OK, so I thought adb root needs to be run before. However, that doesn't work: adbd cannot run as root in production builds
So I installed the adb_root module. But now when I run the above backup command, then it simply quits. No backup is created.
Click to expand...
Click to collapse
Do you have TWRP on your device? If so, just backup everything with it and copy the TWRP backup folder elsewhere.
ALSO (with the help of PC) copy the /sdcard (emulated sdcard; media storage). TWRP itself does not do that.
Done.
The reinstall TWRP in your device and restore everything. And copy back /sdcard
By the way, this is not Magisk related. For more information, better ask in your device specific section.
wilsonhlacerda said:
Do you have TWRP on your device? If so, just backup everything with it and copy the TWRP backup folder elsewhere.
Click to expand...
Click to collapse
Thanks for pointing me in the right direction! Here's how I proceeded in the end:
Downloaded TWRP for my device.
Rebooted the phone into fastboot mode by pressing volume down plus the power button and following the menu displayed on the phone. Note the process of entering fastboot mode varies from phone to phone.
Connected the phone to the PC, then booted TWRP from the Windows command line (cmd.exe):
Code:
fastboot boot twrp-3.4.0-0-fajita.img
I installed fastboot as part of the Chocolatey package adb.
In TWRP, I entered my password, then selected Backup.
Backed up all partitions to internal storage. See also the TWRP FAQ: What should I back up in TWRP?
Note that not all partitions need to be backed up, and in fact, according to the TWRP FAQ, it may be a bad idea to restore certain partitions. Still, it doesn’t hurt to have the backup of all of them.
Not included is /data/media (internal storage). This needs to be backed up separately. See the TWRP FAQ: What is EXCLUDED from a TWRP backup?
With TWRP running, I connected the phone via USB to my PC. Then I moved the following folder to my PC, which contains the TWRP backup of the phone:
Code:
This PC\OnePlus A6013\Internal Storage\TWRP
This step is not strictly necessary as in the following step I did back up the entire internal storage. However, it makes the next step execute faster as less data needs to be copied. The next step does not give feedback about progress.
For backing up internal storage I decided on the method found in Tadej Janež’s article Backing up Android's /data/media (i.e. internal storage) using adb and TWRP. From the Windows command line I ran:
Code:
adb exec-out "tar --create data/media/0 2>/backup-errors.txt | gzip" >internal_storage.tar.gz
After completion, to check for errors, I ran (no errors):
Code:
adb shell cat /backup-errors.txt
To leave TWRP, I rebooted the phone. Note that it is not necessary to install TWRP.
Restoration still needs to be tested.
By the way, this is not Magisk related. For more information, better ask in your device specific section.
Click to expand...
Click to collapse
I thought there was a Magisk way of doing a full system backup, making use of root privileges. Now I know better.
you can also try Migrator of vr25.
{Mod Edit: TG link removed}
https://github.com/VR-25/migrator
Just use Migrate
End of story.....
datsoy said:
you can also try Migrator of vr25.
{Mod Edit: TG link removed}
https://github.com/VR-25/migrator
Click to expand...
Click to collapse
Thanks! This looks nice, but I already backed up with TWRP. The idea was to get a 1:1 binary backup, and the backup did work. However, I am running into issues during restore of the Data partition: Error 255 when trying to restore Data

Categories

Resources