yashsingh1/xdaforums huggingface dataset:
[Nexus 5 General] kilometers4:
Ok can you try it from here:

fastboot flash recovery recovery.img (use this recovery TWRP

format sdcard (i believe it is) (keep in mind this will obviously wipe all of the data from the device)

Now adb sideload ROM and gapps
[Nexus 5 General] Woody:
Hey Kilometers, he is having trouble with the N5 "Hammerhead", so make sure that you curtail your responses towards that. I know your issue was with the N7, but since the issues were extremely similar is why I ask.
[Nexus 5 General] demkantor:
I would try formatting the partitions separately and then flashing new firmware/software

fastboot erase system

fastboot erase cache

fastboot erase userdata

fastboot erase recovery

fastboot erase boot

Then I would extract these images from here

https://developers.google.com/android/nexus/images#hammerhead

And start with bootloader

fastboot flash bootloader nameofbootloader.extension

.img .nb0 whatever

Then

fastboot flash radio nameofradio.img

(maybe modem can't recall on these so look for modem if need be)

fastboot flash recovery nameofrecovery.img

fastboot flash system

fastboot flash userdata

fastboot flash cache

And so on

If any errors please post all input/output from cmd in codewraps here or pastebin link
[Nexus 5 General] kilometers4:
Thanks, just edited my posts with the correct information.
[Nexus 5 General] tidoubleger:
Tried flashing TWRP but here's the strange thing, no matter what recovery I flash it brings up CWM. Even after using 'fastboot erase recovery' I flashed TWRP & Phil'z and it still brings up regular CWM touch 6.0.4.5.

http://pastebin.com/GDhRAVYA
[Nexus 5 General] demkantor:
Sorry to say my friend but I suspect you have some severely corrupt blocks and a fix is far from likely, at least I've never seen one when someone gets in this place. You could try some DD commands but may make things worse (but this could make your phone not boot what so ever on purpose if your scared what happens in RMA...)

What I would do is try

fastboot oem lock

Then send it in for a new one (even if it won't relock) and just claim ignorance.... I was updating angry birds and it just froze... Or something like this

Or if you really want to try some dd commands let me know, either to attempt to resurrect (unlikely) or turn this into a full on hard brick
[Nexus 5 General] tidoubleger:
Are there any other areas to fastboot erase to help hide any tracks? I can lock it but can't seem to get the tamper flag to false
[Nexus 5 General] demkantor:
Nothing more that I am aware of, fastboot commands are limited on lg devices, at least compared with many HTC bootloaders. The only thing else I can think of are dd commands which if you know where the tamper flag is located (I don't but its probably researchable) you may be able to change it, but in truth I don't know enough about it to say for sure
[Nexus 5 General] kilometers4:
Can you boot into CWM? if you can have your tried wiping everything from there?
[Nexus 5 General] tidoubleger:
I appreciate you jumping ship to help. Depending on how the outlook looks as far as RMA I may either RMA it or file for my Squaretrade insurance. Thanks all!
[Nexus 5 General] tidoubleger:
Yes but it just fails due to being unable to mount whichever partition I'm trying to wipe
[Nexus 5 General] ialv_88:
you guys found any solution? still stuck on recovery stock no matter what i flash it always keeps me back to recovery. Even after flashing from fastboot one by one. Thanks

---------- Post added at 11:02 AM ---------- Previous post was at 10:07 AM ----------

already flashed the recovery from the op and nothing it boot into recovery but no options.
[Nexus 5 General] Волк:
Is your bootloader unlocked? Have you tried erasing recovery first?

What all have you done?
[Nexus 5 General] Trel:
You just saved my life. This happened to me in a place where I couldn't access my backups.
[Nexus 5 General] ywt474000158:
My nexus 5 was the same situation as yours.It has been bricked for 3 monthes.

Have you solved it , if you solved please tell me.

I will appreciate it sincerely.
[Nexus 5 General] tidoubleger:
I was unable to fix it as the problem appeared to be corrupted memory. I ended up RMAing it and received a new one and wasn't charged. Don't hold me to if that'd be the response if someone else RMAed it with that problem. No idea if it was because they saw it was bad memory and honored it or if they didn't even worry about digging into it and it just went on through.
[Nexus 5 General] MungoHigh:
Damn..you saved my Nexus! Thanks for the great tutorial..worked perfectly!
[Nexus 5 General] ywt474000158:
ok. Thanks for reply.
[Nexus 5 General] GeoWatsons:
Thanks for your post.

I accidentally broke /data/media by using cwm recovery's restore /data.

And e2fsck userdata saved my data.
[Nexus 5 General] kamilmirza:
hello guys

i bought hammerhead today, i only used it for 10 mins :'(

unlocked the device and flashed twrp (no toolkits used) and was about to take backup

and then faced "unable to mount", tried all recoveries

and i can't boot into my stock ROM, the boot animation keeps on going and i can see the brightness increases but stay in boot animation

and sadly i have no warranty

i am downloading factory image and will report back

is there any method to re-partition data/storage partition? :confused: like THIS on HTC One

EDIT: well finally it's resolved by flashing factory image :D
[Nexus 5 General] Datsun.510:
About my problem.

Installed a ROM using MultiRom. After trying the new ROM out and rebooting my device to boot my internal ROM, my device was stuck in a bootloop at the bootanimation. I restarted the device again and it went into recovery by itself, restarted it again with and same result. My SD Card was empty in the Recovery. I tried to ADB Push a new ROM to Recovery and then reinstalling the ROM but it said "Unable to mount Data". Tried to flash TWRP through fastboot and was successful but was not able get the phone booted, as it went straight to the Recovery again.

I started doing research to see how I could fix this issue and I was lucky enough to run across this thread.

This line.... saved my phone.

Enter: ‘e2fsck /dev/block/platform/msm_sdcc.1/by-name/userdata’

After running this line and hitting 'yes' about 40 times, I rebooted my recovery once it finished. Now my SD Card was showing up again. I tried booting the ROM and it wouldn't work. So I dirty flashed my ROM and then it booted successfully.

I have now backed up my phone and will wipe it completely to make sure there are no more errors in the partitions.

Thank you so much for this information.
[Nexus 5 General] trschober:
As a long time linux admin, I knew my data partition was corrupted the minute my phone started force closing, and I knew i made it worse when I force rebooted.

This little trick to run e2fsck from recovery saved the day! thanks!
[Nexus 5 General] wrick17:
U literally saved my life dude!! :D Thanks :D
[Nexus 5 General] Elluel:
Thanks for this, corrupted /data after running HWBot Prime at 3014MHz a couple times with fsync off.
[Nexus 5 General] Bladeage:
Probably Saved my Nexus 5 and my nerves

This Guide helped me a lot! Thanks for this!

ATM I am pulling all data from /data/media to my computer.

I still cannot explain how this happened to me. I updated my Kernel (ElementalX to v0.38) and after 3 or 4 hours it somehow restarted and bootlooped. Then I went into my Recovery -> sdcard was empty and mounting data was impossible!!!!

Everything will be backed up in the future, to be prepared for everything.

BTW: This Guide needs to be pushed. It saved the Nexus 5's of so many people out there :)
[Nexus 5 General] ercxar:
Exactly!! man [MENTION=2680885]cadbomb[/MENTION] you are awesome! You just saved me from data loss. :good:

I really appreciate it.
[Nexus 5 General] Potetsjokolade:
I got:

~ # ←[6ne2fsck /dev/block/platform/msm_sdcc.1/by-name/userdata

e2fsck /dev/block/platform/msm_sdcc.1/by-name/userdata

e2fsck 1.41.14 (22-Dec-2010)

/dev/block/platform/msm_sdcc.1/by-name/userdata: clean, 872/838832 files, 133291

/3351034 blocks

but still no signal
[Nexus 5 General] uzzo85:
hello guys, i have the same problem: unable to mount data, already tried the guide but it says: superblock corrupt, at last with flashing factory the phone is riborn! anyway thanks for the guide
[Nexus 5 General] ashu347:
nexus 4 - stuck in boot loop

Stuck on boot screen

Okay..this is how it happened...

when i checked my mobile couple of days back ..apps were crashing..."[app] stopped working" message was coming for many of the goggle apps....In past - a restart used to fix this.

I restarted my phone - but it got stuck in the bootloop (circles)

What i need next

went in bootloader menu (power and - volume)

selected factory reset

power button

blank black screen

nothing happened for a long time

then i searched on google ..downloaded SDK, nexus 4 image ..and tried to flash ..evrything went fine I till tried to flash the bootloader image and got message "failed (remote flash write failure)"

And I am stuck at this stage please advise

Now when i retstart phone goes directly into bootloader menu - may as i have erased other stuff while flashing..

Please help me ---- I do not want to loose my phone....
[Nexus 5 General] kamilmirza:
why you used Nexus 4 image? :eek: it will mess up your device pretty bad

I don't think there is nothing you can do but to use stock Nexus 5 image :rolleyes:
[Nexus 5 General] stefan2305:
This saved my life! Well, just about. Saved my job! Thank you soooooo much for this!!!!!! :good::good: :D
[Nexus 5 General] Flyview:
Thanks for the guide!

I am trying it myself but in the all important step of trying to repair the data partition, I see this:

EDIT: Weird, it somehow worked, device booted after I rebooted...

EDIT2: And then froze at the lockscreen and went black...now it won't boot again or mount any partitions (same as before)
[Nexus 5 General] b0toxXP:
Hey everyone,

i also had the corrupted userdata.

The Guide didn't helped me because e2fsck told me the corrupt superblock.

But locking again the bootloader and unlocking it a second time solved it for me. (i think the erasing-process on unlocking solved it).

(sorry for bad english ;) )
[Nexus 5 General] Quinny899:
Why wasn't this here when I last messed up my /data? :S

It worked, somehow messed up mine playing a game and the device froze, hard reboot, bootloop. I thought "crap, seen this before", rebooted into TWRP, long splash. By this time I was cursing. I'm on holiday, I don't have my stuff with me, just a netbook and TeamViewer

Using this guide, I got CWM to connect to adb on Ubuntu, see here for "insufficient permissions": UDEV

And got this to work. Saved my bacon as they say. Backing up now. Thank you so much.

Do you have a PayPal donation email? I have money in my account from StartApp that I can't pay out right now and would like to buy you a light refreshment for the guide
[Nexus 5 General] harsh2193:
I followed the guide and the "e2fsck /dev/block/platform/msm_sdcc.1/by-name/userdata" line did find a lot of errors. After all of them were supposedly fixed, it gave a segmentation error and gave a blank line. I wasn't able to flash the recovery either as it gave me a "remote : flash write failure", so i just temp. booted into cwm while I used the adb commands. Problem now is that i still get the flash write failure when i try to do anything (literally anything that requires flashing) and when i temporarily boot into CWM or Philz touch (can't temp. boot into TWRP for some reason, it gets stuck at the twrp screen), it gives me an error "E : Failed closing /dev/block/platform/msm_sdcc.1/by-name/misc (I/O error)". I wasn't able to temp boot philz recovery earlier either but after following your guide, I can so something clearly happened.

Still can't flash anything though and I'm stuck with an open bootloader. Don't mind if I can't bring the phone back but just want to relock the bootloader so i can at least get a replacement. Desperately need your help.
[Nexus 5 General] joecool666:
thank you O.P for this very helpful . kind regard's joe
[Nexus 5 General] Juniluis:
Where can enter this line how do i do it please help me

---------- Post added at 05:28 AM ---------- Previous post was at 04:45 AM ----------

Mine didn't show the device serial number with recovery after it only shows the serial number and when i enter the line it says to e2fsk not found. Please help
[Nexus 5 General] louloudi:
I have same problem with fsck error:

I don't care about data so my first fix was:

( /dev/block/mmcblk0p28 is what my userdata symlinks)

but got two "internal storage" in MTP

Then I tried:

and this deleted all files (inc. /sdcard ) but now everything works ok...

Hope it help someone :)
[Nexus 5 General] Juniluis:
http://xdaforums.com/google-nexus-5/general/guide-to-fix-persist-partition-t2821576

This link ,this page will save your phone . believe me try it .
[Nexus 5 General] Flyview:
I have now had this problem happen a few times. How ironic is it that 5 minutes after viewing a notification from this thread, it happened again?

When it happens to me, TWRP can't mount ANY partitions. I noticed that if I format system in fastboot (fastboot format system), then TWRP sees the data partition again. I then run e2fsck on the SYSTEM partition (not data) from the terminal in TWRP, with the -p parameter that automatically fixes problems (otherwise terminal gives an error that it can't do it with user interaction), and then re-flash system.img (fastboot flash system system.img). Just formatting and re-flashing system doesn't work, so I know e2fsck is doing something.

Next time it happens, I will see if running e2fsck directly from terminal will work even if TWRP can't mount any partitions.
[Nexus 5 General] negativzeroe:
Whelp, I think I bricked it. I used this method

http://xdaforums.com/google-nexus-5...tory-image-t2513701/post47156064#post47156064

But my recovery couldn't mount anything and my boot would never finish, so I tinkered with the things in this forum. Now I have no boot, no bootloader, so my computer doesn't recognize anything. That is just great. Time to go back to my HTC Evo 3D because I spent 250 on a paperweight from swappa. /fml
[Nexus 5 General] joecool666:
maybe you have bought somone else's problem, sorry to hear this good luck. regard's joe
[Nexus 5 General] negativzeroe:
Well I have had it for several months, but it was odd that I couldn't mount anything or have permissions to anything. Have you heard of the nand just dying like that?
[Nexus 5 General] joecool666:
yes but its somewhere back in the post's, try lg flashtool,hope this help's have a look in rootsu signature.very helpful.
[Nexus 5 General] negativzeroe:
Tried to no avail, my device manager shows QGSUSB_BULK as the device and I have all the proper drivers installed.
[Nexus 5 General] joecool666:
beyond me bud sorry ,hope you get it sorted but look in rootsu post might be able to help just ask him hope this help's you.regard's joe
[Nexus 5 General] negativzeroe:
Where is this rootsu?
[Nexus 5 General] Elluel:
That would be [MENTION=2872010]rootSU[/MENTION].

Its in my signature too. First link in it.
[Nexus 5 General] old_fart:
Had the error ! um, i was fearing the worst, and then i just tried a 'factory reset' and then it seems to be okay now. maybe i dodged a bullet ?

.

Ah... ( for me and my nexus ) if i do a 'factory reset' and it show no complaints and errors, then i install the custom rom and gapps and ( spiffy ) kernel... it all goes swell and boots up and works. then if i wish to ( twrp ) install a zip, i run into the error 100 percent of the time.

.

is this a twrp thing ? probably not... but a reset lets everything install without a complaint.

.

something is corrupt... the reset sez it 'formats' the data partition ? so that format does not fix the corruption ?
[Nexus 5 General] negativzeroe:
Ok so I found that thread before, but my issue is that I can't get to bootloader now. No signs of life at all.

It all started when I was trying to flash my rom. The recovery (TWRP) couldn't mount any of the partitions,

so I went to the adb shell and got permission denied after every command here, and then when I rebooted,

I couldn't get to bootloader or anything. It just vibrated without the screen turning on, then I got no vibrations.

Dead.
[Nexus 5 General] Elluel:
See if you can boot into the secondary bootloader. Hold volume up, down, and power.
[Nexus 5 General] negativzeroe:
No dice
[Nexus 5 General] Elluel:
Your eMMC might be dead, as you previously said you can't mount anything. If it is then you can't do much about it.
[Nexus 5 General] negativzeroe:
Yeah I'm probably going to buy a shattered one online for cheap and steal the top board out of it and put it in mine.
[Nexus 5 General] Sheppington:
Is this supposed to work for the nexus 4? My phone started going haywire and now I can't boot after an attempted fresh install, I've gotten up to typing the string e2fsck...etc into CMD and it only says not found, please somebody help I'm about ready to buy a new phone.
[Nexus 5 General] bocaJWho:
Just wanted to let folks know, I ran into a similar problem and was able to solve it by walking through the factory reset steps on one of the official Google product forums. https://developers.google.com/android/nexus/images

Instructions pasted below. After following them, I was back to 100% stock. Afterwards, I installed CWM, then sideloaded a CyanogenMod Stable Monthly (CM11 M10) and was able to boot up fine.

Pasted below:

Flashing Instructions

To flash a device using one of the system images below (or one of your own), you need the fastboot tool. You can get the fastboot tool either:

From a compiled version of the the Android Open Source Project.

Or, from the platform-tools/ directory in the Android SDK. Be sure that you have the latest version of the Android SDK Platform-tools from the SDK Manager.

Once you have the fastboot tool, add it to your PATH environment variable (the flash-all script below must be able to find it). Also be certain that you've set up USB access for your device, as described in the Using Hardware Devices guide.

Caution: Flashing a new system image deletes all user data. Be certain to first backup any personal data such as photos.

To flash a system image:

Download the appropriate system image for your device below, then unzip it to a safe directory.

Connect your device to your computer over USB.

Start the device in fastboot mode with one of the following methods:

Using the adb tool: With the device powered on, execute:

adb reboot bootloader

Using a key combo: Turn the device off, then turn it on and immediately hold down the relevant key combination for your device. For example, to put a Nexus 5 ("hammerhead") into fastboot mode, press and hold Volume Up + Volume Down + Power as the device begins booting up.

If necessary, unlock the device's bootloader by running:

fastboot oem unlock

The target device will show you a confirmation screen. (This erases all data on the target device.)

Open a terminal and navigate to the unzipped system image directory.

Execute the flash-all script. This script installs the necessary bootloader, baseband firmware(s), and operating system.
[Nexus 5 General] harsh2193:
Just try getting it RMA'd. I got mine exchanged. I told them that the device was rooted but they said that it wasn't a problem. Do keep in mind that it's better to call them rather than email them. When I emailed, they just sent me a couple of links instructing me on how to factory reset and flash stock images. Once i called, they gave me an RMA no. within 5 minutes of the first call itself.
[Nexus 5 General] vflock:
hey im sorry - very poor with all of this, but i have this exact issue after not waiting long enough for cache to wipe.

can yu expand on where i can download nexus 5 5.0 lollipop cache.img and how to flash it using fastboot? so much thanks.
[Nexus 5 General] demkantor:
Grab the latest for hammerhead

https://developers.google.com/android/nexus/images

Unzip it, find the folder images, unzip it

fastboot erase cache

fastboot flash cache cache.img
[Nexus 5 General] akh1989:
Tried following this guide for my Nexus 5 which seems to have a read-only file system and no apps working (more details here: http://xdaforums.com/google-nexus-5/help/app-connecting-to-network-t2965809) but I get stuck on step 6:

How do I do this ? if I do a normal reboot into recovery I lose adb connection and adb devices shows nothing ? Any help please ? Should I try and run e2fsck when the devices is booted and connected to adb ?
[Nexus 5 General] demkantor:
If you have a custom recovery then you can use adb, I wouldn't advice to try it when booted in os
[Nexus 5 General] akh1989:
I installed Philz recovery as mentioned in this thread but when I am in recovery mode, adb devices doesn't detect my nexus 5 while it detects just fine when the phone is in normal mode. Do I need to select some specific option in Philz to get the phone detected ?
[Nexus 5 General] demkantor:
It is probably a driver issue, try either a different recovery or update the drivers associated with your device while in recovery
[Nexus 5 General] akh1989:
Thanks for the reply. Got it sorted out. It was actually an issue with persist partition . Fixed it using e2fsck and it seems to be working now.
[Nexus 5 General] T3hBraveBoss:
What commands should I use then instead of using the tool kit
[Nexus 5 General] Flyview:
Alright so since the update to 5.1, my Nexus 5 has been self-bricking pretty much every couple of days (used to be every 3 months). For me, the system partition becomes corrupt and that somehow stops ANY partitions from being mountable by TWRP. The phone is stuck at the Google logo, but I am still able to get into bootloader. Once I format system with fastboot, I'm able to see the other partitions in TWRP (and re-flash system). What could be causing this? My guess is bad sectors on the internal memory. With the 5.1 system partition is now full to the brim (about 11mB left on a stock flash, <5mB left after rooting). I suspect this is making the phone write/read from the corrupt sectors more often.

Any experts out there know how to analyze something like this?
[Nexus 5 General] Martyx23:
I had my "persist" partition corrupted, which resulted in android not able to boot. This has solved my problem! Thank you! Interesting fact: I was able to boot android 4.4.4, but there was no baseband, imei, etc. But 5.1 was stuck at boot animation...
[Nexus 5 General] Flyview:
How did you figure out which partition was corrupt?
[Nexus 5 General] Martyx23:
I tried to wipe my phone in recovery with no succes, message "unable to mount persist partition" or something like that appeared...
[Nexus 5 General] Termina24:
adb shell

Hello,

Great work but i am having issues with adb shell i start CMD in correct folder and run adb in CMD and adb devices is saying devices S/N then Recovery when i type adb shell then press enter the line just sits there flashing nothing happens i don't get # that i need to fix unable to mount '/persist' issue. Any help you are able to give would be most welcome.

Thanks :D
[Nexus 5 General] zerosum0:
I'm no expert but found what you wrote interesting. IMO all flash memory develops dead spots, especially with flashing all the time. Having so little "wiggle room" in the system part. Could be to blame. I took as much out as I could. I'm using Lite rom which is stock but most Gapps left out. When it was a full as yours on another rom I too had issues with the system. They seemed to grow, over a short time and the phone became unusable. I put it back to factory condition and flashed a rom that takes 470?megs.

Its run perfectly since. I too put it down to the system part. being too full. I've no way of changing the size, which I would have.

Sent from my Nexus 5
[Nexus 5 General] DaGr81:
Ultimate solution is flashing a factory image.
[Nexus 5 General] AleALMEIDA:
???

Dude I have a huge problem to install custom recovery not give the command and ok more when I try to go into recovery mode and into recovery stock that was already installed how to proceed?