Accidentally wiped system - OnePlus 5 Questions & Answers

So I was going to install xXx NoLimits rom and I went to wipe my storage as to not cause and errors or mess ups. I went to select cache and dalvik/art in advanced wipe and accidentally hit system and swiped to format. Now I'm here in twrp with nothing but the root directory.
I have already tried adb sideload to get OOS back on it. It completed but nothing shows up under sdcard or in any of the root folders. I also tried adb push to the sdcard and it spits out and error. I looked back at some old forum posts and they said to install the sdcard fix in twrp but how am I supposed to get in on the phone if sideload or push don't work?
EDIT: I do have backups of OOS but have no way to get them on the phone.

I can get stuff on the phone now with push and sideload but when I sideloaded the OOS zip and tried installing it, TWRP says its corrupt! Its goes up to about 40% in powershell but the bar on TWRP says 100% and it stops the sideload command from completing. after it "finishes" powershell says "Total xfer: 1.00x"

You still can get into TWRP correct? Then once in TWRP connect your phone to your PC. Take the full zip, not the OTA and drag it into the phone and flash the full OTA. You shouldn't have to worry about sideloading with ADB. I've done this plenty of times, and one by accident as well.

Eric214 said:
You still can get into TWRP correct? Then once in TWRP connect your phone to your PC. Take the full zip, not the OTA and drag it into the phone and flash the full OTA. You shouldn't have to worry about sideloading with ADB. I've done this plenty of times, and one by accident as well.
Click to expand...
Click to collapse
It's okay I figured it out. The problem was is that I completely formatted the system partition and couldn't directly access it from my computer. My solution was to ADB push the full zip file and wait for it to finish. Then I could flash it in TWRP. This whole thing could have been made a whole lot simpler if the Team Win devs would put out 3.1.1-2 and just use the OTG capability of the unofficial one.

Wiping system is no big deal. Just flash the rom zip file and you'll be good.

PwnedBySumo said:
It's okay I figured it out. The problem was is that I completely formatted the system partition and couldn't directly access it from my computer. My solution was to ADB push the full zip file and wait for it to finish. Then I could flash it in TWRP. This whole thing could have been made a whole lot simpler if the Team Win devs would put out 3.1.1-2 and just use the OTG capability of the unofficial one.
Click to expand...
Click to collapse
Or if OnePlus added sd card reader into phone...
This is a valid argument for it...

I had your own problem, I solved buying an OTG cable and then I flashed the rom.zip from TWRP.

Related

[Q] LG G2 d802 internal storage formated, TWRP, rooted -> back to stock?

Hello,
After trying a lot of things and search for half of the day my last chance is now to ask one of you guys for help, please.
Problem:
After I have tried to encrypt the internal storage of my LG G2 via the the previous installed Cyanogenmod 11 this attempt resulted into an error and it has told to me that I should reset to factory stock. This has been worked out as the needed directories havent been found via TWRP recovery. So I have tried to do a hard factory reset as well as a a following format of the internal storage from recovery which brings me now to the boot screen with the LG logo. Not going any further. Not possible to turn the phone off anymore. But I am still able to access the TWRP recovery menu. But as the internal storage has been formated its longer possible to boot up into any ROM.
I am also not able to restore via LG Flash tool, as it is not going any further in download mode.
So I would need help with my last thought of a solution: Pushing a custom (or stock rom) ZIP file via ADP in TWRP to the internal storage, so that I can flash this one again as new operation system. Could someone please give me a precise step to step guide for the ADP slide method as I am unfortunately not good regarding any development tools.
Other methods are more than welcome as well, to re-flash stock or a custom rom to the system, without having access to it in any other way than TWRP.
Mac and Windows operation system is available on a computer. USB driver installed. stock rom kdz file downloaded. But I am not able to move forward. So please help.
Thanks!
Columbiana said:
Hello,
After trying a lot of things and search for half of the day my last chance is now to ask one of you guys for help, please.
Problem:
After I have tried to encrypt the internal storage of my LG G2 via the the previous installed Cyanogenmod 11 this attempt resulted into an error and it has told to me that I should reset to factory stock. This has been worked out as the needed directories havent been found via TWRP recovery. So I have tried to do a hard factory reset as well as a a following format of the internal storage from recovery which brings me now to the boot screen with the LG logo. Not going any further. Not possible to turn the phone off anymore. But I am still able to access the TWRP recovery menu. But as the internal storage has been formated its longer possible to boot up into any ROM.
I am also not able to restore via LG Flash tool, as it is not going any further in download mode.
So I would need help with my last thought of a solution: Pushing a custom (or stock rom) ZIP file via ADP in TWRP to the internal storage, so that I can flash this one again as new operation system. Could someone please give me a precise step to step guide for the ADP slide method as I am unfortunately not good regarding any development tools.
Other methods are more than welcome as well, to re-flash stock or a custom rom to the system, without having access to it in any other way than TWRP.
Mac and Windows operation system is available on a computer. USB driver installed. stock rom kdz file downloaded. But I am not able to move forward. So please help.
Thanks!
Click to expand...
Click to collapse
Follow this guide and adb push a Rom to your sd. It must be a zip, not a kdz, place it in your root drive like C:\ and don't forget that adb is case sensitive.
Art Vanderlay said:
Follow this guide and adb push a Rom to your sd. It must be a zip, not a kdz, place it in your root drive like C:\ and don't forget that adb is case sensitive.
Click to expand...
Click to collapse
Hello,
Thanks for this guide which is really easy to use and I would say my ADB on windows are now ready to push. Unfortunately the ADB are not discovering my devices useing TWRP on it, as the sidemode is not starting up. When I am in TWRP recovery and tapping advanced, tapping adb sidemode it shows me that it would start, but it never tells me that it is started.
Is there any other "entrace" to my devices where I could push a new rom zip file onto it without this TWRP adb sidemode? Or can I reinstall TWRP in any way to "repair" the sidemode feature?
Columbiana said:
Hello,
Thanks for this guide which is really easy to use and I would say my ADB on windows are now ready to push. Unfortunately the ADB are not discovering my devices useing TWRP on it, as the sidemode is not starting up. When I am in TWRP recovery and tapping advanced, tapping adb sidemode it shows me that it would start, but it never tells me that it is started.
Is there any other "entrace" to my devices where I could push a new rom zip file onto it without this TWRP adb sidemode? Or can I reinstall TWRP in any way to "repair" the sidemode feature?
Click to expand...
Click to collapse
Don't worry too much about sideload just write adb push C:\ROM name /sdcard/ and then just locate it in twrp
If you are sideloading you need to use the adb sideload /path/to/Rom.zip command

Soft Bricked Oneplus 5 - Virturally Zero storage, accidentally deleted I think.

Guys i got my oneplus 5 in the mail yesterday and I like it, but I think i ****ed up...big time. please somebody help me out.
i was following this guide: https://forum.xda-developers.com/oneplus-5/how-to/oneplus-5-unlock-bootloader-flash-twrp-t3624877
to root my oneplus 5 so i can use Adaway. Ive rooted and installed a custom rom many times on my oneplus one before so I didn't really have any issues.
but then when I got to "Gaining root access" part, I was a little confused because I wasn't sure what step to take, so i Just did the stuff from the top. I think somewhere along the way I ****ed up and for some reason all my folders are gone except for android. (ie downloads, notifications, alarms, ringtones, music, pictures, etc folders are gone)
even when i take a picture, it just disappears because it has nowhere to save to... . when I plug it in with file transfer mode, there is literally only 1 folder, look at this picture: http://imgur.com/a/F49v0
is there anything I can do to fix this? or did i just GG no re 540$? I know i'm a ****ing stupid ass ****ing low life piece of **** dumbass **** head.
If worse comes to worse, I still got like 13 days left to return it if possible? Do u think they'll accept a return or replacement from me?
****
when I go to google and try to download an image, it says It can't be downloaded because of missing SD card. wtf is going on?!
EDIT UPDATE: okay now my phone is stuck on boot screen with the 1+ symbol. any1 know how to help me out?
onepluslover69 said:
Guys i got my oneplus 5 in the mail yesterday and I like it, but I think i ****ed up...big time. please somebody help me out.
i was following this guide: https://forum.xda-developers.com/oneplus-5/how-to/oneplus-5-unlock-bootloader-flash-twrp-t3624877
to root my oneplus 5 so i can use Adaway. Ive rooted and installed a custom rom many times on my oneplus one before so I didn't really have any issues.
but then when I got to "Gaining root access" part, I was a little confused because I wasn't sure what step to take, so i Just did the stuff from the top. I think somewhere along the way I ****ed up and for some reason all my folders are gone except for android. (ie downloads, notifications, alarms, ringtones, music, pictures, etc folders are gone)
even when i take a picture, it just disappears because it has nowhere to save to... . when I plug it in with file transfer mode, there is literally only 1 folder, look at this picture: http://imgur.com/a/F49v0
is there anything I can do to fix this? or did i just GG no re 540$? I know i'm a ****ing stupid ass ****ing low life piece of **** dumbass **** head.
If worse comes to worse, I still got like 13 days left to return it if possible? Do u think they'll accept a return or replacement from me?
****
when I go to google and try to download an image, it says It can't be downloaded because of missing SD card. wtf is going on?!
EDIT UPDATE: okay now my phone is stuck on boot screen with the 1+ symbol. any1 know how to help me out?
Click to expand...
Click to collapse
Try to reboot into TWRP and format everything, including internal storage. Then flash any ROM and reboot.
If this doesn't work, you'll have to start all over again. Do a complete revert to stock.
Download the stock OP5 OOS 4.5.4 zip.
Download OnePlus stock recovery.
Reboot into fastboot/bootloader mode.
Flash stock recovery.
Boot into stock recovery.
Do a full wipe of /system and /data and /data/media (internal storage).
Sideload the full zip you downloaded in step 1 and flash it via stock recovery.
Reboot your phone.
easy
http://forum.xda-developers.com/attachment.php?attachmentid=3761904&d=1464187934
MrKhozam said:
Try to reboot into TWRP and format everything, including internal storage. Then flash any ROM and reboot.
If this doesn't work, you'll have to start all over again. Do a complete revert to stock.
Download the stock OP5 OOS 4.5.4 zip.
Download OnePlus stock recovery.
Reboot into fastboot/bootloader mode.
Flash stock recovery.
Boot into stock recovery.
Do a full wipe of /system and /data and /data/media (internal storage).
Sideload the full zip you downloaded in step 1 and flash it via stock recovery.
Reboot your phone.
Click to expand...
Click to collapse
i'm downloading a rom right now. btw I thought the latest OP5 OOS rom was 4.5.3?
huaiyue said:
easy
http://forum.xda-developers.com/attachment.php?attachmentid=3761904&d=1464187934
Click to expand...
Click to collapse
might I ask what exactly does this zip do?
update: solved everything by following khozam's method! that guys a ****ing beast. saved my ass. cheers
Sideload cannot read zip file
MrKhozam said:
Try to reboot into TWRP and format everything, including internal storage. Then flash any ROM and reboot.
If this doesn't work, you'll have to start all over again. Do a complete revert to stock.
Download the stock OP5 OOS 4.5.4 zip.
Download OnePlus stock recovery.
Reboot into fastboot/bootloader mode.
Flash stock recovery.
Boot into stock recovery.
Do a full wipe of /system and /data and /data/media (internal storage).
Sideload the full zip you downloaded in step 1 and flash it via stock recovery.
Reboot your phone.
Click to expand...
Click to collapse
Followed the steps. Everything works fine until sideload. I constantly get error in CMD prompt: cannot read...
I tried removing the zip file extension, dragging the file into command prompt. What am I doing wrong?
I have the same problem as OP where I foolishly deleted storage and now all I have is the android folder on the phone and cannot save files, nor download certain apps from the play store.
Thank you in advance...
sawihsiwi said:
Followed the steps. Everything works fine until sideload. I constantly get error in CMD prompt: cannot read...
I tried removing the zip file extension, dragging the file into command prompt. What am I doing wrong?
I have the same problem as OP where I foolishly deleted storage and now all I have is the android folder on the phone and cannot save files, nor download certain apps from the play store.
Thank you in advance...
Click to expand...
Click to collapse
Can you try formating first using the flash tool? If you accedentally deleted all folders even those in the root branch of the phone, It will generate the necessary files on your phone i think. Then you can simply flash twrp using the tool and should see the folders in twrp. Otherwise you can flash the full ota to generate them
sawihsiwi said:
Followed the steps. Everything works fine until sideload. I constantly get error in CMD prompt: cannot read...
I tried removing the zip file extension, dragging the file into command prompt. What am I doing wrong?
I have the same problem as OP where I foolishly deleted storage and now all I have is the android folder on the phone and cannot save files, nor download certain apps from the play store.
Thank you in advance...
Click to expand...
Click to collapse
Theoretically you should also be able to issue the following command in Recovery:
Code:
adb push -p [COLOR="Red"]<full zip path>[/COLOR] /sdcard/
Then select the zip from there. If you still get the read error, can you try rebooting into normal mode and issuing the same command?
Thank you for your help. huaiyue's storage fix zip file actually did the trick. I was able to restore everything back to normal. So thank you and thanks to huaiyue.
If anyone ever faces this again, Just follow below mentioned steps..
1: Flash TWRP
2: Got to Wipe and FORMAT data this will Decrypt you... AND let's you access your internal storage again..!
3: Now copy stock rom and FLASH.. This makes you ENCRYPTED again.
4: Now everything should be back to normal, just flash twrp again and enjoy..
Go to TWRP ----> select DATA (check it) ---> DONT swipe to wipe but click on REPAIR OR CHANGE FILE SYSTEM and select EXT 4. After that, reboot to twrp and data is recognized as normal sdcard..
That SD card fix helped but I want to know, what caused this?
---------- Post added at 12:03 AM ---------- Previous post was at 12:00 AM ----------
huaiyue said:
easy
http://forum.xda-developers.com/attachment.php?attachmentid=3761904&d=1464187934
Click to expand...
Click to collapse
thankyou so much dude!

Create Stock Recovery.img from FTF File

Hi, I am in the process of preparing for upgrading from 7.0 to 7.1.1
I know I need to replace the Custom Kernel with the Stock Kernel. And I have to replace TWRP with Stock Recovery.
Can anybody tell me, which file inside the FTF is the stock recovery? I already found the kernel. Need help to find the stock recovery, thank you!
tempurastyle said:
Need help to find the stock recovery, thank you!
Click to expand...
Click to collapse
We don't have one which is why we have to use TWRP.
So my only way is to flash via Flashtool without wipe?
tempurastyle said:
So my only way is to flash via Flashtool without wipe?
Click to expand...
Click to collapse
Do that then mod your own kernel. [How To] make your own XPERIA DRM-fix kernel.
And flash a TWRP.img to the recovery partition.
fotakernel.sin reside's where we flash twrp on stock. you do not need to flash it to upgrade, contrary you can exclude it in flashtool and keep twrp between updates.
realtuxen said:
fotakernel.sin reside's where we flash twrp on stock. you do not need to flash it to upgrade, contrary you can exclude it in flashtool and keep twrp between updates.
Click to expand...
Click to collapse
this is real knowledge, thanks! so just to be sure, this is what i will do in flashtool:
1) wipe: nothing selected
2) exclude: fotakernel.sin selected
can anybody confirm this is correct?
then after this, i will flash a custom kernel via fastboot and magisk via twrp.
one question regarding magisk: will it be deleted during the flashtool update?
So I ran into a problem...
The Upgrade to 7.1.1 via flashtool was smooth. Then, i flashed twrp via fastboot as usual. When I tried to enter twrp, i get a password prompt to decrypt the phone. So i don't know which password i need to type in. I tried the unlock PIN, doesnt work. Any suggestions?
tempurastyle said:
Any suggestions?
Click to expand...
Click to collapse
To get round that you need to run the following commands...
Code:
fastboot format userdata
fastboot format cache
...so you'll need to backup all your data first.
XperienceD said:
To get round that you need to run the following commands...
Code:
fastboot format userdata
fastboot format cache
...so you'll need to backup all your data first.
Click to expand...
Click to collapse
Ok, so I decided to keep my data and don't install twrp. Now I got another issue, is it possible to install Magisk without TWRP? I already got my kernel using my ta backup according to the instructions a few posts above, which really works great.
tempurastyle said:
Ok, so I decided to keep my data and don't install twrp. Now I got another issue, is it possible to install Magisk without TWRP? I already got my kernel using my ta backup according to the instructions a few posts above, which really works great.
Click to expand...
Click to collapse
I thought you excluded fotakernel so you did not have to flash twrp again. Oh well anyway you can use twrp to flash zips just fine although /data is encrypted, most flash zips do not write to /data anyway some like supersu use /cache (which is not encrypted contrary to the info above) to get around encryption at next boot. And like magisk also patch the boot.img live on your phone, some write to /system which is not encrypted either, I never seen a flash zip that did write to /data. Only backup/browsing/etc on /data is affected.
So when presented with the password screen in twrp just press cancel and make sure the zip you want to flash is located on the external sd card (do not encrypt this in phone settings, your card will be unreadable from pcs to) then choose flash zip and choose the external sdcard to pick the zip from and flash magisk or whatever. You need to run your kernel through ta poc or rootkernel first and disable dm verity and sony ric. (you write you did this so just install twrp and flash away) Do not wipe cache before rebooting just in case magisk uses this in a similar way to supersu (I have no idea)
Also if you do the above fastboot format commands suggested in post#8 without disabling 'forceencrypt' for /data (fstab in the kernel image or with a tool) the phone will encrypt itself again as soon as you turn it on.
If forceencrypt is disabled the same can be achieved (clearing encryption) with a factory reset btw.
So if you did not bump into the password in twrp before you likely did a factory reset with a kernel with encryption disabled. Then, maybe after updating you rebooted stock and the phone encrypted itself again, then now you can not access /data in twrp. Thats also because we have no version of it that supports encryption on the X-compact though. Again do not worry, I have not meet a zip I could not flash, supersu, magisk, etc because they do not access /data anyway.
realtuxen said:
I thought you excluded fotakernel so you did not have to flash twrp again. Oh well anyway you can use twrp to flash zips just fine although /data is encrypted, most flash zips do not write to /data anyway some like supersu use /cache (which is not encrypted contrary to the info above) to get around encryption at next boot. And like magisk also patch the boot.img live on your phone, some write to /system which is not encrypted either, I never seen a flash zip that did write to /data. Only backup/browsing/etc on /data is affected.
So when presented with the password screen in twrp just press cancel and make sure the zip you want to flash is located on the external sd card (do not encrypt this in phone settings, your card will be unreadable from pcs to) then choose flash zip and choose the external sdcard to pick the zip from and flash magisk or whatever. You need to run your kernel through ta poc or rootkernel first and disable dm verity and sony ric. (you write you did this so just install twrp and flash away) Do not wipe cache before rebooting just in case magisk uses this in a similar way to supersu (I have no idea)
Click to expand...
Click to collapse
Yes, after the first upgrade attempt, i let twrp untouched. then when entering twrp, i didnt have a password, so i skipped it. i couldn't find the sd card in the file browser, and after i hit reboot in twrp the phone restarted and got stuck in boot.
So I flashed again, this time deleting twrp. the initial boot up went fine. Then i flashed twrp again and once again, without having a password, i just skipped the password prompt. still couldnt find the sd card, and i rebooted out of twrp. and the phone got stuck again.
after 2-3 trials, i figured out that everytime i rebooted out of twrp, the phone gets stuck during boot. even after turning it off and on, so a reflash was needed.
now i have given up using twrp, so i have an unrooted phone with an unlocked bootloader. which does not allow me to use android pay. i think to solve my problem is:
1) i need to know which twrp version really works, i have tried
this version
and this version
both cause a boot failure for me
2) i need to find the sd card location in the twrp file browser (all the folders show empty for me)
if nothing works, i guess i need to wipe my phone, but that's what i would like to avoid. thanks for your help guys!
tempurastyle said:
Yes, after the first upgrade attempt, i let twrp untouched. then when entering twrp, i didnt have a password, so i skipped it. i couldn't find the sd card in the file browser, and after i hit reboot in twrp the phone restarted and got stuck in boot.
So I flashed again, this time deleting twrp. the initial boot up went fine. Then i flashed twrp again and once again, without having a password, i just skipped the password prompt. still couldnt find the sd card, and i rebooted out of twrp. and the phone got stuck again.
after 2-3 trials, i figured out that everytime i rebooted out of twrp, the phone gets stuck during boot. even after turning it off and on, so a reflash was needed.
now i have given up using twrp, so i have an unrooted phone with an unlocked bootloader. which does not allow me to use android pay. i think to solve my problem is:
1) i need to know which twrp version really works, i have tried
this version
and this version
both cause a boot failure for me
2) i need to find the sd card location in the twrp file browser (all the folders show empty for me)
if nothing works, i guess i need to wipe my phone, but that's what i would like to avoid. thanks for your help guys!
Click to expand...
Click to collapse
The 2. issue with the sdcard is easy. After pressing 'install' button in twrp at the bottom left press the "select storage' button, a small window will pop up then select the 'micro sdcard' and press 'ok", you should see your files now.
The 1. ssue is really odd! I use the second twrp you posted, for some wierd reason the first one does not boot for me (twrp does not start). But I talked with another guy for him it was the other way around. It was really strange. I think most can use both though without problems
There is one more twrp 3.1 from bambamx, but I really do not get this, twrp boots from its own partition with its own kernel. They should be separated unless twrp does something to system ofcause which it very well shouldn't unless you ask it to, deleting a important file or flashing something. I have never heard of this sorry. One thing is certain our device sure could use a stable nougat encryption compatible twrp!
I will let you know if I find something, you can try the last available version, I have no idea if it will exhibit the same strange behaviour. But maybe its worth a shot although it seems something else is at play.
A couple of stupid questions sorry; You disabled dm verity and sony ric in ta poc right, and it does not happen if you boot your phone normal a couple of times.
Edit: sorry Mr. Sandman had not left so I did not read properly here from the morning. I will edit my post to actually answer as best as I can lol.
Just to let you know:
1. You do not need to install TWRP to use it! You can just do
Code:
fastboot boot <TWRP image>
to run TWRP on the phone (instead of
Code:
fastboot flash boot <TWRP image>
). The only drawback of this method is that you will always need a computer to enter TWRP. Btw. with this method you can also try out a custom kernel image before flashing it.
2. You do not need write access to /data partition to install Magisk. It was explained in another thread that Magisk can use /cache temporary when access to /data is not available. It will write to /data on first boot instead.
3. While using TWRP you can use adb to transfer files onto the phone, so you don't need to have them ready on the internal storage.
realtuxen said:
The 2. issue with the sdcard is easy. After pressing 'install' button in twrp at the bottom left press the "select storage' button, a small window will pop up then select the 'micro sdcard' and press 'ok", you should see your files now.
Click to expand...
Click to collapse
I did, but the SD card can't be selected, and the size shows as 0kb. I did a workaround though: i formatted a spare sd card and copied magisk on it. it was instantly recognized and selectable.
ypnos42 said:
Just to let you know:
1. You do not need to install TWRP to use it! You can just do
Code:
fastboot boot <TWRP image>
to run TWRP on the phone (instead of
Code:
fastboot flash boot <TWRP image>
). The only drawback of this method is that you will always need a computer to enter TWRP. Btw. with this method you can also try out a custom kernel image before flashing it.
3. While using TWRP you can use adb to transfer files onto the phone, so you don't need to have them ready on the internal storage.
Click to expand...
Click to collapse
GREAT advice! I launched TWRP from ADB and successfully flashed Magisk using ADB sideload. Thanks, my phone is rooted again!

Trouble Permanently Flashing TWRP

Hi,
I'm currently using the Skipsoft Android Toolkit to unlock flash TWRP onto my device. I've followed to first steps (install drivers, backup device and unlock bootloader) to the letter and everything went smooth.
Now the final part of installing TWRP is not going so well. Flashing the custom recovery works as expected and I end up in the TWRP menu. However, as soon as I reboot my phone and try to go back to the recovery via Advanced Reboot --> recovery, I end up in the default One Plus Recovery Menu. Now the tool mentioneds when this process fails, renaming the Recovery Restore Files is recommend to prevent the system from flashing the stock recovery on boot (what happens to my device). I follow this option in which I end up back in TWRP, flash a zip named 'permanent-recovery.zip' (while read only mode is turned off in TWRP) and reboot my device. Still when I use Advanced Reboot to open recovery, I end up once again in the Stock Recovery.
Is there anyone who could tell me where I am going wrong and how to solve this issue?
Thanks in advance
Rawrden said:
Hi,
I'm currently using the Skipsoft Android Toolkit to unlock flash TWRP onto my device. I've followed to first steps (install drivers, backup device and unlock bootloader) to the letter and everything went smooth.
Now the final part of installing TWRP is not going so well. Flashing the custom recovery works as expected and I end up in the TWRP menu. However, as soon as I reboot my phone and try to go back to the recovery via Advanced Reboot --> recovery, I end up in the default One Plus Recovery Menu. Now the tool mentioneds when this process fails, renaming the Recovery Restore Files is recommend to prevent the system from flashing the stock recovery on boot (what happens to my device). I follow this option in which I end up back in TWRP, flash a zip named 'permanent-recovery.zip' (while read only mode is turned off in TWRP) and reboot my device. Still when I use Advanced Reboot to open recovery, I end up once again in the Stock Recovery.
Is there anyone who could tell me where I am going wrong and how to solve this issue?
Thanks in advance
Click to expand...
Click to collapse
The basic "mechanics" of what happens seems to still be as follows:
As your phone is delivered with Stock OS, it has these two files installed:
Code:
/system/recovery-from-boot.p
/system/etc/install-recovery.sh
I know from looking at mine when I got it that it had /system/recovery-from-boot.p installed. If it's there, it is run when it runs at boot.
To stop that behavior you have to get rid of those files before you reboot the first time from recovery or else recovery will be replaced with the stock image. I'm aware that supposedly the custom recovery supposedly renames either one or the other or both of these but am not convinced it does this or whether installing root (either Magisk or SuperSU) does it. Either way, since you're stuck with the problem, either from file-manager in TWRP if that's all you can boot to, you need to rename /system/recovery-from-boot.p to something like /system/recovery-from-boot.p.orig and maybe the other one /system/etc/install-recovery.sh to /system/etc/install-recovery.sh.orig as well.
Once even the .p file is gone, it's not going to rewrite recovery. You must, of course, be rooted before you can touch those files although if you can sideboot TWRP, it seems like you are rooted while it is booted and "should" have access to system files if you can mount system rw.
I've fixed it this way on other phones. On this one, installing the "official" TWRP and Magisk did it. When I booted into /system after installing Magisk, I looked for the .p file and found it renamed to /system/recovery-from-boot.bak.
I found a link for a Samsung s8 for the same purpose. It's probably identical. http://www.teamandroid.com/2017/04/25/install-galaxy-s8-twrp-310-recovery/3/
Click to expand...
Click to collapse
I looked into those two files while in TWRP and noticed I only had the recovery-from-boot.p file. This was already in fact renamed to recovery-from-boot.p.bak. I renamed it once again (just to be sure) and after flashing the .zip I mentioned earlier, the TWRP did not last another reboot...
Can I after flashing TWRP again, immediately flash Magsik? I intended to hold off rooting because the rom I was going to install has Magisk build into it. I don't want to create a conflict when flashing later on. Is this going to be an issue?
@hachamacha I've reread your post and wondering if rooting my device is even going to make a difference right now? Since I'm already able to rename files in the system directory, would it even make a difference?
Rawrden said:
I looked into those two files while in TWRP and noticed and only had the recovery-from-boot.p file. This was already in fact renamed to record-from-boot.p.bak. I renamed it once again (just to be sure) and after flashing the .zip I mentioned earlier, the TWRP did not last another reboot...
Can I after flashing TWRP again, immediately flash Magsik? I intended to hold off rooting because the rom I was going to install has Magisk build into it. I don't want to create a conflict when flashing later on. Is this going to be an issue?
Click to expand...
Click to collapse
To me, it doesn't sound like a conflict to re-install Magisk over itself in FOS and see if that helps. The real "action" that counts is all about whether you've already booted into the OS after installing TWRP and then how you go about getting rid of the .p file without doing a regular reboot via the OS. Even installing the FOS ROM should get rid of the .p file (rename it), so something else is going on. I'll look around some more and update this if I can.
By the way: Depending upon how exactly you got from TWRP to the OS the first time, it could already have rewritten the stock recovery by the time you noticed *.p file renamed to *.bak.
OK: I recalled how I did this without a problem: I wrote instructions somewhere but have no idea where. This is what I think I did:
1) fastboot flash recovery recovery.img (custom/TWRP)
2) fastboot boot recovery.img (so force it to load recovery without a traditional reboot).
3) install ROM from that point and after done just hit the reboot button (or install Magisk from that point and hit reboot).
Click to expand...
Click to collapse
---------- Post added at 09:26 AM ---------- Previous post was at 08:59 AM ----------
Rawrden said:
@hachamacha I've reread your post and wondering if rooting my device is even going to make a difference right now? Since I'm already able to rename files in the system directory, would it even make a difference?
Click to expand...
Click to collapse
Just saw this note:
Anytime you're in TWRP, you're automatically "rooted" for the time you're there. It's integral to TWRP having permissions to do anything like install etc. If you just "loaded" TWRP (as in fastboot boot twrprecovery.img) then you'd be rooted, but when you rebooted to the system, you'd be unrooted. While you were in TWRP, in theory you could make file system changes to the /system partition (a) if TWRP lets you mount it rw which I think that first swipe does and b) if you can see the correct files in it's file manager.
So it "seems" like those file changes should be actual file changes to the correct place. Keep in mind that while booted in TWRP, TWRP may have it's own ./system/ that has nothing to do with the OS's ./system folder, so you've got to be able to mount the OS's ./system. TWRP's ./system is already fine and of no importance for this. I can boot mine into TWRP and look around to try to clear this up, but it might not be crystal clear to me either.
The output of a TWRP terminal emulator "mount" command might be of use but it will be messy. Maybe if you can do this in emulator from TWRP:
# mount | grep system, and look at that output, perhaps put it in this post, it'd be of help. The mounted rw ./system we need is going to be the same one you'd see from adb shell or terminal emulator while booted from the OS. My guess is that the one we don't want from TWRP's perspective will be mounted as /system (params...) and that the the OS's system either will not yet be mounted and you'll have to go to mounts and mount it and then look at the output of the mount cmd again to figure out what it was mounted as. Sorry about how complicated this explanation has become. Anyway: The ./system that corresponds to the OS is the only one we care about.
There's no easy way to explain it so I'll leave it hidden to spare anyone having to look at it:
I just booted into TWRP and used terminal emulator and file manager to explore:
findings: While in TWRP, using terminal emulator to do a
$ df and then a $ mount command shows no ./system mounted specifically. // maybe not a surprise.
// TWRP just mounts it's root / file system and there is a /system folder, just not a specific mount point for it.
// TWRP does not auto mount the OS's ./system partition by default. It depends what you're going to do there.
Without going into "mounts" and clicking on /system, it won't even try to mount /system for the OS.
If you can get that mount to work in read/write mode, then you should be able to see the ./system mount using terminal emulator as such.
$ mount | grep -i system (and look specifically for ./system on the right side of whatever appears).
In theory you should be able to make changes to the OS's /system partition now. When you're done, unmount it. (I'm assuming all this works from TWRP, a dodgy assumption)
At this point: I'm just trying to figure out how TWRP does things like installs OS zips to the /system & /data partitions which it is clearly successfully able to do. It could do it without mounting anything because it could use the linux dd command, which just writes to the /dev name. OR: It could mount /system and use it. I'm not sure which.
hachamacha said:
OK: I recalled how I did this without a problem: I wrote instructions somewhere but have no idea where. This is what I think I did:
Quote:
Code:
1) fastboot flash recovery recovery.img (custom/TWRP)
2) fastboot boot recovery.img (so force it to load recovery without a traditional reboot).
3) install ROM from that point and after done just hit the reboot button (or install Magisk from that point and hit reboot).
Click to expand...
Click to collapse
I followed these steps and I managed to install FreedomOS without any issues. My phone booted normally and after a few complimentary steps I booted back into recovery and... TWRP! No more stock recovery. Thanks a lot!
Just one more question: TWRP currently asks whether it is allowed to install itself as a system app. Now I assume it is already a system app, but I'm not expert at this so I can't say for sure. Would you recommend me to install TWRP as a system app?
Rawrden said:
I followed these steps and I managed to install FreedomOS without any issues. My phone booted normally and after a few complimentary steps I booted back into recovery and... TWRP! No more stock recovery. Thanks a lot!
Just one more question: TWRP currently asks whether it is allowed to install itself as a system app. Now I assume it is already a system app, but I'm not expert at this so I can't say for sure. Would you recommend me to install TWRP as a system app?
Click to expand...
Click to collapse
Great! Glad that worked. I guess it's all about how that first boot to the OS occurs.
Anyway: Your question, I'm assuming is about TWRP "Manager" the app? If so, yes, it should be a system app. The thing is that "Official TWRP Manager" doesn't really do much of use that you wouldn't just as soon do from fastboot, so it's not critical and nothing other than TWRP manager will "not work" regardless of what you designate it. All saying it's a system app does is puts a slot for it in Magisks "root table".
Cheers.
hachamacha said:
Great! Glad that worked. I guess it's all about how that first boot to the OS occurs.
Anyway: Your question, I'm assuming is about TWRP "Manager" the app? If so, yes, it should be a system app. The thing is that "Official TWRP Manager" doesn't really do much of use that you wouldn't just as soon do from fastboot, so it's not critical and nothing other than TWRP manager will "not work" regardless of what you designate it. All saying it's a system app does is puts a slot for it in Magisks "root table".
Cheers.
Click to expand...
Click to collapse
Done! Can I just say how grateful I am to you for helping me out with this? Your answers have been extremely detailed and I've learned quite a few things. Unfortunately I can only thank your posts once, because you've earned more than that. Thanks again and keep being awesome!

Freezes on Google screen after attempted SU Install from TWRP

Ok I am sure I did this before without any problem, but this time, through TWRP on the NRTK, I installed Magisk, no problems, and then went back to install the SU with the zip file in TWRP again and then on the reboot it freezes on the Google startup screen.
I didnt even want to install the SU zip, but when I ran SU after Magisk installed after reboot, SU gave an error, so I decided to install SU from TWRP.
Did I do something wrong there, so I dont repeat the same error next time?
And how do I get out of this locked state?
I've tried wiping all cache to factory reset without deleting internal storage data... I am hoping I dont have to delete and wipe everything and start all over. I did not have a chance to eve install TiB yet.
Dathaeus said:
Ok I am sure I did this before without any problem, but this time, through TWRP on the NRTK, I installed Magisk, no problems, and then went back to install the SU with the zip file in TWRP again and then on the reboot it freezes on the Google startup screen.
I didnt even want to install the SU zip, but when I ran SU after Magisk installed after reboot, SU gave an error, so I decided to install SU from TWRP.
Did I do something wrong there, so I dont repeat the same error next time?
And how do I get out of this locked state?
I've tried wiping all cache to factory reset without deleting internal storage data... I am hoping I dont have to delete and wipe everything and start all over. I did not have a chance to eve install TiB yet.
Click to expand...
Click to collapse
Flash the stock boot.img from the image/rom you were using before this and reboot. You will have to re-root (properly) afterwards, but your phone should boot up. If you use Magisk, you don't need SU, and vice versa. Use only one method to root.
v12xke said:
Flash the stock boot.img from the image/rom you were using before this and reboot. You will have to re-root (properly) afterwards, but your phone should boot up. If you use Magisk, you don't need SU, and vice versa. Use only one method to root.
Click to expand...
Click to collapse
Hmmm ya I prob should have posted that SU error message instead of what I did, douche move.
But how do I flash the boot.img... I have an original copy of it on my PC... can I somehow while in TWRP on the phone connect to my PC via cable and run commands from my PC in CMD and execute that old boot.img flash? Or is there a location in the stock Nexus already I can use? Because there is no file in the root drive after I did the soft wipe.
P.S. Everything I have done so far has not deleted my whole storage, yet.... not sure if that is necessary at this point bec it seems reflashing the boot.img wipes absolutely everything again? If I have to it is what it is... just painful when this happens before I could get TiB running... unless my Nandroid backup file I have will restore and work after I do this?
Dathaeus said:
Hmmm ya I prob should have posted that SU error message instead of what I did, douche move.
But how do I flash the boot.img... I have an original copy of it on my PC... can I somehow while in TWRP on the phone connect to my PC via cable and run commands from my PC in CMD and execute that old boot.img flash? Or is there a location in the stock Nexus already I can use? Because there is no file in the root drive after I did the soft wipe.
Click to expand...
Click to collapse
While in TWRP you have MTP (file transfer) so you can add files to your device. Transfer the boot.img over to your device via MTP and then use TWRP to flash. Just be sure to select flash IMAGE rather than ZIP. Lesson here is when you get back up and running, install fastboot/adb and make sure it is working well and communicating with your PC. Then you can learn how to use it. This would take literally 5 seconds to flash via fastboot (device in bootloader mode).
---------- Post added at 01:29 PM ---------- Previous post was at 01:26 PM ----------
Dathaeus said:
P.S. Everything I have done so far has not deleted my whole storage, yet.... not sure if that is necessary at this point bec it seems reflashing the boot.img wipes absolutely everything again? If I have to it is what it is... just painful when this happens before I could get TiB running... unless my Nandroid backup file I have will restore and work after I do this?
Click to expand...
Click to collapse
NO, flashing boot.img will not delete any of your files. It will only write to the boot partition. If using fastboot the command is fastboot flash boot boot.img
v12xke said:
While in TWRP you have MTP (file transfer) so you can add files to your device. Transfer the boot.img over to your device via MTP and then use TWRP to flash. Just be sure to select flash IMAGE rather than ZIP. Lesson here is when you get back up and running, install fastboot/adb and make sure it is working well and communicating with your PC. Then you can learn how to use it. This would take literally 5 seconds to flash via fastboot (device in bootloader mode).
NO, flashing boot.img will not delete any of your files. It will only write to the boot partition. If using fastboot the command is fastboot flash boot boot.img
Click to expand...
Click to collapse
Yep I actually had those platform files already, and yes the MTP was active there, I just never tried that before so didnt know it was even a possibility or the right way.
So I tried via flashing my very old boot.img and also the one from
https://forum.xda-developers.com/nexus-6p/general/stock-modified-boot-img-regular-root-t3306684
via TWRP "Install" via image install (not zip) and to the "boot partition"
and no change, same stuck on Google logo screen.
I tried the fastboot command from CMD and it says
< waiting for any device >
and doesnt do anything. I had it on the default TWRP menu screen.... I waited over 20 min although I know it shouldnt take near that long, just in case.
My bootloader is unlocked BTW, I dont want to assume anything here.
You need help getting the latest fastboot/adb binaries working on your PC. So many tutorials on how to do this. Ugh.
Dathaeus said:
Yep I actually had those platform files already, and yes the MTP was active there, I just never tried that before so didnt know it was even a possibility or the right way.
So I tried via flashing my very old boot.img and also the one from
https://forum.xda-developers.com/nexus-6p/general/stock-modified-boot-img-regular-root-t3306684
via TWRP "Install" via image install (not zip) and to the "boot partition"
and no change, same stuck on Google logo screen.
I tried the fastboot command from CMD and it says
< waiting for any device >
and doesnt do anything. I had it on the default TWRP menu screen.... I waited over 20 min although I know it shouldnt take near that long, just in case.
My bootloader is unlocked BTW, I dont want to assume anything here.
Click to expand...
Click to collapse
Which OS security patch were you running? Flash the system (to the system partition in TWRP) and boot images (again) from the 6P factory image of the same name:
https://developers.google.com/android/images?hl=en
See if this helps.
Sent from my Nexus 5X using Tapatalk
v12xke said:
You need help getting the latest fastboot/adb binaries working on your PC. So many tutorials on how to do this. Ugh.
Click to expand...
Click to collapse
Not sure what you mean... I JUST did all that when I redid my phone completely back to factory etc etc.... just few weeks ago and then again on my new replacement. But just to be sure, I downloaded all those files again today and it didnt make any difference.
Still stuck on the
< waiting for any device >
I have to be missing some other step or something else is wrong here.
FYI not sure if this matters but when phone boots to recovery there's a red error message
"Unable to mount storage"
but it loads to TWRP fine anyways.
SlimSnoopOS said:
Which OS security patch were you running? Flash the system (to the system partition in TWRP) and boot images (again) from the 6P factory image of the same name:
https://developers.google.com/android/images?hl=en
Click to expand...
Click to collapse
Yep thats what I been doing.....
So the CMD command still doesnt work, which I think is weird in itself... and when I try to install from recovery, it goes through the whole process, both boot.img and system.img, but then it freezes on the Google logo again, so no change.
Sorry I am not sure what security patch, I just got this used from eBay, and one thing, not sure if this means anything, it says its a beta version or something and that message came up all the time when I rebooted when the phone was working.
Do I need to suck it up and redo the whole phone again........ :/

Categories

Resources