yashsingh1/xdaforums huggingface dataset:
[Nexus 5 General] danarama:
Adb a recovery? You'd need to use the dd command for that, which is much harder than using fastboot.

But it can be a biggie for people who have locked bootloader.
[Nexus 5 General] itsJohnuno:
ah i meant fastboot, mybad...hmm the idea of a locked bootloader at this point never crossed my mind
[Nexus 5 General] danarama:
Yeah. Some people rooted with Towelroot and never needed to unlock. Flashify flash recovery from ROM.

Also people using Philz recovery with password lock, will have a locked bootloader for security purposes.
[Nexus 5 General] itsJohnuno:
eh i feel its always best to learn under pressure lol one of these guys is gonna flash...see they lost recovery and come reading and searching for a fix
[Nexus 5 General] danarama:
Well if their bootloader is locked, they just lost a couple of hours.
[Nexus 5 General] gefilus:
Have flashed all 5.0, but no problems with recovery or root. All works fine for me
[Nexus 5 General] danarama:
Good for you. Can I please discourage people from posting "works fine for me"? This post serves as a warning. Not to list all the people who didn't have a problem.

If the files aren't there, you want have a problem. If you flash superSU before boot, you won't have a problem.
[Nexus 5 General] gefilus:
Yes, i only now saw this post, so i started to read, i even didnt know about some problems there, but thanks for warning, and i read your post
[Nexus 5 General] rabaker07:
I must be missing something. This sounds like some major PSA alert when the only detriment is that you have to reflash your recovery? And if you're locked you have to unlock? Wouldn't you want to do that anyway? I thought you meant we'd corrupt our backups.

And why on earth would unlocking a Nexus 5 take a couple of hours?

I'm lost.
[Nexus 5 General] danarama:
Yes I can see you're lost.

> the only detriment is that you have to reflash your recovery?

Not necessarily

> And if you're locked you have to unlock?

Errr, yes

> Wouldn't you want to do that anyway?

Not necessarily. Some people like the extra security locking their bootloader provides

> I thought you meant we'd corrupt our

..Our what? Our recovery? yes!

> And why on earth would unlocking a Nexus 5 take hours to unlock?

It unlocks instantly. It Takes hours to backup all your /sdcard data to a PC before unlocking and restoring it afterwards.

I hope this is clear now
[Nexus 5 General] rabaker07:
Actually, yes, thank you. Not such a concern for me. I cleaned house recently when I flashed dev preview so not much to lose., and I'm unlocked. N5 only has room for 26gb of data at most anyway...

---------- Post added at 02:13 AM ---------- Previous post was at 01:51 AM ----------

So the big deal is if you have a locked bootloader. I still don't know why someone would flash custom/sideload ROMs and custom recoveries and then relock the bootloader. I've never heard of anyone having any kind of breach as a result of being unlocked. They should expect that there will be a time when they need to unlock again (new kernel, new recovery, etc.) so they should have been expecting this potential outcome as a result of that decision.
[Nexus 5 General] danarama:
Not sure what that's got to do with anything. 26 movies of 1GB will move MUCH faster than 22664 files of 1 MB, which will move MUCH faster than 28061696 files of 1KB. Its not all about how much data there is.

Lets put it another way. Any time spent on a problem that could have been avoided is time wasted.

Its not just people who have a locked bootloader. That was a quick example. Another would be a flashaholic who backs up and decides to flash on the train to work. Gets a boot loop, cant restore.

Back to the bootloader, with an unlocked bootloader, your data is insecure. With custom recovery, anyone with access to the phone can rip all your data. I'm not just talking about the pictures of your naked girlfriend, but real, actual data. Working in IT, I can tell you that no security policy is based on the hope that the person who finds your device won't know what to do with it. Nor are they based on accepting that you're vulnerable without mitigating the risks.

One could mitigate the risks in several ways.

1) not to use the phone for anything other than trivial stuff (making it less.useful)

2) encrypting the data (which comes with its own set of problems

3) locking recovery (which also comes with its own set of or problems)

For number 3, the obvious problem would be flashing a different, unlocked recovery. So you'd lock the bootloader. It doesn't need to be unlocked to flash refineries or kernels if you have root

There are many scenarios where breaking recovery could cause massive inconvenience and without trying to sound rude, whether you understand or not is irrelevant. If you don't want understand or someone doesn't use their phone exactly like you does not make the warning any less valid.

So with that all said, this thread isn't really here to educate you in why different people don't use the phone like you use yours, of follow your expectations. Its here yo raise a valid warning that will affect some people and can unnecessarily waste time or even lose data, so let's move on please
[Nexus 5 General] AW141:
Something really strange happened to me.

Tried to flash lollipop and got the "not enough space" error

Tried to go into recovery but my phone was stuck at the nexus logo

Tried to go into bootloader again by pressing volume buttons plus power button

My phone just opened and now I have lollipop (?) It's working fine

But I really want to know what happened exactly? Also do I need to flash it again?

Maybe this happened because of the issue with the recovery in the image?
[Nexus 5 General] danarama:
No, this is a different issue. Theres a thread about it in General I think
[Nexus 5 General] meth0dical:
Thank you for the heads up!
[Nexus 5 General] IRX120:
Glad it wasn't just me with this issue. I must've flashed the factory image 5 times haha.
[Nexus 5 General] danarama:
Yeah factory image does it too, but I sort of expected that - although maybe others wont so I'll amend thread title.
[Nexus 5 General] pulak861:
u changed the title and i asked it.. lol.. good timing. :D
[Nexus 5 General] rabaker07:
Yes, understood and agreed, in fact I meant to reply last night with a note about how I appreciate this warning and I've actually learned a bit from this thread. I guess I just had a funny way of asking my questions.

Thank you for clarifying and thanks to OP for the useful information.
[Nexus 5 General] danarama:
No worries dude.
[Nexus 5 General] efrant:
I haven't played around with this in Lollipop, but in previous versions of Android, those files would not "break" recovery -- all they do is flash the stock recovery (and re-flash) every time you boot into Android. Do those files do anything different in Lollipop? Or is that what you mean by break?
[Nexus 5 General] danarama:
They actually break it.

A .p is a patch file. Not sure if in other images they were patch files or not, but this particular patch file injects just the updated code (Like an OTA would) into whatever is in your recovery partition, meaning you do not get a full stock recovery update... just a recovery with a missmatched code. You cannot actually enter recovery mode at all once done, so you need to flash an image to the partition. That could be stock or custom, however if you originally had stock, the issue wouldn't exist so I'm not sure why anyone would flash stock recovery afterwards
[Nexus 5 General] efrant:
The script (/system/bin/install-recovery.sh) actually calls another file (/system/etc/recovery-resource.dat), which I assume is the stock recovery, and then it flashes it to the recovery partition on every boot into Android if the stock recovery is not already present. That is how it worked with previous versions of Android. It may be different for the Lollipop files, but I just checked the script in Lollipop, and it is the same.
[Nexus 5 General] danarama:
The script I have calls both and the outcome is broken recovery. No amount of pressing buttons will get to a menu. I took this information from user reports intially and confirmed it by testing it myself too
[Nexus 5 General] times_infinity:
It's not a broken recovery. It's a perfectly working STOCK recovery. Albeit, not useful for people who need the features of a custom recovery. As stated before, it uses the recovery-resource.dat to reflash the stock recovery when there's a checksum difference between what is currently in the recovery partition and what the script is looking for.

Zips built from AOSP from previous version of android did the same exact thing. They had a patch file that was called recovery-from-boot.p which took the boot image and patched it to be a bootable recovery image and then flashed it to the recovery partition. This is how AOSP is designed. Which makes it NOT broken, just unwanted.
[Nexus 5 General] danarama:
As stated, I tested it myself as have many other people, and those AOSP roms that were flash had BROKEN (not stock) recovery. It had the stock exclamation mark, but as per my post you quoted - No amount of button pressing got you to the menu like STOCK recovery does. Perfectly working STOCK has a menu and is not stuck at the exclamation mark screen.

IF and WHEN perfectly stock recovery is actually flashed, the thread will be unstickied. At the time of writing however, that was most definitely not the case.

EDIT> And another thing, people do not expect to have their recovery flashed back to stock when flashing AOSP ROMs and for obvious reason, this would be a bad idea - so even if it did flash a perfectly working STOCK recovery, people still need to be aware
[Nexus 5 General] thenighthawk:
Is my N5 recovery broken?

I had CM 11 M 11 on my N5 and this morning I flashed Lollipop factory image on my N5. It appears to be working fine but how do I know if I broke my phone's recovery? Here's what I did:

Booted my N5 into fastboot through sdk

flashed bootloader-hammerhead-hhz12d.img

flashed radio-hammerhead-m8974a-2.0.50.2.21.img

finally, flashed image-hammerhead-lrx21o.zip

Did I miss a step? I had to flash all three items one at a time because flash-all.bat failed. I also tried ChainFire root few minutes ago and it also failed. Is there another method of rooting my Nexus 5 now?

Thanks for your help in advance.
[Nexus 5 General] AW141:
After what happened to me and I still don't understand what it is, I read your thread and I have a question. How do I know if I have a broken recovery, because when I tried to go into recovery mode all I saw was the android standing not sleeping, then it was stuck on the nexus logo.

I had a locked bootloader, I unlocked it then I flashed the factory image right away.

Thank you
[Nexus 5 General] danarama:
Boot into recovery. From off hold col down and power to get to the bootloader. Use volume to navigate to the recovery option and power to select. You should get to an android logo. Press volume up whilst holding power. If it gets to the menu, its fine - buy stock. If nothing happens, its broken. If no android logo at all, maybe you have a custom recovery still

That standing up android is actually what you get when your device is wiping, which unlocking the bootloader will do.
[Nexus 5 General] thenighthawk:
Thanks. I believe my N5 recovery is broken :crying: When I selected Recover Mode from bootloader, it showed a dead android with a red triangle on top of dead android's tummy. Can you refer me to instructions or thread with instructions to fix the recovery? Is it possible to install TWRP at this stage?

Thanks
[Nexus 5 General] abalam:
Just flash twrp in fastboot
[Nexus 5 General] j0hnh0lmes:
He's right. Backup of my internal to a PC (only 8gb) took 6 hours. I just had a ton of small data / text files due to my job...
[Nexus 5 General] Rusty!:
It never ceases to amaze me how many people have never seen the stock recovery.
[Nexus 5 General] thenighthawk:
Alrighty. Just flashed twrp 2.8.1.0. After flashing twrp when I rebooted system, I was prompted to install superSU to root my device. I chose Yes and it attempted to download and install SuperSU through TWRP. It actually failed and then I tried the Play Store method. That failed too. I then went back into recovery and it appears that the recovery's broken again :)

I will flash my device with lollipop again then twrp and then chainfire root to see what happens.
[Nexus 5 General] Carol Barros:
I had your problem, flashed twrp and pushed supersu to my sdcard, installing it right after, seems fine here. Didn't need to flash factory image all over again. :)
[Nexus 5 General] danarama:
Shouldn't need to flash factory, no
[Nexus 5 General] Carol Barros:
I did get this message though trying to open supersu. Did I do smth wrong? It was 2.16 version.
[Nexus 5 General] danarama:
To root Lollipop, which is a bit out of scope of this thread) - you must also flash a modified boot.img, such as chainfires (which in RAMdisk calls su daemon) or for even higher root permissions, a such as Sykopompos permissive boot.img... You cannot just flash SuperSU like in KK.
[Nexus 5 General] Carol Barros:
Oh, thank you. That's all I wanted to know. [emoji2]

I'll go to the right topic.
[Nexus 5 General] thenighthawk:
I got the same screen. I then applied the chainfire root and that fixed this message and rooted my N5.

So, now my N5 has stock factory lollipop and TWRP 2.8.0.1, and rooted with chainfire.

Everything's working fine so far on my N5.
[Nexus 5 General] Yakandu:
I just renamed those files to ***.bak, everything is working, recovery doesn't crash. Try it. Do not be afraid.
[Nexus 5 General] danarama:
Yep. Rename, delete. Either / or. Same effect.
[Nexus 5 General] samersh72:
AFAIK, /system/recovery-from-boot.p and /system/bin/install-recovery.sh. You need to make sure that these files are either deleted or renamed, or else custom recovery will disappear when you reboot. These files serve no purpose other than re-flashing the stock recovery on every boot. So, by using something like Root Explorer, delete or rename them, and re-flash your custom recovery.
[Nexus 5 General] dreamer94:
Hi guys. I'm just gonna reset my temper flag with nexus_bootunlocker script. I was doing this while on kitkat. After flashing an image i was using this;

fastboot boot twrp.

Now i flashed lollipop, and i'm not flashing twrp just booting it temporarly to use script, then switching to bootloader. Is it safe to do atm? Just booting twrp 2.8.1.0 for once?While I was on kitkat it was fine. .

Edit: Never mind i just tried and it worked! :D
[Nexus 5 General] thenighthawk:
So, on my N5, the files are named as:

/system/recovery-from-boot.bak

/system/bin/install-recovery.sh

I have TWRP installed on my phone and after restarting my phone a number of times, the TWRP is still there kicking well. Do I still remove the above two files?

Thanks
[Nexus 5 General] GldRush98:
It seems that any file/folder created/modified by TWRP is unreadable by Lollipop.

This would be why the recovery breaks those files.
[Nexus 5 General] thenighthawk:
The /system/recovery-from-boot file is already renamed as a .bak file on my N5. I, however, can't rename or delete install-recovery.sh file. I am using ES File Explorer with root access and it keeps telling me that the file rename failed or this file cannot be deleted. Any advise?
[Nexus 5 General] efrant:
SuperSU uses

/system/etc/install-recovery.sh to call daemonsu. That's why you can't (and shouldn't) delete it.

Edit: that is if you have root.
[Nexus 5 General] thenighthawk:
Thanks
[Nexus 5 General] bokoy:
Hi guys, I need a bit of help. I'm getting a bit confused, I used to root my device with fastboot flashing twrp and then installing supersu with the zip, is it still posible? I read two different things in this page yes and no, that we should flash a modified boot img... What should we do??
[Nexus 5 General] thenighthawk:
For me fastboot flashing twrp and then installing SuperSU with the zip didn't work. After installing twrp, I uses chainfire method to root which worked fine for me.
[Nexus 5 General] crucialcolin:
I'm having issues accessing the stock recovery after just updating using the official factory image lollipop build 5.0 (LRX21O) directly from Google. Every time I try I just get a android on its back with a red exclamation point through it. My guess is this could be why?
[Nexus 5 General] Tagtag123:
Try this:

1. fastboot format cache

2. fastboot flash recovery recovery.img

recovery.img is the file name of stock recovery file, you will find it in the dowloaded factory image.

Now try entering the recovery by vol down+power on and then selecting recovery by vol keys and press power button to start it.
[Nexus 5 General] crucialcolin:
Thanks,

It seems to have worked although the icon still showed the red exclamation. I actually wouldn't have even noticed if it wasn't for the being caught up in the data storage size bug(12gb showing on 32gb devices) requiring a wipe data/factory reset.
[Nexus 5 General] brotbuexe:
Tried it, I still get the broken recovery. I tried a "fastboot boot recovery.img" from the image-hammerhead-lrx21o.zip and it does not work either.
[Nexus 5 General] Tagtag123:
Google really messed up the lollipop launch.

You can booting to kitkat recovery, ktu84p.

It might work.

EDIT:

You can just move on to TWRP or any other custom recovery if all else fails.
[Nexus 5 General] crucialcolin:
It's looking that way so far it seems both recovery.img and userdata.img have bugs in the factory build. Hopefully they will release an updated package.
[Nexus 5 General] brotbuexe:
Maybe they don't use their own recovery. :)

Until twrp get the lollipop encryption working I'll go with booting the twrp img through fastboot after unlocking the bootloader on the fly with Bootunlocker when I want to make a backup or flash something. I have to wipe when I mess up my system but no one can get to the data because I run it locked.
[Nexus 5 General] efrant:
The "android on its back with a red exclamation point through it"

IS

the stock recovery. To access the menu when you see that screen, you need to hold down the power button and press volume up.
[Nexus 5 General] Rusty!:
It's amazing how many people seem to have never seen a stock recovery before.
[Nexus 5 General] crucialcolin:
haha yeah I'm actually used to CWM myself with other devices. However I've decided to keep it pretty stock on my Nexus. Of course that could change later :D

Besides not recognizing the icon for some reason holding down the power button and press volume up wasn't working for me. Finally after many attempts and re flashing the recovery it took.
[Nexus 5 General] danarama:
Its when those buttons are pressed but nothing happens, that recovery is broken.
[Nexus 5 General] ryanwalexander:
I was wondering if twrp backups still work between lollipop and 4.4.4. When I put the dev preview it changed the file system and I had to reflash stock image to fix it. Also, do titanium backups work fine to restore in lollipop when they were made in 4.4.4?
[Nexus 5 General] xzilem:
I think it's volume up + volume down + power button for the new stock recovery.

I can't access the menu if i just use the 2 keys combo.
[Nexus 5 General] bogusmr:
factory image with broken recovery

Ok so I flashed image factory on n5 I did it manually flashing everything, following several tutorials!

Yesterday wanted to do a cache clean and didn't found recovery... wich brought me here:)

after reading all thread I didn't find find an answer to a solution:confused:

I think that I can flash stock recovery or custom recovery? [MENTION=2872010]rootSU[/MENTION]

if so can I use stock recovery that was extracted by image factory, or wich custom is working with 5.0?

i'm with Unlocked bootloader

Thank you
[Nexus 5 General] thenighthawk:
I'd recommend using TWRP recovery. It provides a lot more options than stock recovery.
[Nexus 5 General] grgana:
This is why im hesitating to update or to even flash pure factory image,

Keeping eye on this thread and see that there s no safe method to avoid this problem, flashing ota, using tool kit or fastboot cant guarantee that every thing is going to be fine. Along with this other problems like losing sd card ect... So im with unlocked bootloader stuck with fear running mahdi 4.4.4 with nandroid backup of rooted stock ktu84p pretty paranoid to not screw my phone:(

Any advice?

Sent from my phone
[Nexus 5 General] Acvice:
You would be hard pressed to 'screw up' a nexus. You're pretty much always a command away from saving grace. If you are really scared, just wait a week or two and let everyone adjust to the change in protocol.
[Nexus 5 General] danarama:
If you flash a full factory image, you shoudn't have any sdcard issues, except perhaps showing as the 16 GB model if you have 32. Easily fixed with factory reset and wipe cache.

All you have to do is flash latest TWRP and delete the files in the first post using it's built in file manager.
[Nexus 5 General] nbell13:
Recovery isn't broken for me, and I flashed the factory image. Power + volume up at the robot with the exclamation point took me right to it.
[Nexus 5 General] danarama:
I am glad
[Nexus 5 General] bogusmr:
my experience now

Ok after finding out that I was missing recovery....

flashed twrp reboot didn't stick

flashed twrp installed supersu reboot didn't stick neither although supersu app is installed

flashed twrp installed supersu delete /system/bin/install-recovery.sh reboot twrp stick but not root although supersu app is installed

tried to install again supersu but nothing when I open app says no su installed...

well I know that I can go and use cf root but I rather understand what's going on.... But for now I have no idea what's going on....

any one:confused:

Thanks

I'm not new to android so I can say that I have basic knowledge.
[Nexus 5 General] danarama:
You need more than just SuperSU and su binary. You need to either have PIE Patch, SELinux changer or Permissive kernel (last one is my favourite option).
[Nexus 5 General] zoltrix:
I flashed the OTA update and it "broke" my recovery.

I flashed this in fastboot with "

fastboot flash boot

" - http://download.chainfire.eu/580/SuperSU/nexus5-hammerhead-lpx13d-kernel.zip

Then I flashed the latest TWRP with "

fastboot flash recovery

" - http://techerrata.com/browse/twrp2/hammerhead

then i rebooted with "

fastboot reboot

"

Then i went back to recovery with "

adb reboot recovery

"

Lastly, i flashed the latest SuperSU ZIP while in recovery - http://download.chainfire.eu/580/SuperSU/nexus5-hammerhead-lpx13d-kernel.zip

all is well

Recovery is back

Root is back

all necessary files are patched.
[Nexus 5 General] irish.iolar:
I flashed an aosp lollipop zip & I still had twrp but no luck with the superuser app updating the binary or w/e, So I restored a backup & then went to look in the roms zip but there was no 'recovery-from-boot' or 'installrecovery' files... Theres only 'backuptool.sh' and 'otasigncheck.sh' inside the system folder. And as soon as you open the zip theres 'systemnew.dat' & 'systempatch.dat' ...are these the ones that should be edited? Any help would be extreeemeely appreciated.
[Nexus 5 General] NitroOnTheRocks:
Does anybody know if TeamWin is working on a new kernel that solves the Lollipop problem?

Or is the PIE Patch, SELinux changer or Permissive kernel the only way to root Nexus 5 LP?

I've been waiting so long for Android 5 to come out, I might as well wait for a new version of TWRP for the Nexus 5 to come out.
[Nexus 5 General] zoltrix:
please look at my post above
[Nexus 5 General] irish.iolar:
Isnt that only for nexus 5?
[Nexus 5 General] :
In #3 you can also just "fastboot reboot-bootloader". Then you can go straight to TWRP from the fastboot window and spare the time of waiting for the phone to boot up :)
[Nexus 5 General] zoltrix:
ahh, i knew there was a way to do it, but just couldnt remember what the fastboot command was

thanks
[Nexus 5 General] danarama:
This thread is only for the nexus 5
[Nexus 5 General] danarama:
You can't easily and edit those before flashing. Youd have to flash then remove the files using a recovery file manager