[OFFICIAL][RECOVERY] [TWRP] TWRP for OnePlus 5T

Search This thread

gianton

Recognized Contributor
Feb 5, 2009
12,017
9,930
Thessaloniki
Sorry I'm new to the Oneplus 5 and 5T scene, can someone fill me in on what the data issue is with restoring with official twrp and how can i avoid the issues? Thanks so much.

There's no issue, some users have this data restore failure because of the parallel apps folder. If you don't use this feature you'll be fine.
 
  • Like
Reactions: Ludespeed

mad-murdock

Retired Recognized Developer
Oct 11, 2010
2,373
1,670
Detmold
Either you're using multi user mode or the parallel apps feature. Either way, take a look at /tmp/recovery.log and remove any folders that are causing backup to fail.
Worked for me, ymmv.

EDIT: I'm not sure if this is a bug or TWRP just doesn't support multi user mode, but shouldn't the backup process just warn that the files for other users are not being backed up and simply ignore any users other than 0?

Not using parallel apps or multi user mode. Just plain old 4.7.4 OOS. Nothing fancy that I know of.

recovery.log is a bit long. Any idea what to grep for?

There's no issue, some users have this data restore failure because of the parallel apps folder. If you don't use this feature you'll be fine.

Thats plain wrong. Stop pretending there is no issue. There is a serious issue.

I am currently on the unofficial TWRP recovery and I want to flash this official one,is there a way to do it directly through the recovery such as flashing the official twrp zip in the unofficial recovery or do I have to use a pc and ADB?
The file you get from the download is a .IMG file how do you convert it into a flashable zip?

After you click "Install" you can select "Flash Image" (or similar - brain dump) - doing so shows *.img files instead of *.zip files. Once you choose the .img file, you are asked where to flash. Select recovery.

Once done go to reboot -> reboot recovery. You now boot into the new recovery you just installed.
 
Last edited:

mad-murdock

Retired Recognized Developer
Oct 11, 2010
2,373
1,670
Detmold
From my tests using all 3 builds based on 3.2.0 (official and 2 unofficial), I got no errors backing up or restoring a nandroid.

Yet at least 2 people here do. Pretending its our fault for using [insert fancy feature here] won't help making the recovery bug-free.

I just had a fluke. Whats default file system on /data? I re-formated my /data to ext4 when I received my device. Don't remember why, but there was a good reason to it.
Can that be connected to the issue?
 

gianton

Recognized Contributor
Feb 5, 2009
12,017
9,930
Thessaloniki
Yet at least 2 people here do. Pretending its our fault for using [insert fancy feature here] won't help making the recovery bug-free.

I just had a fluke. Whats default file system on /data? I re-formated my /data to ext4 when I received my device. Don't remember why, but there was a good reason to it.
Can that be connected to the issue?

Maybe, I haven't touched data partition since I got this device. Just unlocked bootloader and flashed ROMs using these 3 recoveries.
 

kgs1992

Senior Member
May 8, 2012
1,482
1,884
Bangalore
Not using parallel apps or multi user mode. Just plain old 4.7.4 OOS. Nothing fancy that I know of.

recovery.log is a bit long. Any idea what to grep for?

Any error logs or warning logs. (I think they start with E: or W: ) so maybe
Code:
cat /tmp/recovery.log | grep -nE '[WE]:'
^ This doesn't work. I think TWRP just logs it as INFO.

Do this in recovery during backup/restore:
You could do it while connected through adb shell. Just do
Code:
tail -f /tmp/recovery.log
last few lines should have the relevant reason for failure.
----
Backup with parallel apps fails, I'm not sure about multi users.
If you've ever enabled parallel apps, note that when you disable it, it doesn't remove the user it adds.
Check /data/media. If you have have folders with numbers other than 0, then you have multiple users/parallel apps.
If you do have this, an easy fix is to remove the user. You can do this through adb shell or some terminal emulator with the following command (do this in your ROM, not in recovery):
Code:
pm remove-user USER_ID
For example, parallel apps created a user with ID 999 for me (not sure if this is random or fixed), so to remove it, I had to do:
Code:
pm remove-user 999
After which backup worked fine.

EDIT: If you're having problems with restore, I'd suggest ensuring that you're only restoring using the same recovery you used to backup, since I'm pretty sure backups from other builds will be incompatible with this official one.
 
Last edited:

Pfeffernuss

Senior Member
Jun 30, 2009
5,188
1,957
Wassenaar
If you've ever enabled parallel apps, note that when you disable it, it doesn't remove the user it adds.
This is very helpful. Indeed enabled Parallel Apps (which I meant above when saying multi apps, my bad) when the phone just arrived to explore all options and disabled it afterwards. Apparently this indeed was not enough.

Did a factory reset right now to get rid of this whole mess and won't touch the parallel shizzle even again :good:
 

mad-murdock

Retired Recognized Developer
Oct 11, 2010
2,373
1,670
Detmold
Shame on me. I had /data/media/999. With creation date of the day I received the device... Asking myself "how can this be possible, I never used parallel apps", I barely remembered that when browsing the settings the first day, I accidentally turned on parallel apps for twitter. I switched it off the same moment I noticed my mistake. Nothing you really remember when asked if you use parallel apps.

Anyway, as @kgs1992 said,

Code:
pm remove-user 999

(in the running ROM, not the recovery) fixed the problem. I can do backups now without any errors.

I am feeling a bit stupid claiming I dont use parallel apps -.- Thanks for helping me along though, now I can finally do backups and test other ROMs

Last remark: When still having user 999, I did grep /tmp/recovery.log for errors and warnings after the backup crashed - it did NOT contain any of those. Appending the log file from that incident for science.
 

Attachments

  • recovery.log.zip
    413.7 KB · Views: 8

kgs1992

Senior Member
May 8, 2012
1,482
1,884
Bangalore
Last remark: When still having user 999, I did grep /tmp/recovery.log for errors and warnings after the backup crashed - it did NOT contain any of those. Appending the log file from that incident for science.

It does have the error though:
Code:
I:Error adding file '/data/system_ce/999' to '/data/media/0/TWRP/BACKUPS/f6721e9f/test-only-2017-12-09/data.ext4.win003'
Error creating backup.
I'm not sure of logging conventions for TWRP, but that should be an ERROR log, not an INFO imo.
Anywho, glad that solved your problem.

And yeah, **** happens. I tried out the feature when I got the device and completely forgot about it too.
When the backups failed and I checked the logs, I made the reasonable assumption that parallel apps is adding this new user. :D
 

yung40oz84

Senior Member
Sep 23, 2014
3,090
1,027
sites.psu.edu
I've had no issues with backup, restore, anything on the official TWRP. it's your parogitive to stay on BS, but it's all just preference, and every user will have different results. Also, u don't need to quote the thread owner and TWRP Dev and make smug remarks and use caps, and to be quite frank, Blu spark isn't a recovery Dev, he's a kernel dev. It's people like you why threads get closed or other consequences.
 

stu5797

Senior Member
Aug 4, 2011
2,533
499
Cleveland, Ohio
Thank you for bringing the official TWRP to the OnePlus 5! Much appreciated! Every time I enter TWRP it asks me for a password. Did I do something wrong? I Formatted data and wiped everything. What did I miss? Thank you
 

Fraught

Senior Member
Jan 6, 2014
183
59
Thank you for bringing the official TWRP to the OnePlus 5! Much appreciated! Every time I enter TWRP it asks me for a password. Did I do something wrong? I Formatted data and wiped everything. What did I miss? Thank you
Pretty sure it's because the phone is encrypted by default (Settings -> Security & lock screen -> Encrypt Phone, which should say "Encrypted"). I had that problem on my 6P a while ago too, so I'm not sure exactly why or how it pops up.

Also, I just put in my screen PIN lock in and it lets me into TWRP every time, so it doesn't bother me too much.
 
  • Like
Reactions: stu5797

Top Liked Posts

  • There are no posts matching your filters.
  • 52
    TWRP for the OnePlus 5T with File Based Encryption support. Everything is working as expected! Unlock your device with fastboot oem unlock and then fastboot flash the recovery. The stock rom WILL reset your recovery on boot!

    Not working / issues
    Restoring data partition from backups will lead to boot issues if FBE-encrypted. It's not a TWRP issue but rather a side effect on how FBE works.

    Download

    SOURCE
    Device Tree
    Kernel
    Patch for FBE
    Manifest For Omni-7.1

    Credits:
    Code:
    rhcp011235 - General help, testing, whatnot
    xdevs23 - pointing us at the patch for FBE

    XDA:DevDB Information
    TWRP, Tool/Utility for the OnePlus 5T

    Contributors
    simonsickle, Dees_Troy, bigbiff
    Source Code: https://github.com/SimonSickle/android_device_oneplus_dumpling


    Version Information
    Status: Stable
    Current Stable Version: 3.2.0
    Stable Release Date: 2017-12-01

    Created 2017-12-07
    Last Updated 2017-12-07
    28
    Updated to 3.2.0. Enjoy!


    Also, this is now official: https://twrp.me/oneplus/oneplus5t.html
    21
    Official will be updated and maintained with proper, non hacked together support. To do that, everything must be tested and understood before throwing things and seeing what sticks.

    USB OTG currently isn’t working due to the kernel not sending power. I’m continuing to investigate the best solution, wether it be a kernel fix to always enable it or to use the built in functionality.

    As for the theme, please don’t ask here. You can easily install any theme you wish through the built in functionality. Ask the creator of whatever theme to make the proper zip file.

    This is due to the ID in the usb init. There was no reason to change it since it is working.

    Restores work on both the official and blue spark versions. the warning is there so that users are aware their data can be lost.

    Finally, this is not the place to tell users what to use and what not to. This is a development thread that I’m welcoming specific support questions in. The choice of which build to use is ultimately up to the user; please do not debate builds etc. support issues are the only thing that should be posted in this thread. Create a thread in general for anything else.
    18
    OTG and DT2W are coming to the next build of TWRP. Stay tuned to the TWRP app for new IMG
    6
    Dont use it for now!


    5T users are advised to stay on TWRP by ibe or bluspark as official twrp has issues with data restore, I have tested restore on ibe and bluspark and both work fine for now. Looking at the past track of OnePlus devices official for dumpling would also not be maintained and further updated so it's best to stay on unofficial for now which would be frequently maintained and updated.

    Thanks to @FuNkWizard for his tests and heads up.
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone