[Nexus 5 Q&A, Help & Troubleshooting] eross:
I have a Nexus 5 32GB that's about 14 month old. Was running Lollipop 5.1 which was installed through OTA updates (4.44 >5.0 >5.01>5.1). The device is stock and unrooted.

One day, after powering the device up, it went into the boot screen and never managed to finsih the boot (for hours).

After reading extensively on this and other forums , here are the steps I tired , without success:

1. Go to bootloader and press Start

2.Go to bootloader , erase cache

3.Go to bootloader erase user data (factory reset).

I then tried to flash the factory image back. I tried all Lollipop versions from the google developers page of factory images.

starting with 5.1.0 (LMY47I) and going down. All flashing was completed successfully, but the problem remains.

Then I tried 4.4.4 (KTU84P) and the device finally booted up, but it was crippled: Most times It only sees a storage of 16GB , the phone does not recognize any cellular carriers, google play crashes, camera crashes, gallery crashes. An error states that "no external memory is available". Basically it was useless.

I took the phone to an LG lab. They said I need to replace the motherboard. Costs about 200$ !!

I was about to get a new phone , but decided to try one more google search for a fix.

This guide is for any poor soul in the same state.

This issue can be solved without replacing the motherboard for 200$.

The problem in my case was that the /persist partition was degraded, and could not mount.

I found out by trying to follow this guide: http://android.stackexchange.com/qu...dots-lollipop-screen-after-hard-factory-reset

I got as far as activating ADB Sideload when I got the error "cannot mount /persist".

This is a software problem.

Her's how to fix it (It's a long and detailed guide - but worth the result):

First, you must enable USB debugging mode , if it was not enabled (if it is enabled you can skip the first step of this guide) . The way to do that is to flash a stock image that will load, even if not fully working. In my case I could flash version 4.4x and get the phone to load. I am not aware of any other way to enable USB debugging, other than from within a working OS. If someone knows a way - please post it.

The easiest way I found to flash my phone is using Julian OS' script. You can download the stock image5.0 and 5.01 with the script from here:

https://www.androidfilehost.com/?w=files&flid=22367

You will need to adapt the 4.4x firmware to have the script flash it, but it's very easy, just a couple of files to rename.

When you open Julian's zip file you will see that he uses a script that flashes the firmware's images one by one. What I did was download the stock images from Google https://developers.google.com/android/nexus/images , used winrar to extracrt all the files from the .tgz file to a folder, then unzip the only zip file there (image-hammerhead-xxxxx.zip) which contains 5 img files. I then renamed the radio-hammerhead-xxxxx.img to radio.img and bootloader-hammerhead-xxxx.img to bootloader.img. Now all the file names comply with Julian's script. From Julian's archive copy the files "From Bootloader.bat" and "fastboot.exe" to the folder where all the images you just renamed are.

Put the phone in bootloader mode (turn the phone off, press the Vol- and the power buttons). Once the the phone is in bootloader mode, connect it to the PC and run "From Bootloader.bat" and follow the onscreen instructions. In about 2 minutes, your phone will be flashed.

Turn the phone on, it should load the OS. Disregard all the error messages, and don't bother setting the phone up. If you skip wifi, and don't have a sim in the phone you can finish the basic setup quickly.

Next you need to get developer tools activated: Settings>about phone>Build number. Tap 7 times on the build number and this will unlock Developer tools. Go back to settings and the new Developer Tools and enable usb debugging. Approve any popups.

*** I am not aware of how to enable usb debugging if you cannot go into the settings. If non of the stock images loads for you, search for a way to get usb debugging working , or else you cannot continue. You need this for ADB to connect to the phone.****

Next, you need to have ADB on your PC, and it should be able to reach your phone. If you already have - then skip to the next step. If you don't - then here is how to get the latest version:

Go here and download the installer https://developer.android.com/sdk/index.html#Other

Install the file and when it's done run SDK manager. Choose only the first 2 tools (Android sdk tools and Platform tools), this will install the latest adb and fastboot tools. To make sure all is installed open a command prompt (Click Start, type cmd in the search and run cmd.exe) and type adb. You should see all the adb possible commands typed. Now you can test if your phone can be reached by adb: connect your phone (remember usb debugging must be on!) and type: adb devices. After a few seconds you should see something like this:

List of devices attached

024703f599cc8feb device

If you get this, it means you have usb debugging enabled and a proper usb driver installed and you can go to the next step . If there is no device in the list you need to install/update the USB driver:

You have to make sure that when you connect your phone with USB debugging on, you have 2 entries in Winodws Device manager:

Under Portable devices >Nexus 5 , and under Android device> Android composite ADB Interface.

If the second one is missing, ADB will not work and you can't continue. There are 2 ways to fix that :

1. You can install an Android driver called Universal Naked Driver 0.73 from here: http://xdaforums.com/showthread.php?t=2386956. Unzip the file to a folder.

The author of that guide states you need to uninstall any driver that already exists. This proved tricky because Windows would not uninstall the Nexus 5 driver. I decided to install it on a PC that has no android driver.

When you connect the phone to a windows 7 pc for the first time it will search for a driver. I disconnected the internet and windows installed a generic driver. In device manager I saw Nexus 5 with a yellow triangle. I Right clicked on it > update driver software > Browse my computer for driver software and point to the folder you unzipped the driver. You will get a warning - allow the installation.

2. If that does not work or if you don't have another "virgin" PC try this:

Run SDK Manager, under Extras mark Google USB driver. You don't need anything else marked. Install the driver.

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

If the second one is missing, but the Nexus 5 is 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 still 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).

Once adb can see your pohne go here, to read bitdomo's guide to fix the broken persist partition.

http://xdaforums.com/google-nexus-5/general/guide-to-fix-persist-partition-t2821576

There are some prerequisites to getting this to work:

The first one is that the phone can be reached by ADB, this is why you needed the usb debugging mode to be turned on, and the proper usb driver installed.

Second, you need to install a custom recovery image. Don't worry, you will overwrite it later. The one I used is TWRP. Get the latest version from here:

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

To install I recommend you copy Fastboot.exe and the TWRP file to an empty folder on your PC . Rename the TWRP file to "recovery.img". Open a command prompt in the folder (see here if you don't know how http://www.techsupportalert.com/content/how-open-windows-command-prompt-any-folder.htm) , in the black window type: fastboot flash recovery recovery.img and hit Enter. Wait a few seconds and it will finish.

Last, you need to root your device. There are many ways to do this. I did this very simply by downloading CF-Auto-Root from https://autoroot.chainfire.eu/ The file you need is this: https://download.chainfire.eu/363/CF-Root/CF-Auto-Root/CF-Auto-Root-hammerhead-hammerhead-nexus5.zip . Unzip it, put your phone in bootloader, run root-windows.bat.

Now you are prepaired... Follow the guide by bitdomo . Open a command prompt , and run the 2 commands bitdomo wrote. You will get a series of questions , type y followed by Enter until it's all done.

SInce you are still in bootloader mode, and a big START is at the top of the screen, click the power button to reboot. Now your oS 4.4x should load properly. Make sure everything is working.

I did not follow the steps for the wifi and BT fix , because they worked fine (and still do 4 months later) , but you can go ahead and do that too.

Now you can flash to the latest firmware 5.10 - download the file from the developer site I gave before, use Jason Os's script to flash the image, and lock the device. Done! Boot up the device and make sure it recognizes the right amount of RAM on your phone (16 or 32GB). If it does, then all is well .

When I first booted the device , I saw that it only recognized 16GB instead of 32GB. To solve this install TWRP again, go to Wipe>Format data . Then reboot the device and make sure you have 32GB.

If you like the stock recovery instead of TWRP you can use Fastboot to flash the original recovery.img.

Now you have a working Nexus 5 , v5.10.

Thanks to LyricWulf and bitdomo for their life saving guides. I hope this helps others in the same spot, and saves them 200$ .