yashsingh1/xdaforums huggingface dataset:
[Nexus 5 Q&A, Help & Troubleshooting] b666m:
try this (maybe you just missed the second command - afaik without the bootloader reboot the flashed recovery won't stick):

fastboot flash recovery /path/to/recovery.img
fastboot reboot-bootloader

and then try to reboot into recovery on your phone ;)

if this doesn't work:

just download stock image, unpack it, open the flash-all.xxx (bat for windows / sh for linux) and remove the "-w" from the last line.

(this will prevent the script from wiping all of your data.)

then just execute the script.

afterwards you can flash the recovery (see above - and don't forget the reboot-bootloader thingy ^^).

and in custom recovery you can install your zips (custom rom and supersu).
[Nexus 5 Q&A, Help & Troubleshooting] M_Nexus5:
Hi b666m

Thank you for your support & teach me new info & steps

I tried your first idea with the two commands, but unfortunately still the recovery stuck on the old one, I tried with three files of recovery image ! :rolleyes:

I will try your 2th solution but I have to ask you again and double check if I got it correctly to avoid any missing of my important files & Pictures.

as my OS Windows, you mean I have to open "Flash-all.bat" file and delete the "-W" from the flashing command

"fastboot -w update image-hammerhead-ktu84p.zip"

picture bellow for more clear

[IMG="remove -W from the command to avoid wipe data"]http://store2.up-00.com/2015-08/1440241274211.jpg[/IMG]

is it like that ? and that will not delete my files after I double click the flash-all.bat file ?

Thank you again for your support. :good:
[Nexus 5 Q&A, Help & Troubleshooting] M_Nexus5:
The last command which contained "-w"

"fastboot update image-hammerhead-ktu84p.zip"

will flash the "image-hammerhead-ktu84p.zip" file ,

which is already has a "userdata.img" file inside it , I think this is will formatting the userdata also and write new data isn't it ?

as that is mentioned in this link:

http://xdaforums.com/google-nexus-5/general/tutorial-how-to-flash-factory-image-t2513701

fastboot flash userdata C:\image-hammerhead-krt16m\userdata.img
(Note: this command will wipe your device (including \sdcard), EVEN if your bootloader is already unlocked.)

is that right ?
[Nexus 5 Q&A, Help & Troubleshooting] jwhyte:
Yes that is right. Not to change tactics here... But one use twrp recovery because support for cwm ended over a year ago. If you after going to flash factory images I would unzip and flash them all individually except for the userdata.img which would wipe your sd.

---------- Post added at 10:18 PM ---------- Previous post was at 10:16 PM ----------

Follow method two in the how to flash factory images thread you linked. What was suggested before was to open and edit the flash-all.bat script by removing the -w in the script which would wipe. The flash-all has given people issues in the past and by doing each one individually you can see them succeed individually.
[Nexus 5 Q&A, Help & Troubleshooting] adarshdeep:
The best way to solve your problem . it will 100% work I can assure you . download nexus root tool kit on you PC and once downloaded install and then open the application then .. Put your nexus 5 into bootloader if possible and connect the phone to you PC with the OEM USB cable . in the application on the PC you will see unroot and below that an option (soft brick ) chose that and press unroot follow the step and your phone will be fine . I hope I will get a positive feedback from you . enjoying using your nexus 5
[Nexus 5 Q&A, Help & Troubleshooting] M_Nexus5:
Dear [MENTION=5287030]jwhyte[/MENTION] :

Thank you very much for your support and clarify the issue of flashing the userdata.img , I will go with your idea to flash every file individually except the userdata.img file.

Dear [MENTION=6899855]adarshdeep[/MENTION] :

thank you very much for you support, the nexus root tool kit App was very great, and the "flsh stuck + unroot" with "soft brick" has an a good choosing with "No Wipe Data", but unfortunately my Nexus still in Bootloop after I applied this good idea,

The nexus tool kit succeed to flash the

bootloader, radio, recovery, system and I leaved the Nexus for 30 minutes after I read these info but still same issue :(

Booting up your freshly flashed stock device...
------------------------------------------------------------------
Wait for your device to finish booting up...
- It may appear to be boot looping; just wait...
- It could take 5-10 minutes; please be patient...

When its finally booted back up, please remember
to re-enable USB debugging if you plan on using
the toolkit to perform other operations.

any advice please ?
[Nexus 5 Q&A, Help & Troubleshooting] M_Nexus5:
The new update of my trials also:

I got a connection between my Nexus and My Work PC by ADB sideload mode,

and I applied this command to flash the ROM:

adb sideload Rom.zip

and the adb uploaded reach the 100%

and the Nexus 5 start to flashing the ROM, but it didn't complete and this is the output messages on the nexus screen:

Now send the package you want to apply
to the device with "adb sideload <filename>" ...
Restarting adbd ...
Finding update package ...
Opening update package ...
Verifying update package ...
Installing update ...
symlink: some symlinks failed
E:Error in /tmp/update.zip
(Status 7)
Installation aborted.

what is the

symlinks failed and (Status 7 Error)

? there is any solution for this error message ?

Thank you for support to recover my Nexus and files, I have tried for one week now, and I am sure I will get the solution with your support :highfive:
[Nexus 5 Q&A, Help & Troubleshooting] M_Nexus5:
unfortinatily when I tried to flash every file as individual, the adb tools replay with FAILED message (FAILED (remote: flash write failure))

even if I used these three commands before

fastboot erase system

fastboot erase cache

fastboot erase boot

the messages replay by adb

C:\adb>fastboot flash bootloader bootloader-hammerhead-hhz11k.img
sending 'bootloader' (2508 KB)...
OKAY [ 0.299s]
writing 'bootloader'...
FAILED (remote: flash write failure)
finished. total time: 0.499s

C:\adb>fastboot flash radio radio-hammerhead-m8974a-2.0.50.1.16.img
sending 'radio' (45409 KB)...
OKAY [ 1.617s]
writing 'radio'...
FAILED (remote: flash write failure)
finished. total time: 1.797s

C:\adb>fastboot reboot-bootloader
rebooting into bootloader...
OKAY [ 0.001s]
finished. total time: 0.001s

C:\adb>fastboot flash system system.img
erasing 'system'...
OKAY [ 0.119s]
sending 'system' (721400 KB)...
OKAY [ 23.172s]
writing 'system'...
FAILED (remote: flash write failure)
finished. total time: 23.473s

C:\adb>fastboot flash boot boot.img
sending 'boot' (8700 KB)...
OKAY [ 0.387s]
writing 'boot'...
FAILED (remote: flash write failure)
finished. total time: 0.567s

C:\adb>fastboot flash recovery recovery.img
sending 'recovery' (9284 KB)...
OKAY [ 0.417s]
writing 'recovery'...
FAILED (remote: flash write failure)
finished. total time: 0.591s

C:\adb>fastboot erase cache
******** Did you mean to fastboot format this partition?
erasing 'cache'...
FAILED (remote: failed to erase partition)
finished. total time: 0.213s

C:\adb>fastboot reboot-bootloader
rebooting into bootloader...
OKAY [ 0.001s]
finished. total time: 0.001s

is that means the mobile is hard break ?! :(
[Nexus 5 Q&A, Help & Troubleshooting] M_Nexus5:
When I tried to Flash Stuck by the "nexus root tool kit" without wiping data, I got failed in this log for:

bootloader + radio + system, and pass for boot + recovery

Flash Stock + Unroot...
------------------------------------------------------------------

sending 'bootloader' (3119 KB)...
OKAY [ 0.305s]
writing 'bootloader'...
FAILED (remote: flash write failure)
finished. total time: 0.513s
rebooting into bootloader...
OKAY [ 0.003s]
finished. total time: 0.004s

sending 'radio' (45425 KB)...
OKAY [ 1.611s]
writing 'radio'...
FAILED (remote: flash write failure)
finished. total time: 2.839s
rebooting into bootloader...
OKAY [ 0.005s]
finished. total time: 0.006s

sending 'boot' (8980 KB)...
OKAY [ 0.487s]
writing 'boot'...
OKAY [ 0.746s]
finished. total time: 1.241s
rebooting into bootloader...
OKAY [ 0.003s]
finished. total time: 0.004s

sending 'recovery' (9696 KB)...
OKAY [ 0.506s]
writing 'recovery'...
OKAY [ 0.795s]
finished. total time: 1.307s
rebooting into bootloader...
OKAY [ 0.003s]
finished. total time: 0.004s

erasing 'system'...
OKAY [ 0.115s]
sending 'system' (1021840 KB)...
OKAY [ 32.279s]
writing 'system'...
FAILED (remote: flash write failure)
finished. total time: 32.587s
rebooting into bootloader...
OKAY [ 0.003s]
finished. total time: 0.004s
rebooting into bootloader...
OKAY [ 0.003s]
finished. total time: 0.006s

Post-Flash Factory Reset...
downloading 'boot.img'...
OKAY [ 0.420s]
booting...
OKAY [ 0.107s]
finished. total time: 0.537s

You should now see an android on its back with an exclamation point.
This is the 'Pre-screen' to stock android recovery. It requires a button
combination to bring up the menu:

1. While holding down Power, press Volume Up
2. Using the volume buttons highlight 'wipe cache partition'
3. Use the power button to select it.'
4. Wait while it formats 'cache'....
4. Select 'reboot system now'

Press any key to cotinue...

any help to understand why the flashing of bootloader + radio + system were failed ?! :(
[Nexus 5 Q&A, Help & Troubleshooting] jd1639:
[MENTION=6093949]M_Nexus5[/MENTION]. Out of curiosity what happens if you try locking your bootloader in fastboot and rebooting? Does the bootloader stay locked?

fastboot oem lock

fastboot oem device-info
[Nexus 5 Q&A, Help & Troubleshooting] M_Nexus5:
Dear [MENTION=4858937]jd1639[/MENTION] : thank you very much for your support, I will try your idea and submit the result here, but if the bootloader be lucked and can't be unlock again we will loos this feature of unlocked bootloader isn't it ?

Now I have a good news I got & copy all my files

, :highfive:

I play with some features of Nexus root kit tool and try to flash stock Rom and there were a failed as I mentioned that in my last posts,

I flashed each failed X.img, individually under "Fastboot Flash" menus in "Advanced Utilities" Section,

Then I press Custom recovery Under "Fastboot Boot" in "Advanced Utilities" Section

,

I think this option is the key

because it forced the Nexus to run into TWRP recovey mode :good: "but without flash it, because when I reboot by device to recovery mode again I got the dead old one !! :confused:

and this recovery "TWRP" support the "Enable MTP" protocol, so after that I got a connection for my nexus as a storage with my PC and copy All files & Pictures,

I Can copy from the device, but I con't copy from my PC to it.

but there are some Error message

in the log of TWRP recovery mode:

Updating partion details
[COLOR="Red"]E: Unable to mount '/Persist'[/COLOR]
...done
Full SELinux support is present.
[COLOR="Red"]E: Unable to open '/cach/recovery/.version'.[/COLOR]
MTP Enable

also when I tried to flash

the slim Rom by install option I got some error message , the TWRP can't flash the Rom here are the messages:

when I tried to flash a ROM.zip file I got some error messages like this:
Format and Mount System, Mount Data ...
Symlinks and Permissions ...
symlink: some symlinks faild
[COLOR="Red"]E: Error executing updater binary in zip '/sdcard/Zip File sh Update File/Slim-4.4.4.zip[/COLOR]
Error flashing zip 'sdcard/Zip flash Update File/Slim-4.4.4.zip'
Updating partition details...
[COLOR="Red"]E: Unable to mount '/persist'[/COLOR]
...done

also I tried to flash the same my Nexus ROM, (MIUI 4-4-4), but I got same result & Error messages, all Rom already on my sdcard before 4 months maybe.

When I tried "Cache & Dalvik Wipe Complate", I got same error.

Wiping Dalvik Cach Directories...
Cleaned: /data/dalvik-cach...
-- Dalvik Cach Directories Wipe Complete!

Updating partition details...
[COLOR="Red"]E: Unable to mount '/persist'[/COLOR]

Now may if I flash the stock factory image with wiping all data "its default" solve the problem ?!

or the error message above shown something wrong with device ? or need a certain tool to fix it ?!

or I can fix this issue by "Mount" option in the TWRP Recovery ?! I never used this option !

I will try to flash the stock factory image when I come back to the home.

The big important thing was my files and I got them now by your support, Thaaaanks :fingers-crossed:

the next step, am I get my device back or need to buy new one ?! :cyclops:

Thank you again for your support and I hope the log error messages will give more help to explain the real issue for you.
[Nexus 5 Q&A, Help & Troubleshooting] jwhyte:
Well it sounds like you got what you wanted... However from what I've been able to find the errors you are running up against is not good. It sounds like the failed to flash errors and if you boot into twrp which you did and you get mount problems there is a very good chance your sd is fried.

The reason [MENTION=4858937]jd1639[/MENTION] asked about the OEM lock I believe is if it won't stay locked or unlocked it is sd issue.

You can try contacting Google about an RMA however by you replacing there power button they most likely won't accept it.

Good luck glad you got your files.
[Nexus 5 Q&A, Help & Troubleshooting] M_Nexus5:
[MENTION=4858937]jd1639[/MENTION] this is the result of the commands, the bootloader is locked now, but return back when I restart the device !

C:\adbToolsss>fastboot oem lock
...
OKAY [ 0.037s]
finished. total time: 0.037s

C:\adbToolsss>fastboot oem device-info
...
(bootloader) Device tampered: true
(bootloader) Device unlocked: false
(bootloader) off-mode-charge: true
OKAY [ 0.004s]
finished. total time: 0.004s

C:\adbToolsss>

after restarting the device:

C:\adbToolsss>fastboot oem device-info
...
(bootloader) Device tampered: true
(bootloader) Device unlocked: true
(bootloader) off-mode-charge: true
OKAY [ 0.004s]
finished. total time: 0.005s

C:\adbToolsss>

Dear @ jwhyte , yes it was a good luck when I got a copy of my files, but do you mean that is the error message of "Unable to mount" is the sdcard/storage of devices damaged and can't be fix ?!

about the RMA, my devices already out of warranty, I bought it more than one year ago.

so now go ahead to choose & buy a new device ? :eek:
[Nexus 5 Q&A, Help & Troubleshooting] M_Nexus5:
Update:
[MENTION=1295463]D163[/MENTION]9

may I got it here in the link of your post

http://xdaforums.com/showpost.php?p=50142493&postcount=14

now the emmc of device is damaged , and I have to buy new device no other solution for this damage whatever software/hardware ?
[Nexus 5 Q&A, Help & Troubleshooting] jd1639:
If you can't lock/unlock your bootloader there probably isn't anything you can do. But I'd give this a try, http://xdaforums.com/showthread.php?p=59154061
[Nexus 5 Q&A, Help & Troubleshooting] efrant:
Have a look at this thread: http://xdaforums.com/google-nexus-5/general/guide-to-fix-persist-partition-t2821576
[Nexus 5 Q&A, Help & Troubleshooting] M_Nexus5:
[MENTION=4858937]jd1639[/MENTION] after I tried that idea still the device into Bootloop, and I checked the EMMC by "BoardDiag" tool, and I got failed :(, so may as you said nothing can I do with that issue, but I didn't given up yet, I already bought new OnePlus Two,because no more time for new trials, may I have to try new ideas again next week or after that, Thank you very much my dear, you are very helpful.

[MENTION=1566190]efrant[/MENTION] thank you for this link, this is a good idea too, I tried it but faced an issue with using & installing Universal Naked driver, some times the Adb tools can't connect with device in recovery mode, I will try it again and again next week when I have a time and using new PC to install the Universal Naked Driver for recovery only to avoid any other drivers for android.

All dears helpers , thank you very much for your helping,

when I have more time next week I will try some of new idea,

if I get any solution I will submit here the link to be a reference for other

who may face same issue,

Thank you again.
[Nexus 5 Q&A, Help & Troubleshooting] efrant:
It seems you are trying to solve too many issues at once.

The first thing you need to do is make sure your drivers are installed properly, which doesn't seem to be the case. You shouldn't have to mess around with any unofficial drivers. Just install the drivers from Google's website: whttp://developer.android.com/tools/extras/oem-usb.html. That is the first thing you need to make sure is done properly.

The next is to make sure you have the latest version of the four files you need (fasboot.exe, adb.exe, & the 2 dll files) to connect with your device.

Only then should you try to troubleshoot / fix your device.
[Nexus 5 Q&A, Help & Troubleshooting] eross:
You definitely need to fix your persist partition. Your phone will not boot until you do that.

For this to work you need adb to connect to the phone in normal mode (not bootloader).

Installing the naked driver can be problematic, if another driver is already installed. The easiest way is to install it another PC that has not had an Android phone connected to it. You need to disable internet when you connect the phone, and try to cance windows installation of the driver. Then you will have a device with an error in device manager, you right click on it and choose update driver, and choose manual install from the naked driver folder.

If you can't do that, see if you can use the custom recovery to change the phone to connect usb as a camera.

Now open device manager: if you see Android device >Android Composite ADB Interface then adb should work. Try adb devices command. If you see a device you are connected. Then follow bitdomo's guide to fixing the persist partition. You need to be rooted for this to work. You can skip the wifi and BT foe now - you don't need that to boot into the OS. You can do this later.

Once you fix the persist partiton you should be able to boot. Perhaps it will be a good idea to flash stock, but make sure to enable usb debugging, in case you have future problems.

You can see my guide here http://xdaforums.com/google-nexus-5/help/nexus-5-stuck-boot-loop-lollipop-t3098632
[Nexus 5 Q&A, Help & Troubleshooting] M_Nexus5:
[MENTION=1566190]efrant[/MENTION] I already used the official drivers, but the problem in recovery mode sometimes my PC can't connect with the Adb tool, but in bootloader it always does.

so in some threads, which are explain how two fix the problem, they advice to use other drivers to get smoothly connection between PC & Nexus5 in debugging mode without problem.

[MENTION=6645995]eross[/MENTION] thank you for your support, I read your guide , it was a very good explanation for the problem, I already downloaded the "Julian OS' script & stuck image"

but I have a problem with flashing a custom recovery, you said

"Second, you need to install a custom recover image. Don't worry, you will overwrite it later. The one I used is TWRP."

I can't flash any image or file to my device, even when I lock the bootloader then reboot the device, I found it still open not lock !

only I can force my device to boot into TWRP recovery, but without flash it ! by using the "Nexus Root Toolkit" !

is that enough ?

I am looking for a PC without any installed android drivers, to install the naked driver, then try to go through the solution.

If I can't I will reformat my PC and reinstall the OS. because I can't uninstall the old android drivers.

Thank you.
[Nexus 5 Q&A, Help & Troubleshooting] efrant:
That means the drivers you have installed are not installed properly.

Yes, that's enough to flash a custom ROM

Of course you can uninstall old drivers. Formatting a PC because you can't get a driver to work properly seems like overkill.

In any case, if you have already installed a driver (which you have), then there is a

different

procedure to re-install the driver. Please read and notice the difference between the two headings "To install the Android USB driver on Windows 7 for the first time:" and "Or, to upgrade an existing Android USB driver on Windows 7 with the new driver:" on this page: http://developer.android.com/tools/extras/oem-usb.html

I suspect that is why you are having issues with your device not connecting.
[Nexus 5 Q&A, Help & Troubleshooting] eross:
I agree that Formatting your pc is a bit too much. That's why I suggested finding another pc.

As for updating or uninstalling the Nexus driver, that proved imposiible for me too on a Win7 pc.

When you connect your phone to the pc you should have 2 entries in Device Manager: Nexus 5 under portable devices and Android Composite ADB Interface under Android Phone. In b case the ADB device is missing, and ofcourse adb does not work.

I tried to update the driver - does not work, even if I try to manually install from sdk. Uninstalling is useless too, becasue you don't have the option to delted the drivers, and they come back the next time you connect the phone. That' why the different guides such as this don't help: http://donandroid.com/how-to-install-adb-interface-drivers-windows-7-xp-vista-623

I have yet to finf a workaround. Interestingly, putting the phone in USB Camera mode brings up the adb device, but not In MTP mode.

You need to be able to boot into the phone to change this....

If anyone knows how to fix the installed driver, I would be happy to learn . So far it only worked on an OS that did not have an Android device connected, and only if you turn off the internet and block the installation of the Windows built in drivers. Then you get a Nexus 5 with en error in device manager, and you can update to the Naked driver.
[Nexus 5 Q&A, Help & Troubleshooting] efrant:
I've tried to explain how to do it in my post. If it wasn't clear, and you are in that situation and are truly interested, I'd be happy to show you over TeamViewer.
[Nexus 5 Q&A, Help & Troubleshooting] eross:
In which post?
[Nexus 5 Q&A, Help & Troubleshooting] eross:
OK, I managed to install the proper driver for ADB. Here is how:

First, USB debugging must be enabled on the phone!

1. Download Android sdk from here: https://developer.android.com/sdk/index.html#Other Best to download the installer and run it.

Now run SDK Manager (it might take a few seconds to load the GUI so don't worry).

Now make sure that under Extras you mark Google USB driver. In Tools you only need the first 2 (Android sdk tools and Platform tools), this will install the latest adb and fastboot.

Now connect your phone to the PC in normal mode (not bootloader!) . Open device manager. You should have two entries: Portable devices >Nexus 5 and Android device > Android Composite ADB Interface

In my case the second one was missing, but the Nexus 5 was properly installed.

Right click on the Nexus 5 device >Update driver software > Browse my computer for driver software >Let me pick from a list. Now make sure that Show compatible Hardware is ticked . You should now have an entry called USB composite device. Choose that and let it install. When it's done, if you have an an Unknown device >Nexus 5 and no Android Composite ADB Interface in device manager, then unplug the phone and reconnect it again . You should now have both devices installed.

If by chance this does not work, and you have a Nexus 5 with a yellow error , right click it>update software driver> Browse my computer.> and point it to the Universal Naked Driver folder or the SDK>Extras>Google USB driver folder and it should update so both devices appear (Nexus 5 and ADB).