TWRP + LineageOS boot loop?

Search This thread

paul_one

Senior Member
Oct 28, 2010
130
23
Portsmouth
Heya guys,

I did get TWRP + LineageOS 18.1 working on this tablet a few months ago, and have been enjoying it (along with Magisk + google apps).
I had to use Odin, since no other method worked - but I had to borrow a laptop for that (since I don't use Windows, and the Linux apps didn't work at all).

Since LineageOS 19.1 was released, I thought I would give the upgrade a try, and also the backup + restore method a try for TWRP (must be tried + tested right? .. Or so I thought).

So, I get a USB drive, exfat formatted, double the size of the internal storage.
I backup all partitions except for "Dtbo", "cache", "EFS" (so all the stuff that might be touched by a potential patching I wanted backed up)..
Data, I also renamed the "media" to "mediabak" and backed that up - so that I wouldn't lose any media files either.

I then "install"ed the LineageOS 19.1 zip file using the TWRP "install" button.... Cleared the cache, aaaaand got the LineageOS boot animation and then just continual reboot...
5 reboots later, I boot into TWRP: "no worries - I shall restore from my backups!" I say to myself.

I restore everything except the "data" partition, thinking "it's OK, it's only data and it'll save me time restoring that"
... NOPE! - reboot and now I just get continual reboots but no boot animation.
"Maybe I need to wipe them before hand?" - so I select to wipe the partitions (vendor, system, cache, ...).. Only data+recovery not being wiped.
Restore
.... NOPE!
"Let's try data - maybe there's something funny in there?"
.... NOPE! - and what's worse, I get a tar extraction error (255) - probably due to the fact the partition isn't encrypted (as a guess) - I found a webpage showing the "data" files in the backups are only tar files, and on my laptop they show as OK except for having some missing "TWRP.security.encrypt" and something about a missing equals sign on the extended metadata (so I think the data is all intact, so I can probably transfer / extract it after I get the tablet back).

"Let's just try to re-install LineageOS 18.1 from the images... Wipe system, grab the image from the net, use TWRP to 'install' the image"
.... NOPE! - still stuck with a boot loop.

Why will TWRP not install the OS properly?
How can I trust TWRP after this, with no ability to restore things?
What am I missing here, since there's no logs or errors for me to check I'm flying blind here and fairly annoyed at the fact that something so simple (essentially extracting files and running a few scripts for a 'normal' upgrade run) is failing so hard.
... Can anyone point me in the right direction?

--
Paul_one
 
  • Like
Reactions: pocketrule

paul_one

Senior Member
Oct 28, 2010
130
23
Portsmouth
*UPDATE*

So, I've got a semi-update:
I' was able to use Odin again to flash stock ROM, then re-flash vbmeta.tar, then re-flash recovery, then re-flash lineageOS 19.1
19.1 looks AWEFUL on first boot, nowhere near as 'refined' as 18.1 (using a scroll window center aligned makes me thing of old HTML from the late 90s before CSS).

Anyway, so I am able to boot into LineageOS 19.1 .. If I restore the "system_image" and wipe the data partition (clicking the 'wipe data' button) it allows me to also boot into 18.1 .. GREAT ....
...Except...

I still cannot restore the data partition using TWRP.
Still errors with a "extractTarFork()" error, code 255 .
The tars look "fine" on my Linux machine, and extract with only missing extended metadata errors.
I wrote a script to extract the tar files and run it in the TWRP terminal - it errors about file duplicates (no metadata errors).
I see that this is actually due to a character length limit on the filenames.
One sub-directory it tries to extract (sessions) is shortened (to 'session') and all files within it are extracted as the new shortened directory name... Meaning that it tries to delete a file (which it cannot since it's a directory) and write the file (which it cannot since the directory exists with that name)!

How is this possible when ALL android pathnames are disgustingly long. How has this not been seen before and why is this so cr*p?
There's 2 other 'tar' files (sym-links to 'toybox' - which I assume is a busybox clone) which are a different size to the normal one in the PATH... So I'm going to try those, but I'm a little lost as to how effective this will be, and I'm AMAZED that these errors aren't coming up on any google search since it seems it's broken from the foundational commands!
... How this ever backed up 'correctly' in the first place I will never know - but I'll never trust TWRP to 'backup' my data partition again..

--
Paul_one
 
  • Like
Reactions: pocketrule

paul_one

Senior Member
Oct 28, 2010
130
23
Portsmouth
Further update:
I progressed with the boot of the system to include a user account and put a decryption pattern on.
After rebooting, ensuring the "wiping" method was "rm -fr" in the settings, I was able to restore from the TWRP data backup.
I then have been able to copy the contents of the old /data/media directory into the new one.
... yet again: however....

The boot of the OS now is stuck on "tablet is starting", with no progress, no change, nothing.
I've tried another restore of the system_image but that hasn't changed anything.

I'll leave it going, just incase it's like a "restorecon" and all the files are being 'corrected' (which could understandably take a long time)... But isn't tarused to stop this sort of b**ks from happening?

This is the worst experience of "backup" I have had in over 20 years!!
If I had known the backup + restore mechanism wasn't actually tested I would have performed my own "dd" to stop any of this.

Hopefully this will be a warning for anyone else trying to use TWRP for 'backup' of actual data and people can make a much better choice going forward.

--
Paul_one
 
  • Like
Reactions: pocketrule

paul_one

Senior Member
Oct 28, 2010
130
23
Portsmouth
Another update:
So, I am attempting to check through various differences between a "clean" /data, and the /data that's restored and doesn't let the UI come up fully.

I thought "logcat" might be able to point me in the right direction (error message about "Unable to find com.android.systemui")... But it's not exactly helping me out with the mass of other minor errors etc.

I was able to get a tiny bit further by renaming the "/data/app" directory, so I'm now prompted for the pattern to decrypt/log in ... But the "tablet is starting" pops up after (as if the setup wizard is completing or something).
Pressing home does nothing. I can pull down the status bar to access things in there - but the "home" isn't coming up properly.

So, now it's just a long journey of trial+error to try and find the problematic files/directories.

--
Paul_one
 
  • Like
Reactions: pocketrule

vpn560

Senior Member
Oct 14, 2007
98
47
Samsung Galaxy Tab S5e

The difference between 18.1&TWRP and 19.1&TWRP is inability of TWRP to decrypt /data/media were TWRP directory locates. So once installed, 19.1 makes backup/recovery functions of TWRP inoperable since TWRP cannot nor decrypt nor find encrypted /data/media/TWRP. You can make sure of that with the file manager while in TWRP, seeing abracadabra instead of directory names in /data/media, which is an alias path to /storage/emulated/0 (0 stands for user0), where Download, TWRP etc locates.

The only thing You can do with TWRP when 19.1 installed is to whipe System and FORMAT Data.
Then, wifhout leaving TWRP, You can INSTALL, not RECOVER, prepared on external SD 18.1 zip. You can't recover since You can't create /data structure by means of TWRP, but installation of 18.1 can. Then reboot into system, scip all settings and reboot to TWRP. Now You can recover to previously saved 18.1 BACKUP.
 
Last edited:
  • Like
Reactions: pocketrule

Marty Red

Member
Dec 11, 2016
26
3
Toronto
The only thing You can do with TWRP when 19.1 installed is to whipe System and FORMAT Data.
Then, wifhout leaving TWRP, You can INSTALL, not RECOVER, prepared on external SD 18.1 zip. You can't recover since You can't create /data structure by means of TWRP, but installation of 18.1 can. Then reboot into system, scip all settings and reboot to TWRP. Now You can recover to previously saved 18.1 BACKUP.
That's unfortunate. I only discovered this now after upgrading from 18.1 to 19.1 four days ago....and then tried doing a backup through TWRP....which threw up a 255 fork error....
Wondering if a fix will be included with the next vewrsion....twrp-installer-3.6.1_9-0-lake.zip....
Is there any other backup/recovery through recovery you can recommend?
 

djimel

New member
Nov 5, 2022
2
0
Bonjour,
j'ai installé lineageos 19.1 (20221025) avec TWRP (3-5-1) sur mon oneplus 5T
tout est OK

Mais lors des mises à jour proposées par le telephone (>paramètres>systeme>gestionnaire de mises à jour) le tel redemarre en bootloops sur le logo lineage ???

Réinstallation de linéage mais en faisant un wipe paramètres usine et installation de TWRP (3-7-0)

= tout fonctionne paraitement (les mises à jour de la branche également)

Si ça peut servir....
 
Bonjour,
j'ai installé lineageos 19.1 (20221025) avec TWRP (3-5-1) sur mon oneplus 5T
tout est OK

Mais lors des mises à jour proposées par le telephone (>paramètres>systeme>gestionnaire de mises à jour) le tel redemarre en bootloops sur le logo lineage ???

Réinstallation de linéage mais en faisant un wipe paramètres usine et installation de TWRP (3-7-0)

= tout fonctionne paraitement (les mises à jour de la branche également)

Si ça peut servir....
- English Plesse

- wrong forum ; this is for Samsung Tab S5e, not Oneplus..
 
  • Like
Reactions: pocketrule

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    The only thing You can do with TWRP when 19.1 installed is to whipe System and FORMAT Data.
    Then, wifhout leaving TWRP, You can INSTALL, not RECOVER, prepared on external SD 18.1 zip. You can't recover since You can't create /data structure by means of TWRP, but installation of 18.1 can. Then reboot into system, scip all settings and reboot to TWRP. Now You can recover to previously saved 18.1 BACKUP.
    That's unfortunate. I only discovered this now after upgrading from 18.1 to 19.1 four days ago....and then tried doing a backup through TWRP....which threw up a 255 fork error....
    Wondering if a fix will be included with the next vewrsion....twrp-installer-3.6.1_9-0-lake.zip....
    Is there any other backup/recovery through recovery you can recommend?
    1
    Heya guys,

    I did get TWRP + LineageOS 18.1 working on this tablet a few months ago, and have been enjoying it (along with Magisk + google apps).
    I had to use Odin, since no other method worked - but I had to borrow a laptop for that (since I don't use Windows, and the Linux apps didn't work at all).

    Since LineageOS 19.1 was released, I thought I would give the upgrade a try, and also the backup + restore method a try for TWRP (must be tried + tested right? .. Or so I thought).

    So, I get a USB drive, exfat formatted, double the size of the internal storage.
    I backup all partitions except for "Dtbo", "cache", "EFS" (so all the stuff that might be touched by a potential patching I wanted backed up)..
    Data, I also renamed the "media" to "mediabak" and backed that up - so that I wouldn't lose any media files either.

    I then "install"ed the LineageOS 19.1 zip file using the TWRP "install" button.... Cleared the cache, aaaaand got the LineageOS boot animation and then just continual reboot...
    5 reboots later, I boot into TWRP: "no worries - I shall restore from my backups!" I say to myself.

    I restore everything except the "data" partition, thinking "it's OK, it's only data and it'll save me time restoring that"
    ... NOPE! - reboot and now I just get continual reboots but no boot animation.
    "Maybe I need to wipe them before hand?" - so I select to wipe the partitions (vendor, system, cache, ...).. Only data+recovery not being wiped.
    Restore
    .... NOPE!
    "Let's try data - maybe there's something funny in there?"
    .... NOPE! - and what's worse, I get a tar extraction error (255) - probably due to the fact the partition isn't encrypted (as a guess) - I found a webpage showing the "data" files in the backups are only tar files, and on my laptop they show as OK except for having some missing "TWRP.security.encrypt" and something about a missing equals sign on the extended metadata (so I think the data is all intact, so I can probably transfer / extract it after I get the tablet back).

    "Let's just try to re-install LineageOS 18.1 from the images... Wipe system, grab the image from the net, use TWRP to 'install' the image"
    .... NOPE! - still stuck with a boot loop.

    Why will TWRP not install the OS properly?
    How can I trust TWRP after this, with no ability to restore things?
    What am I missing here, since there's no logs or errors for me to check I'm flying blind here and fairly annoyed at the fact that something so simple (essentially extracting files and running a few scripts for a 'normal' upgrade run) is failing so hard.
    ... Can anyone point me in the right direction?

    --
    Paul_one
    1
    *UPDATE*

    So, I've got a semi-update:
    I' was able to use Odin again to flash stock ROM, then re-flash vbmeta.tar, then re-flash recovery, then re-flash lineageOS 19.1
    19.1 looks AWEFUL on first boot, nowhere near as 'refined' as 18.1 (using a scroll window center aligned makes me thing of old HTML from the late 90s before CSS).

    Anyway, so I am able to boot into LineageOS 19.1 .. If I restore the "system_image" and wipe the data partition (clicking the 'wipe data' button) it allows me to also boot into 18.1 .. GREAT ....
    ...Except...

    I still cannot restore the data partition using TWRP.
    Still errors with a "extractTarFork()" error, code 255 .
    The tars look "fine" on my Linux machine, and extract with only missing extended metadata errors.
    I wrote a script to extract the tar files and run it in the TWRP terminal - it errors about file duplicates (no metadata errors).
    I see that this is actually due to a character length limit on the filenames.
    One sub-directory it tries to extract (sessions) is shortened (to 'session') and all files within it are extracted as the new shortened directory name... Meaning that it tries to delete a file (which it cannot since it's a directory) and write the file (which it cannot since the directory exists with that name)!

    How is this possible when ALL android pathnames are disgustingly long. How has this not been seen before and why is this so cr*p?
    There's 2 other 'tar' files (sym-links to 'toybox' - which I assume is a busybox clone) which are a different size to the normal one in the PATH... So I'm going to try those, but I'm a little lost as to how effective this will be, and I'm AMAZED that these errors aren't coming up on any google search since it seems it's broken from the foundational commands!
    ... How this ever backed up 'correctly' in the first place I will never know - but I'll never trust TWRP to 'backup' my data partition again..

    --
    Paul_one
    1
    Further update:
    I progressed with the boot of the system to include a user account and put a decryption pattern on.
    After rebooting, ensuring the "wiping" method was "rm -fr" in the settings, I was able to restore from the TWRP data backup.
    I then have been able to copy the contents of the old /data/media directory into the new one.
    ... yet again: however....

    The boot of the OS now is stuck on "tablet is starting", with no progress, no change, nothing.
    I've tried another restore of the system_image but that hasn't changed anything.

    I'll leave it going, just incase it's like a "restorecon" and all the files are being 'corrected' (which could understandably take a long time)... But isn't tarused to stop this sort of b**ks from happening?

    This is the worst experience of "backup" I have had in over 20 years!!
    If I had known the backup + restore mechanism wasn't actually tested I would have performed my own "dd" to stop any of this.

    Hopefully this will be a warning for anyone else trying to use TWRP for 'backup' of actual data and people can make a much better choice going forward.

    --
    Paul_one
    1
    Another update:
    So, I am attempting to check through various differences between a "clean" /data, and the /data that's restored and doesn't let the UI come up fully.

    I thought "logcat" might be able to point me in the right direction (error message about "Unable to find com.android.systemui")... But it's not exactly helping me out with the mass of other minor errors etc.

    I was able to get a tiny bit further by renaming the "/data/app" directory, so I'm now prompted for the pattern to decrypt/log in ... But the "tablet is starting" pops up after (as if the setup wizard is completing or something).
    Pressing home does nothing. I can pull down the status bar to access things in there - but the "home" isn't coming up properly.

    So, now it's just a long journey of trial+error to try and find the problematic files/directories.

    --
    Paul_one