Twrp error 255 - OnePlus 5 Questions & Answers

When I tried do backup in twrp recovery I always end with error 255
There's log if this help.
Thankshttp://cloud.tapatalk.com/s/59dc5f7f153b3/last_log.txt
Odoslané z ONEPLUS A5000 pomocou Tapatalku

Yup, same here! I always getting it while trying doing an restore via ADB (copy backupped TWRP folder via commands to internal device storage)
I would like a solution to for this frustrating Tarfork 255 error!
This is what i asked and mentioned to one of our Team Members and i tried everyting;
First: *I don't like the idea of "wipe data" clean restoring is to me included "format data*
Secondly: *if i backup my data also along with system and all (exclusive recovery, cache and system image) and move it to my pc via ADB and than wipe and format all in twrp and than move my TWRP back up via ADB back to my Device, than restoring fails...*
Thirdly: *So the only way you can restore is NOT to format Data(internal) while restoring. But that just doesn't make sense. Because the Data is dirty if you flash another ROM and than restore your previous ROM*
So in my opinion when you restoring without the Data formatted, it stays dirty when you restoring. Also i don't want dirty data from other ROMs if you know what i mean..
I like to know an very satisfying solution! And hopefully someone can enlightening us:crying:

It's very simple.. If you can find through the log the "guilty" app just uninstall it and re-do TWRP backup.. If you can't find that (or those) app you need to wipe data... When you're 100% sure that the problem is in data partition (try to backup it alone) so the solution is the above... :good:
---------- Post added at 20:15 ---------- Previous post was at 20:13 ----------
lekiaM said:
Yup, same here! I always getting it while trying doing an restore via ADB (copy backupped TWRP folder via commands to internal device storage)
I would like a solution to for this frustrating Tarfork 255 error!
This is what i asked and mentioned to one of our Team Members and i tried everyting;
First: *I don't like the idea of "wipe data" clean restoring is to me included "format data*
Secondly: *if i backup my data also along with system and all (exclusive recovery, cache and system image) and move it to my pc via ADB and than wipe and format all in twrp and than move my TWRP back up via ADB back to my Device, than restoring fails...*
Thirdly: *So the only way you can restore is NOT to format Data(internal) while restoring. But that just doesn't make sense. Because the Data is dirty if you flash another ROM and than restore your previous ROM*
So in my opinion when you restoring without the Data formatted, it stays dirty when you restoring. Also i don't want dirty data from other ROMs if you know what i mean..
I like to know an very satisfying solution! And hopefully someone can enlightening us:crying:
Click to expand...
Click to collapse
If you format Data you'll decrypt partion and when you go restoring a previous backup done with encryption it won't work.. You can even restore a full backup on a fully working system the recovery will wipe everything for you before continue (with everything i mean those partition that yuo've previously backuped)

Aaah i see. This is what i've got;
A backup (stored in my internal and PC) i made this backup on an running "encrypted" device. But in TWRP i had to decrypt it by password so the backup i made in TWRP is automaticly decrypted right? because of the pincode i insert to decrypt my data.
But let's see, if i want to; let say.. switch to another Custom Rom. The only way is to "wipe" all and flash the new Custom Rom? This without Formatting "Data"? (as i suppose) because if i format the "data" i'm not able to restore my backup. This does make completely sense to me. But..... one thing i don't understand is this;
Why is it possible to make an full backup in TWRP, push it via ADB to PC, going back to twrp "wipe" and "format" all, reboot TWRP, pull the backup from PC via ADB again to TWRP and restore. But it won't restore why? why? because i formatted the "data"? so the only way to restore is (with the "dirty" data from previous ROM's than)...
Anyway, i wish it all was easier... Maybe i make it myself to hard to understand, i dunno.... But hey, thanks for your feedback! appreciate

lekiaM said:
Aaah i see. This is what i've got;
A backup (stored in my internal and PC) i made this backup on an running "encrypted" device. But in TWRP i had to decrypt it by password so the backup i made in TWRP is automaticly decrypted right? because of the pincode i insert to decrypt my data.
But let's see, if i want to; let say.. switch to another Custom Rom. The only way is to "wipe" all and flash the new Custom Rom? This without Formatting "Data"? (as i suppose) because if i format the "data" i'm not able to restore my backup. This does make completely sense to me. But..... one thing i don't understand is this;
Why is it possible to make an full backup in TWRP, push it via ADB to PC, going back to twrp "wipe" and "format" all, reboot TWRP, pull the backup from PC via ADB again to TWRP and restore. But it won't restore why? why? because i formatted the "data"? so the only way to restore is (with the "dirty" data from previous ROM's than)...
Anyway, i wish it all was easier... Maybe i make it myself to hard to understand, i dunno.... But hey, thanks for your feedback! appreciate
Click to expand...
Click to collapse
encrypted backup and a backup of a encrypted device is 2 different things.. When you do a TWRP backup you can choose to encrypt it with a password, it will encrypt that archive backup, but you can also do a TWRP backup of your encrypted device without encrypting the backup, hope this is clear
Second point.. Why you need to format every time? Format here on op5 can cause the data partition to switch from ext4 on f2fs and is not really necessary everytime... Example.. I'm on Resurrection Remix but today i want to change rom but first i want to take a backup, so i reboot in TWRP, do the backup (without encrypt the backup itself, it's not really necessary, indeed it can be risky) then i wipe cache-dalvik/art cache-system-data NO INTERNAL STORAGE then i install my new custom rom
It's really easier as you were thinking but maybe you've done some confusion with format/wipe and encrypted/decrypted
Your problem of restoring the backup is due to this ---> Probably, when you do the TWRP backup you're encrypted then you move it to the PC and here there's nothing wrong, but after this you format data and this will decrypt your device, so like i said above, your restoring isnt working because you want to restore an encrypted backup on a decrypted device
Avoid format and instead use the wipe function :good:

Now i see!!! Finally.. You're second post made it all clear to me! I keep this post in my subscriptions, so i can always look back.
Thanks again! (and for you're time to explain) :highfive:

from recovery log
Enyone can help with this, still ending with error 255
I:addFile '/data/system_ce/0/shortcut_service/shortcuts.xml' including root: 1
==> set selinux context: ubject_r:system_data_file:s0
I:addFile '/data/system_ce/0/recent_images' including root: 1
==> set selinux context: ubject_r:system_data_file:s0
found policy '/data/system_ce/0/recent_images' - '1CE0' - '031a968edf614759'
I:addFile '/data/system_ce/0/recent_images/9416_task_thumbnail.png' including root: 1
==> set selinux context: ubject_r:system_data_file:s0
I:addFile '/data/system_ce/10' including root: 1
==> set selinux context: ubject_r:system_data_file:s0
failed to lookup tar policy for '/data/system_ce/10' - 'cddc5aeae0e4e778'
I:Error adding file '/data/system_ce/10' to '/data/media/0/TWRP/BACKUPS/d3d80913/2017-10-14--14-19-57/data.ext4.win010'
Error creating backup.
I:ERROR tarList for thread ID 0
Error creating backup.
I:InfoManager saving '/data/media/0/TWRP/BACKUPS/d3d80913/2017-10-14--14-19-57/data.info'
createTarFork() process ended with ERROR: 255
Backup Failed. Cleaning Backup Folder.
I:Copying file /tmp/recovery.log to /data/media/0/TWRP/BACKUPS/d3d80913/2017-10-14--14-19-57/recovery.log
I:Set page: 'action_complete'
I:TWFunc::Set_Brightness: Setting brightness control to 255
Iperation_end - status=1
I:Set overlay: ''
I:Set page: 'clear_vars'
I:Set page: 'backup'
Truncating string cache entries.
I:Set page: 'main'
I:Set page: 'clear_vars'
I:Set page: 'main2'
I:Set page: 'advanced'
I:Set page: 'copylog'
I:Set page: 'action_page'
Iperation_start: 'Copy Log'
I:Copying file /tmp/recovery.log to /data/media/0/recovery.log
Click to expand...
Click to collapse

chlap said:
Enyone can help with this, still ending with error 255
Click to expand...
Click to collapse
Have you tried to backup Data only partition?
As I said above the 255 error is due to damaged file/s

Hitman478[emoji769 said:
;74161048]Have you tried to backup Data only partition?
As I said above the 255 error is due to damaged file/s
Click to expand...
Click to collapse
Tried backup Data. Same error.
Odoslané z ONEPLUS A5000 pomocou Tapatalku

If you are getting the same error again and qgain, i know its frustrating! And i also know to find the culprit for the error, is very hard. So i suggest start from scratch? I mean wipe all and format data, reboot to recovery, flash the latest "stable" and "improved" blu spark TWRP as recovery. Reboot recovery again, transfer the ROM, Gapps package and root method from PC to Internal and flash, reboot.
I know it's not an solution you'll be waiting for, but i ended up the same way too (as you can see earlier posts) . But since Hitman478 explained all to me, i have no issues anymore! which I'm truly great full for.
Have a nice Sunday (after all) :highfive:

chlap said:
Tried backup Data. Same error.
Odoslané z ONEPLUS A5000 pomocou Tapatalku
Click to expand...
Click to collapse
There's a corrupted file.. if you can't find it out and delete/uninstall that app, you never will be able to backup.. your solution is to clean install again your room (but first look at log and watch where TWRP gives you the error)

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.

larpoux said:
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
Click to expand...
Click to collapse
Thanks! That was the clue I needed! I had installed the app Shelter lately which created a work profile (= second user). Uninstalling Shelter and deleting the work profile solved the problem.

Hi, I use App2SD and this error occurs with the date partition. It's probably the symlinks.

Related

How do I decrypt my 6p

I flashed CM when it first arrived and encrypted my phone. How do I unencrypt it again? Thanks in advance.
jdub251 said:
I flashed CM when it first arrived and encrypted my phone. How do I unencrypt it again? Thanks in advance.
Click to expand...
Click to collapse
I don't think you can decrypt without formatting the area.
jdub251 said:
I flashed CM when it first arrived and encrypted my phone. How do I unencrypt it again? Thanks in advance.
Click to expand...
Click to collapse
You need a kernel that does not force encryption. I believe ex kernel is an option. I run benzo rom which does not force encryption. Make sure yo backup any data you want to keep. The process should go as follows:
Flash rom
Flash gapps
Flash kernel
Select wipe
Format data
Reboot Recovery
Reboot system
n.halepat said:
You need a kernel that does not force encryption. I believe ex kernel is an option. I run benzo rom which does not force encryption. Make sure yo backup any data you want to keep. The process should go as follows:
Flash rom
Flash gapps
Flash kernel
Select wipe
Format data
Reboot Recovery
Reboot system
Click to expand...
Click to collapse
Ok! Will try this! Thanks! I believe this will work!
Sent from my Nexus 6P using Tapatalk
jdub251 said:
Ok! Will try this! Thanks! I believe this will work!
Sent from my Nexus 6P using Tapatalk
Click to expand...
Click to collapse
Just make sure you format data, not wipe.
n.halepat said:
You need a kernel that does not force encryption. I believe ex kernel is an option. I run benzo rom which does not force encryption. Make sure yo backup any data you want to keep. The process should go as follows:
Flash rom
Flash gapps
Flash kernel
Select wipe
Format data
Reboot Recovery
Reboot system
Click to expand...
Click to collapse
Heisenberg said:
Just make sure you format data, not wipe.
Click to expand...
Click to collapse
Have you noticed any speed difference after decrypting?
Also is it possible to decrypt using a kernel that doesn't force encryption and then switch to a kernel that may not have that? I would still have to turn encryption on via Settings -> Encrypt is what I'm thinking.
exSD said:
Have you noticed any speed difference after decrypting?
Also is it possible to decrypt using a kernel that doesn't force encryption and then switch to a kernel that may not have that? I would still have to turn encryption on via Settings -> Encrypt is what I'm thinking.
Click to expand...
Click to collapse
I've seen some testing regarding encrypted vs decrypted, the performance gain is so small it's negligible. If you switch to a kernel that forces encryption, it'll encrypt automatically on boot.
Heisenberg said:
I've seen some testing regarding encrypted vs decrypted, the performance gain is so small it's negligible. If you switch to a kernel that forces encryption, it'll encrypt automatically on boot.
Click to expand...
Click to collapse
Have you read http://www.anandtech.com/show/9820/the-google-nexus-6p-review ?
The difference in storage speeds is drastic.
Encrypted: 75.7MB/s seq read, 40.6MB/s seq write, 7.4MB/s rand read, 1.0MB/s rand write.
Unencrypted: 179.7MB/s seq read, 52MB/s seq write, 14.73MB/s rand read, 6.3MB/s rand write.
exSD said:
Have you read http://www.anandtech.com/show/9820/the-google-nexus-6p-review ?
The difference in storage speeds is drastic.
Encrypted: 75.7MB/s seq read, 40.6MB/s seq write, 7.4MB/s rand read, 1.0MB/s rand write.
Unencrypted: 179.7MB/s seq read, 52MB/s seq write, 14.73MB/s rand read, 6.3MB/s rand write.
Click to expand...
Click to collapse
No I hadn't seen that particular article. I guess the results must vary, the results I saw showed performance gains in the order of less than a percent.
Heisenberg said:
No I hadn't seen that particular article. I guess the results must vary, the results I saw showed performance gains in the order of less than a percent.
Click to expand...
Click to collapse
In terms of power consumption, the CPU is processing an extra step for every instruction it has passed to it. I would think that with the inefficient chip the 810 already is that this would impact battery life more than real world opening apps type speed.
I think I'll decrypt to see if I can notice any power differences.
so if i copy all my files to my PC before following these steps, I would still be able to use them afterwards? ie pictures, sounds, images, and titanium backup files? i'm wanting to try benzorom and it sounds like it doesn't get along with encryption very well.
glhelinski said:
so if i copy all my files to my PC before following these steps, I would still be able to use them afterwards? ie pictures, sounds, images, and titanium backup files? i'm wanting to try benzorom and it sounds like it doesn't get along with encryption very well.
Click to expand...
Click to collapse
Yeah, as long as you back up everything to your PC you can just transfer them all back to your phone after you do this.
if i do a nandroid backup (from TWRP) of an encrypted system then create backup of /sdcard, wipe userdata than restore /sdcard and restore backup with a non forcing kernel will i get a decrypted device with all data restored?
answering my own question:
- twrp backup data
- copy /sdcard to pc
- fastboot format userdata
- copy from pc to /sdcard
- restore data in twrp
are the needed steps to decrypt without losing any data.
A bit of a necro, so I apologize for that.
@ratson: I am attempting to do exactly what you have mentioned here, although I am not an experienced user. Can I get some clarification on the following:
TWRP backup: Done. It keeps wanting to restrict my permissions on this folder, but I was able to get it off the device (Nexus6p Huawei) and backed up onto my PC.
copy the /sdcard to the PC. Man, what a problem I am having with this. First off, when it gets to a folder called /kick it fails because it says it's not a directory. It does this on some long hex named file that actually isn't a directory, but it seems to want to recognize it as one anyway, and then fail the pull because of this.
So, I cut the entire /kick folder through ES Explorer, and temporarily pasted it into my dropbox. Restarted the adb pull through my shell. It seemed to be working ok, until it got to the TWRP folder. While backing that up (I already did this, but it is still on the device as I only copied it. Should I be deleting this before backing up the rest of the /sdcard?) it fails because it says permission denied when it tries to pull some of the backup files.
At this point I've restarted the pull, and tried different things for several hours. Before I continue to bang my head against the wall, I'd like to get some advice.
How do you pull the /sdcard to your pc? what method? what commands? do you do it from TWRP recovery mode, from the system? Pretend I'm an android toddler (I kind of am). Is there anyway to not start from scratch every time the pull fails? Is there ways to pre-empt the failures?
Once this is complete, when you restore the data, can you please also list the commands for that?
I greatly appreciate your, or anyone elses help to reads this.
Thanks,
For the record:
Make sure battery is charged!
On PC: adb reboot recovery
In TWRP: select BACKUP, select DATA, swipe
When finished
On PC:
mkdir DATA-BACKUP
adb pull /data/media/0/TWRP/BACKUPS
fastboot reboot bootloader
fastboot format userdata
On Phone:
arrow down to select recovery, power to enter
cd DATA-BACKUP
adb push * /data/media/TWRP/BACKUPS
When finished
In TWRP: Restore, select the backup, swipe
rchtk said:
For the record:
Make sure battery is charged!
On PC: adb reboot recovery
In TWRP: select BACKUP, select DATA, swipe
When finished
On PC:
mkdir DATA-BACKUP
adb pull /data/media/0/TWRP/BACKUPS
fastboot reboot bootloader
fastboot format userdata
On Phone:
arrow down to select recovery, power to enter
cd DATA-BACKUP
adb push * /data/media/TWRP/BACKUPS
When finished
In TWRP: Restore, select the backup, swipe
Click to expand...
Click to collapse
This will backup and restore the nandroid backup, but not the sdcard, correct? Or am i getting it wrong?
Kalamos said:
This will backup and restore the nandroid backup, but not the sdcard, correct? Or am i getting it wrong?
Click to expand...
Click to collapse
It will restore what you backed up: the complete data partition: app settings, contacts, media,.. All your datas..
rchtk said:
It will restore what you backed up: the complete data partition: app settings, contacts, media,.. All your datas..
Click to expand...
Click to collapse
I was under the impression that a nandroid backup didnnot include apps, user settings, etc. Otherwise, what is the use of Titanium Backup? Perhaps I'm jist confused.
I'm curious if 7.1 still has a huge performance hit with encrypted partitions.
Anyone know of a good app for checking performance of the data partition? All I've seen is internal/external storage.
Thanks.

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.

[DONE] Can one unencrypt stock (rooted) Pie without losing data ?

As title suggest:
I run latest 10.0.4.0 stock Pie firmware. I am rooted (Magisk) and have Coscmidan's TWRP.
I wonder if there is a recipe to unencrypt and stay unencrypted. But I also do not want to lose user data during this transition.
A recipe perhaps like: "boot twrp, backup data, format data, restore data (assuming internal /data/media/0 already backed up elsewhere)".
But, perhaps, to avoid stock to encrypt again I may need 'Universal DM-Verity, ForceEncrypt, Disk Quota Disablers' zip.
However: I am slightly confused about double negation in documentation telling that name of ZIP determines what's DISABLED.
So I guess default Dm-Verity_ForceEncrypt may be what I need?
Thanks for help. have a nice day
Dior DNA said:
As title suggest:
I run latest 10.0.4.0 stock Pie firmware. I am rooted (Magisk) and have Cosmicdan's TWRP.
I wonder if there is a recipe to unencrypt and stay unencrypted. But I also do not want to lose user data during this transition.
A recipe perhaps like: "boot twrp, backup data, format data, restore data (assuming internal /data/media/0 already backed up elsewhere)".
But, perhaps, to avoid stock to encrypt again I may need 'Universal DM-Verity, ForceEncrypt, Disk Quota Disablers' zip.
However: I am slightly confused about double negation in documentation telling that name of ZIP determines what's DISABLED.
So I guess default Dm-Verity_ForceEncrypt may be what I need?
Thanks for help. have a nice day
Click to expand...
Click to collapse
I apologize for answering own question.
After reading Cosmicdan's and DM-Verity, ForceEncrypt documentation,
I went ahead as follows and kept fingers crossed:
recall : I ran latest 10.0.4.0 stock Pie firmware, rooted (Magisk) and have recovery Cosmicdan's TWRP.
Code:
boot system
backup /data/media to somewhere [I use rsync to a server]
boot recovery
backup data [just data]
format data
reboot recovery
treblize (userdata shrink) [so I do not have to do that later] <- optional
reboot recovery <- optional dependent on above choice
restore data [just data]
flash Dm-Verity_ForceEncrypt
flash magisk
boot system
restore /data/media from somewhere [I use rsync from a server]
I am unencrypted now and did not loose any data
Code:
[email protected]:# getprop | grep crypt
[init.svc.update_verifier_nonencrypted]: [stopped]
[ro.boottime.update_verifier_nonencrypted]: [20215637491]
[ro.crypto.state]: [unencrypted]
Hope it helps others.
interesting!
why is better to uncrypt the data partition?
riccetto80 said:
interesting!
why is better to uncrypt the data partition?
Click to expand...
Click to collapse
Not better. In fact, perhaps encrypted is better.
But some custom ROM or custom Treble GSI may not support encrypted so it is less of a hassle to each time switch between encrypted/decrypted when switching between some such custom ROM or custom Treble GSI. Also, switching between similar some such custom ROM or custom Treble GSI may perhaps be possible to attempt to flash dirty then.
Dior DNA said:
I apologize for answering own question.
After reading Cosmicdan's and DM-Verity, ForceEncrypt documentation,
I went ahead as follows and kept fingers crossed:
recall : I ran latest 10.0.4.0 stock Pie firmware, rooted (Magisk) and have recovery Cosmicdan's TWRP.
Code:
boot system
backup /data/media to somewhere [I use rsync to a server]
boot recovery
backup data [just data]
format data
reboot recovery
treblize (userdata shrink) [so I do not have to do that later] <- optional
reboot recovery <- optional dependent on above choice
restore data [just data]
flash Dm-Verity_ForceEncrypt
flash magisk
boot system
restore /data/media from somewhere [I use rsync from a server]
I am unencrypted now and did not loose any data
Code:
[email protected]:# getprop | grep crypt
[init.svc.update_verifier_nonencrypted]: [stopped]
[ro.boottime.update_verifier_nonencrypted]: [20215637491]
[ro.crypto.state]: [unencrypted]
Hope it helps others.
Click to expand...
Click to collapse
Idk if I'll need it someday or not, but thanks for the post, it's good to know things.

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

[SOLVED] Restore decrypted nandroid backup of FBE

Tried restoring a nandroid backup of the data partition with twrp.
also copied the /data/media partition back from an external copy.
when booting up the phone immediately reboots back into twrp with an error message:
Android Rescue Party...
The reported problem is:
'--reason=set_policy_failed_:/data/vendor'
the vendor partition seems to be intact and i do have a backup of it taken at the same time as the data backup, restoring it doesn't yield results..
i'm wondering if FBE is throwing it off, as the backup was taken when the phone was decrypted (within twrp) however the data on the partitions is referencing some sort of encryption key?
you may also exhibit the following error upon bootup of a restored nandroid backup.
immediately after booting, the phone reboots back into recovery.
viewing the log in twrp will show:
Android Rescue Party...
The reported problem is:
'--reason=set_policy_failed_:/data/bootchart'
1. the solution to this is editing fstab.​​under twrp or other recovery​mount /vendor from the mount icon.​​in twrp: Advanced > File Manager > /vendor/etc/fstab.qcom​select edit file under userdata, find where it says fileencryption=ice​rename fileencryption to encryptable.​​Original​
Code:
/dev/block/bootdevice/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,noauto_da_alloc,discard wait,check,fileencryption=ice,quota,reservedsize=512M
​​Modified​
Code:
/dev/block/bootdevice/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,noauto_da_alloc,discard wait,check,encryptable=ice,quota,reservedsize=512M
​save file.​
2. next delete the following directories:​
/data/unencrypted
/data/misc/vold/user_keys
3. Lastly delete any of the existing files from /data/system/ :​
locksettings.db
Gatekeeper.password.key
gatekeeper.pattern.key
locksettings.db-shm
locksettings.db-wal
recoverablekeystore.db
password.key
pattern.key
4. Reboot and re-encrypt​​
At this point rebooting from recovery will result in a running and successfully recovery backup.
one thing to note is the data and data/media partitions are at this point unencrypted
TRYING TO REINCRYPT NOW WILL FAIL to reencrypt got to settings > security > re set your pin or password for the phone
(optional) then select encryption and there will be an orange button to encrypt device.
the encryption process will take quite a while as it will reencrypt your entire phone.
The above doesn't work as it's trying to accomplish FDE, and the fstab line for encryptable=ice, isn't compatible with this.
i could not find an fstab string to follow the same option but for FBE.
​
Thanks for sharing, nice guide to disable forced FBE encryption! I think this applies to Android 12+ in general, not just OnePlus devices.
I ended up with the same problem on my Mi 10 Ultra with MIUI 13 after a /data partition restore and it was a real pain to solve ("set_policy_failed:..." rescue party error for different directories). It's strange though why it fails to set the fscrypt policy for existing directories with no policy, correct permissions and SELinux context...
(Btw: whether a fscrypt policy is applied to a directory ("is this directory encrypted?") can be checked with fscryptpolicyget in terminal.)
Unfortunately, this didn't directly solve my TWRP backup restore problem and I still had to do a manual restore, but now I can at least disable FBE and it's always nice to have actual control over the device you paid money for (you should really have control by default, but oh well...)
(Some of) the troubleshooting I did:
Like I mentioned, I first thought the issue might be with the SE linux context, so I tried running restorecon, but this didn't help - I eventually found that in init.rc, restorecon is usually already automatically run during each boot for directories under /data/... so running it manually makes no difference.
To edit /vendor/etc/fstab.qcom (or /system) on my device, I had to first disable the shared blocks EXT4 optional feature. I followed this nice guide to unpack/repack super.img. But this is missing the step for disabling shared blocks: when I tried to mount any of the unpacked images (e.g. vendor.img) as R/W, it failed with the useless generic error:
wrong fs type, bad option, bad superblock on ...
Click to expand...
Click to collapse
Then dmesg gave me another clue, but at the same time was still cryptic and not immediately helpful:
EXT4-fs (loop*): couldn't mount RDWR because of unsupported optional features (4000)`.
Click to expand...
Click to collapse
So I guess 4000 is the code for shared blocks and you can disable these with e2fsck -E unshare_blocks <your .img file or loop device> (and probably need a filesystem check with e2fsck -yf <file>). Again very annoying that these numerical feature codes are not mentioned anywhere in the e2fsck manual pages for example.
Anyway, I was finally able to either:
1. mount vendor.img on my PC (mount -o loop vendor.img /mnt/vendor) and edit the /mnt/vendor/etc/fstab.qcom right there before repacking the .img and flashing the new edited super.img to my device
or
2. just repacking the vendor.img with shared blocks disabled and size increased (resize2fs vendor.img <new size>) and flashing the new super.img without other modifications - this way /vendor can also be mounted as r/w in Android and changes made later (mount -o remount,rw /vendor).
The worst part is that in the end, even with decryption disabled and the keys deleted, the device still wouldn't boot after a /data restore from TWRP (and after multiple days spent on debugging )... I still had to manually extract the TWRP backup and move directories/files individually - thankfully no issues with app/ or data/ - I think the problem was with some files in either system/ or misc/, but idk for sure. I just manually went through and kept only what seemed important (saved wifi APs, BT devices, SMSs etc, but not saved accounts). And after this it finally booted with all my apps and (most of) my settings!
(Btw2: a TWRP/nandroid backup is apparently just a bunch of separate tar.gz files, not a split archive, so you can just extract them with for file in ../data.f2fs.win*; do echo "extracting $file..."; busybox tar -xzf $file; done)

Categories

Resources