TWRP won't boot / stuck in loop - Moto G4 Plus Questions & Answers

I have a reproducible problem using TWRP - when I first install Lineage OS to my phone, TWRP works fine whenever I boot to it. After a single Lineage OS OTA update, it still works - but after the second or third update, TWRP becomes stuck in an endless loop while booting. The teamwin logo appears for 20-40 seconds, then the screen goes blank for 2 seconds, before the teamwin logo reappears. It will perform this loop forever if left - both if I reboot for an OTA update, or if I select recovery via the bootloader.
I've tried flashing the recovery partition with the latest version as well as earlier versions, and also erasing the cache partition and deleting /data/dalvik-cache via adb shell - none make any difference. The only way I've fixed it (temporarily until the next update anyway) was when I wiped and flashed the userdata and system partitions.
Is there a TWRP log I can look at to identify the problem?
Edit: Just realised I can adb shell in and output dmesg. The /sbin/recovery process is using too much memory and getting hit by the OOM killer - I'm guessing this is one for TWRP upstream...

tjbp said:
I have a reproducible problem using TWRP - when I first install Lineage OS to my phone, TWRP works fine whenever I boot to it. After a single Lineage OS OTA update, it still works - but after the second or third update, TWRP becomes stuck in an endless loop while booting. The teamwin logo appears for 20-40 seconds, then the screen goes blank for 2 seconds, before the teamwin logo reappears. It will perform this loop forever if left - both if I reboot for an OTA update, or if I select recovery via the bootloader.
I've tried flashing the recovery partition with the latest version as well as earlier versions, and also erasing the cache partition and deleting /data/dalvik-cache via adb shell - none make any difference. The only way I've fixed it (temporarily until the next update anyway) was when I wiped and flashed the userdata and system partitions.
Is there a TWRP log I can look at to identify the problem?
Edit: Just realised I can adb shell in and output dmesg. The /sbin/recovery process is using too much memory and getting hit by the OOM killer - I'm guessing this is one for TWRP upstream...
Click to expand...
Click to collapse
Reflash the latest twrp image it will work

Love Dhir said:
Reflash the latest twrp image it will work
Click to expand...
Click to collapse
Thanks - actually I found the solution - TWRP was attempting to read from my SD card when it booted, which had unreadable/corrupt blocks on it. The failure to read from the card caused an infinite loop and resulting memory leak causing it to be killed by the OOM killer. Removing the SD card solved it.

tjbp said:
Thanks - actually I found the solution - TWRP was attempting to read from my SD card when it booted, which had unreadable/corrupt blocks on it. The failure to read from the card caused an infinite loop and resulting memory leak causing it to be killed by the OOM killer. Removing the SD card solved it.
Click to expand...
Click to collapse
Ok

Related

[Q] Stuck in recovery boot loop...?

While using the PA Updater app to upgrade my rom, the app attempted to reboot into recovery to run an openrecovery script. While doing this, I believe it set my "reboot mode flag" to recovery.
The tablet boots with the Google screen and then shows the TWRP splash (I'm on version 2.6.0.0), then it reboots and starts again.
I am able to get to the bootloader, but even if I press start or recovery mode it reenters the boot loop trying to get into recovery. In the bootloader was where I saw the reboot mode flag set to recovery. Is there a way to use fastboot to remove that or am I just going to have to do a wipe with fastboot?
It happened to me once. I pushed the power button for 60 seconds as it supposed to do a kind of battery pull, and it worked.
HunterOrHunted said:
While using the PA Updater app to upgrade my rom, the app attempted to reboot into recovery to run an openrecovery script. While doing this, I believe it set my "reboot mode flag" to recovery.
The tablet boots with the Google screen and then shows the TWRP splash (I'm on version 2.6.0.0), then it reboots and starts again.
I am able to get to the bootloader, but even if I press start or recovery mode it reenters the boot loop trying to get into recovery. In the bootloader was where I saw the reboot mode flag set to recovery. Is there a way to use fastboot to remove that or am I just going to have to do a wipe with fastboot?
Click to expand...
Click to collapse
same thing just happened to me... tried Factory Reset and TWRP ran an Open Recovery Script and boom... boot loop... TWRP screen pops up and then goes to loop...
tried pressing powerbutton but no use...
any workaround for this???
Lordificated said:
same thing just happened to me... tried Factory Reset and TWRP ran an Open Recovery Script and boom... boot loop... TWRP screen pops up and then goes to loop...
tried pressing powerbutton but no use...
any workaround for this???
Click to expand...
Click to collapse
I've done this twice to my nexus now and I think I found a reliable way to restore to running condition. YMMV
1)Boot the nexus into fastboot (power and both volume keys) when you power up.
2)Attach your usb cable from the PC (or MAC I guess, dont have one to try)
3)start WUG Nexxus Root Toolkit. 'Launch' advanced utilities.
4)Test your fastboot with Quick tools. check the button at Fastboot-Bootloader and click 'List Devices' if the box that pops up is empty then fastboot isn't working (I can't help you there and it must be working to continue).
5)If fastboot shows a device then go to "Boot Temporary" and click 'Custom Recovery'.
6)I selected 'Touch TWRP' but CMW may work as well. This will reboot you into (temp)TWRP and from there you can force a reboot that will reset the 'Recovery' flag that has locked your bootloader.
7)Give it a few minutes (be patient for 5 minutes) and hopefully you reboot to where you were prior to this mess.
Long time lurker and couldn't fix my fails without everyone here.
Thanks to all.
Bill
HunterOrHunted said:
While using the PA Updater app to upgrade my rom, the app attempted to reboot into recovery to run an openrecovery script. While doing this, I believe it set my "reboot mode flag" to recovery.
The tablet boots with the Google screen and then shows the TWRP splash (I'm on version 2.6.0.0), then it reboots and starts again.
I am able to get to the bootloader, but even if I press start or recovery mode it reenters the boot loop trying to get into recovery. In the bootloader was where I saw the reboot mode flag set to recovery. Is there a way to use fastboot to remove that or am I just going to have to do a wipe with fastboot?
Click to expand...
Click to collapse
I had the same thing happen to me (though i updated from stock 4.4 to 4.4.2 [and i had twrp installed]). I tried reflashing to stock recovery and a few other things but same problem, it kept booting me into stock recovery. I know this is going to sound crazy, even stupid, but just letting it sit there for 5 minutes (at the stock recovery screen) let it work... I was searching for more things to try and it just started booting.... Checking the bootloader again showed the reboot mode flag set to none.
zeroedout420 said:
I had the same thing happen to me (though i updated from stock 4.4 to 4.4.2 [and i had twrp installed]). I tried reflashing to stock recovery and a few other things but same problem, it kept booting me into stock recovery. I know this is going to sound crazy, even stupid, but just letting it sit there for 5 minutes (at the stock recovery screen) let it work... I was searching for more things to try and it just started booting.... Checking the bootloader again showed the reboot mode flag set to none.
Click to expand...
Click to collapse
I guess mine worked because I was still on stock bootloader and adding TWRP was an important key but the 5 minutes seems to be the solution after all the rest.
recovery boot loop:- Is coz, one of your partitions would be facing problems while mounting.. So Wipe the Partition and Format it with Ext-2 file format. and reboot the Mobile. Then it'll stops rebooting.
Do you have a Samsung device?
Be warned - there is no such thing as fastboot mode for most Samsung Galaxy devices - you'll be wasting your time doing this and typing "fastboot devices" for many hours!
If you have problems with your recovery, it works to just reflash the CF-autoroot kit, which happens to flash the cache partition too. My problem was similar to the OP's - a bootloop with TWRP's obviously buggy OpenRecoveryScript, which was installing a ZIP file over and over again.
If you flash the CF-autoroot specific to your device, TWRP will be gone, but the phone will boot normally again - with all your data on it - hooray!
Then you install TWRP or CWM recovery as you did originally.
Stay away from OpenRecoveryScripts! I'll be installing a ZIP file in the traditional, manual way from now on, from an external SD card so I can remove the card if I get another TWRP boot loop.
carltasmania said:
Be warned - there is no such thing as fastboot mode for most Samsung Galaxy devices - you'll be wasting your time doing this and typing "fastboot devices" for many hours!
If you have problems with your recovery, it works to just reflash the CF-autoroot kit, which happens to flash the cache partition too. My problem was similar to the OP's - a bootloop with TWRP's obviously buggy OpenRecoveryScript, which was installing a ZIP file over and over again.
If you flash the CF-autoroot specific to your device, TWRP will be gone, but the phone will boot normally again - with all your data on it - hooray!
Then you install TWRP or CWM recovery as you did originally.
Stay away from OpenRecoveryScripts! I'll be installing a ZIP file in the traditional, manual way from now on, from an external SD card so I can remove the card if I get another TWRP boot loop.
Click to expand...
Click to collapse
How do you install cf-autoroot when stuck in a boot loop with samsung galaxy S device if there is no fastboot?
My phone is stuck in bootloop too. It shows Twrp at the starting and then restarts. What am i supposed to do? I need help ASAP please

Failed to mount any partition / Kernel Panic / boot loop / Galaxy S5 klte

Phone was running stock os. I rebooted my phone and it's now stuck in a boot loop. I tried to reinstall it through Smart Switch and it's still stuck in a boot loop.
After the reinstall it goes to "Installing system updates" and almost right after it stops and shows "Erasing" for a second. It then reboots a few times and it usually goes to the Kernel Panic error but it has also gone to Manual Mode once to try and install the updates but then it fails to mount any partition.
I've tried installing Lineage OS (I used it before I went back to stock os) through TWRP and I also got the same errors. I was unable to mount any partitions and left the phone without a battery for a few a day.
When I tried again just now I was able to mount the partitions but installing Lineage OS or stock OS was still not possible and it gave me the same errors again.
Is there anything I can do to fix this?
First error after boot loops: imgur.com/a/ZOTfR
Errors on TWRP: imgur.com/a/qYqsY
Manual install in recovery: imgur.com/a/YHeyS
Another error: imgur.com/a/xPHdm
EDIT: After trying for three days, it suddenly booted. I can boot to the OS but the phone still crashes and boot loops every time. If I go to recovery and wipe cache it will boot again. What can I do to stop it from crashing and going back to boot loops?

Phone only boots with factory mode. I did something wrong.

I have the MetroPCS xt1765 running lineageos 14.1. When unlocking and doing all that jazz, the guide said that you can't flash twrp, only boot it. But I got annoyed that /data wouldn't mount so I just tried to flash it anyway and it worked. On cmd it said that the file wasn't signed or corrupt, but it still wrote to the device. I thought nothing about it at first but when I tried to boot the device it automatically when into twrp. I tried to reboot to system again, and the same thing happened.
Eventually /data successfully mounted and I was able to format it and install linage. I hoped that would fix the problem but it's still there. I believe I would need the stock boot image and probably stock recovery as well. I hope someone out there has these files.
Also when booting with factory mode, my data isn't working at all. The apn setting are right and all, but it's not working.
ZacharyTheUmbreon said:
I have the MetroPCS xt1765 running lineageos 14.1. When unlocking and doing all that jazz, the guide said that you can't flash twrp, only boot it. But I got annoyed that /data wouldn't mount so I just tried to flash it anyway and it worked. On cmd it said that the file wasn't signed or corrupt, but it still wrote to the device. I thought nothing about it at first but when I tried to boot the device it automatically when into twrp. I tried to reboot to system again, and the same thing happened.
Eventually /data successfully mounted and I was able to format it and install linage. I hoped that would fix the problem but it's still there. I believe I would need the stock boot image and probably stock recovery as well. I hope someone out there has these files.
Also when booting with factory mode, my data isn't working at all. The apn setting are right and all, but it's not working.
Click to expand...
Click to collapse
When it was booting to twrp only, you just select reboot bootloader and in bootloader select start and you will get system. This twrp doesn't read and clear bootloader control block (BCB) properly which causes this. There is a fix. I'll find the link.
Do you mean fastboot/bootloader mode? If yes, try this

Struggling to back stock up

Hi all,
I'm trying to back stock up I have booted to twrp 3.2.1.1 with encryption supported and that always hangs at "updating partition details" and after reading and reading it's the twrp that's at fault.
So I wiped the phone again from within settings and then try to boot official twrp 3.2.1. and It just hangs on the splash screen.
So I thought it's not fully wiped, no problems so tried to format in fastboot.
"Fastboot format userdata"
but this gives me
"formatting is not supported for filesystem with type raw"
So now I'm stuck on what to try next.
Right I wiped in stock recovery and got twrp official to start a backup but again it's hanging on updating partition details.
Looks like just I have this problem?
Follow this tutorial till you reach the point of flashing:
https://forum.xda-developers.com/g5-plus/how-to/how-to-root-moto-g5-plus-t3579659/post75114774
nightwalkerx22 said:
Follow this tutorial till you reach the point of flashing:
https://forum.xda-developers.com/g5-plus/how-to/how-to-root-moto-g5-plus-t3579659/post75114774
Click to expand...
Click to collapse
It doesn't mention backing it up, and that's when my problem of it hanging starts.
I've booted to twrp many times and always hangs on "updating partition details."
Only thing I haven't done is actually reboot twrp by tapping reboot recovery in twrp.
Would that make the difference before I wipe it yet again?

Phone bricked after installing LinageOS 17.1 - System UI Crashing

Hi,
Today I tried to install LinageOS 17.1 on my Huawei P10 lite (at start, still completely Stock Rom).
Unlocked bootloader following procedure in https://forum.xda-developers.com/p10-lite/how-to/p10-lite-bootloader-unlock-june-2020-t4113315, worked great.
Installed TWRP following https://forum.xda-developers.com/p10-lite/development/recovery-twrp-huawei-p10-lite-t3953890 ; also here, no problem.
Then I tried installing LinageOS following this thread https://forum.xda-developers.com/p10-lite/development/rom-lineageos-17-1-huawei-p10-lite-t4064115 . Here I ended up with the Linage OS System UI that constantly crashes, restarts, crashes again etc.
This problem is mentioned in the same thread but none of the solutions seems to work for me.
I tried to downgrade the TWRP to the older 3.3.1 and then redo the entire installation procedure => No success
Then I tried wiping and formatting all the caches/data that was mentioned during the thread + re-executing the entire installation procedure => Still no success.
Can anyone help me?
What could also be relevant:
In TWRP I cannot seem to copy data to the device, whenever I try to do that via the File Manager (I am using Linux Mint 20) I can see the device and its internal storage but transferring data is horribly slow (it would take 5 hours 45 minutes to transfer a 3 MB file) or just fail. I also tried this in a (virtualized) Windows 10 installation with the same results.
When earlier today (before having installed LinageOS) I tried to transfer files, it worked very well. Also, I tried it with multiple USB cables just in case it might have been a faulty cable.
Pushing a file via adb push doesn't work as the device shows up as "unauthorized". The installation of the patches (magisk, los_patches_warsaw, opengapps etc.) I did using ADB Sideload which seemed to work nicely as well - really making me thing that the USB transfer issue is not hardware-related...
Furthermore, I know this is a noob question but anyway: the procedure says "flash los_patches_warsaw.zip". How exactly should this be done? Copying the file to the internal storage from a PC (which I cannot do, see above) and installing it via TWRP Install? Flash via Fastboot (to what destination)?
Tx in advance!
I've had this issue as well, what I did was disabled dm-verity and forceencrypt using https://forum.xda-developers.com/android/software/universal-dm-verity-forceencrypt-t3817389 after flashing system in fastboot and then I flashed los_patches_warsaw.zip from SD Card (MTP is broken in older twrp, use 3.4.0, also try this at your own risk).
Thanks. I solved it in another way meanwhile.
I reinstalled the stock recovery (which I was able to do by choosing the E-Recovery option in the "your device's bootloader has been unlocked" screen after startup. It reinstalled the stock recovery and ROM.
After that I installed the image from OpenKirin (it didn't need TWRP - even more, only the stock recovery is supported if using OpenKirin), and then it worked like a charm.
Just one thing, I cannot find how to update the OpenKirin installation except for flashing it via Fastboot (no option to auto-update). I wonder if it is even possible?
Bart80TR said:
Thanks. I solved it in another way meanwhile.
I reinstalled the stock recovery (which I was able to do by choosing the E-Recovery option in the "your device's bootloader has been unlocked" screen after startup. It reinstalled the stock recovery and ROM.
After that I installed the image from OpenKirin (it didn't need TWRP - even more, only the stock recovery is supported if using OpenKirin), and then it worked like a charm.
Just one thing, I cannot find how to update the OpenKirin installation except for flashing it via Fastboot (no option to auto-update). I wonder if it is even possible?
Click to expand...
Click to collapse
I think it's only possible by dirty flashing it, also a little correction for my last post, I meant internal storage not micro SD card.
it's a shame the original LOS 17.1 thread is closed.
My experience with WAS-AL00 (china version) on macOS:
After I flash LOS 17.1 ROM, "fastboot reboot recovery" doesn't reboot the device into recovery. Then I unplug the phone, and reboot into system, I came across system UI crashing constantly. After managing to get through to the main screen. Plug the phone, "adb reboot recovery", then flash los_patches_warsaw from microsd card (you need to copy the file to a microsd card and insert it into the phone). Then reboot system, this time the screen is black. only long press power button show three options "power off", "restart", and another one i don't remember. @KinteLiX 's method didn't work for me.
Then I tried stock recovery with openKirin (worked), Twrp 3.4.0.0 with openKirin (also worked, even though they state that only stock recovery works with their ROMs).
Last I tried twrp 3.4.0.0 with AOSP 10 from @DarkJoker360. It works.
Note: after flash the ROM, power off the phone, and long press three buttons volume up, volume down and power at the same time, and you will boot into twrp. If it shows update fail, then reboot and try to get into erecovery and wipe data/factory reset and then power off, long press three buttons simultaneously and you will be able to boot into twrp, if not, wipe data/factory reset again in erecovery (I accidentally found out about this. before this I was unable to boot into twrp after flashing any ROM, "fastboot reboot recovery" doesn't work). then do as the thread shows.
update: making a call doesn't work with AOSP 10 on my device.
The system crashing should come from the integratet AOD overlay....there should be a solution to solve that issue but i didnt rember the correct way how to. Just search in the p10 lite forum here on XDA.

Categories

Resources