Stuck in bootloop to TWRP after my battery died

Hi ! My phone (OnePlus3T) had its battery die a couple of hours ago and after putting to charge, I am stuck in a TWRP bootloop every time I try to boot it. I have no idea what is actually going on… Are there method to get it working again without having my data wiped ?


Regain your privacy! Adopt /e/ the unGoogled mobile OS and online servicesphone

For more information, I tried wiping the Cache and Dalvik / ART Cache and reboot.
Nothing new happened.

Pull SIM and SD-Card if any and reboot.

You can try to enable MTP with TWRP to copy your data using a computer.
Then, I’ll try to reflash over, using the same /e/ ROM file …

Unfortunately it had no effect.
Thanks for the suggestion

Hi, I am afraid it will come to this.
Virtually shouldnt I be able to reflash /e/ without wiping the data ?

Yes, it’s called a “dirty flash”.
If you open the ROM zip file, you can see which partition is included :wink:
But be aware that your device is in a unknown state, so we can’t assume anything about data …
You should first backup your documents (“media” partition), and maybe “data” partition (please see here, select only “data” for backup).


Sorry for the perhaps stupid question but opening the downloaded ROM zip file I’m not quite sure what you are referring to

You can see :

  • one system partition image
  • one boot image
  • some files (maybe specific to your phone)

Anyway, please forgive me as this is misleading :frowning:

The point is : data partition remains untouched while dirty-flashing.

Quick steps :

  • boot to TWRP
  • ensure Data partition is mounted (Mount)
  • enable MTP, copy your files to PC
  • put ROM image to phone using adb push , for example adb push D:\Download\ /data/lineageos-updates/
  • still in TWRP, choose Install then the zip from below
  • if asked, clear cache & Dalvik (if not, from main menu use Wipe, then Advanced Wipe)
    ** DO NOT, i repeat DO NOT wipe or format Data
  • reboot to System

Oh ! I forgot to ask : is your device single-side (A) or double-side A/B device ?
If A/B instructions may vary, and unfortunately I don’t know much about that :frowning:

OK, so I flashed a recent version of /e/ (0.16) with the adb sideload command, without doing a data wipe first.
It unfortunately stayed in the loop it was first. To be precise, the sequence it starts on is the following :

  • boot til the usual /e/ charging screen
  • stuck in this screen for more time than usual
  • automatic reboot
  • TWRP mode opens without any command performed…

I haven’t found out whether a Oneplus3T is one-side or double-side. I am though contemplating following a fresh install procedure with full data wipe like here :

I am not seeing why this abnormal behaviour appeared and why the dirty flash bettered anything

Would you mind to try the former version, which was working fine ?

If it still won’t work, I can’t see anything but complete format of Data partition :frowning:

Hi, thanks for the following up !
I’m afraid that I no longer know which version was I using… I installed first the 0.13 but now the 0.16 is downloadable and I recall a major update I did a couple of onths ago…

I’ve tried installing 13 / 15 / 16 already… without success

I am now roaming forums in order to be sure to what extent data are backed up with a TWRP backup : namely concerning data associated with apps, contacts, sms etc…

Daily update :
I did the factory reset and the rom flashing worked flawlessly. However, trying to recover the backup brought back the bug…

Consequently, any of my apps, sms, contacts, mms data is not back…

I am wondering whether there is a way to do a partial recover from a TWRP backup file, which would solve my trouble.

Happy you’ve kinda brought your device back to /e/ :slight_smile:
But I can’t understand why your backup leads to boot-looping :frowning:

About partial restore from TWRP : yes, but it’s not easy …
Anyway I’m afraid that your apps are gone for now :frowning:
I’ll try to :

  • reinstall some apps with their defaults
  • take a TWRP backup of “working” Data partition
  • with TWRP restore “bad” Data
  • tar some directories (the list is to be established), store tar file outside of Data
  • restore back “working” Data
  • untar backups
  • cross everything, reboot to system …

For tar files storage you could use /data/media (mount it first), as this is a different filesystem :wink: .
For example (assuming you created the directory) /data/media/0/Backups/

I think we may also extract files directly from TWRP backup files using Windows + WinRAR …

If you’re ok with this, I can dig into :

  • try extracting with WinRAR
  • establish a list ok well-known directories
1 Like

I could open archive and extract files from a TWRP backup, using WinRAR (Windows 10) :slight_smile:

So this post will focus on using Windows to restore data.

Data image may be a single file or split parts :
image image

If splitted, each file is independent, so I’ll suggest to extract them all in the same temporary directory.

Don’t be abused by the “ext4” extension, WinRAR can open the archive and extract files :

Interesting places are \data and \user_de\0 .

Also, WinRAR displays sizes, that can be a first-level filtering of interesting things :

Once extracted, the databases can be opened using the tools described here.
Example with DB Browser and database :

So we can target some directories to focus on :slight_smile:
I’ll try to come back with a list, later.

To put files back to your phone, it is quite simple :slight_smile:
One example here with

Once you have completed a security TWRP backup :wink: just stay in TWRP and have adb ready.
First, note the owners & permissions :
That’s something we’ll have to put back after restore.
You can also record it for every file using ls -alR :wink:

I’ll delete the “factory” directory to avoid side effects, then exit adb shell and upload our backup directory :

We’ll have to arrange owners & permissions :wink: :



One could also try to escape the painful owner & permissions steps, having them set while restoring the directory :wink:

Let’s try with tar ! :smiley_cat:

First, extract data.ext4 file within Windows, using WinRAR (if splitted archive, choose the right one).
Note about splitted archive : search recovery.log file for “data.ext4” :wink:

Then upload it to your phone :

And extract our directory :

What happened here ?
We could extract our directory, however TWRP archive has been made with leading / and a relocation path (/data instead of /data/data), and ToyBox tar doesn’t support relocation using -C option (at least on my TWRP, may vary).
So files get extracted using the path stored in archive, and we had to move the directory to it’s correct place.

Note that owners & permissions have been restored ! :partying_face:

Don’t forget to delete archive file, once all restores done :wink:

Thank you so much for your didactic reply ! It’s on point as I was orienting myself more towards the Win10 + Winrar solution than Linux+cmd lines (Im having trouble with my Ubuntu partitions also haha)

I expected the process to be fairly simpler than this, with an easy Cut&Replace of the different folders haha
I have been also puzzled about the “taring” and “untaring” vocables, which I came across for example in this post (French) :

Your explanations clarifies it fairly !

An idea came to my mind : the battery died while I was using the NewPipe app (Youtube client). What if a corrupted file on the app directory created the bug ? Could deleting the directory virtually solve at once this bug ?

Thanks ! I’ll be happy if it can help :slight_smile:

About your idea : I feel really sorry, I should come first with a fsck of Data partition :sob:
I’ve never seen a Data partition filesystem getting corrupted, but of course that can happen.
A delete might not have solved the problem, but a check would definitively have worth a try !

1 Like