• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root Nexus 4 soft bricked and stuck in fastboot

viksince1993

Newbie
Sep 13, 2014
20
13
Hi all,
I have a nexus 4 which got softbricked
I tried to follow this guide: http://androidforums.com/android-system-mods-scripts-hacks/706533-guide-how-flash-nexus-factory-image-manually.html
I did fastboot devices and got a device id
then i did:
  • fastboot oem unlock
  • fastboot erase boot
  • fastboot erase cache
  • fastboot erase recovery
  • fastboot erase system

but it won't flash the bootloader when i got through all the previous steps and typed: "flash all bootloader bootloader-mako-makoz30d.img" just like in this picture:

XAgfslW.png

This is what the error says in words:
G:Users\Vikram\Desktop\sdk-tools>fastboot flash bootloader bootloader-mako-makoz30d.img
sending 'bootloader' <2203 KB>...
OKAY [ 0.081s]
writing 'bootloader'...
FAILED <remote: flash write failure>
finished. total time: 0.086s


addtional information: My phone just stopped working saying "unfortunately Google play services has stopped" and it kept saying repeatedly, while it was on low battery. I thought I should restart and charge it so it'd fix the issue. But even since I turned off the phone it kept "bootlooping," in my case, it went to the 4 circles and that's it, it stops there.
wipe cache did not work and wipe data/factory reset did not work(sorry i forgot to mention it initially)
I followed every guide, I researched for 3-4 days now and following this guide was my last resort after Wug's toolkit didn't work, CF Auto root did not work, and following this thread where scary alien and jhawkkw helped him. My situation is similar but the steps this guy had to go through to fix his device required the phone to be already unlocked it seems. My phone was never unlocked or rooted or had any changes done to it so I followed the guide by jhawkkw and now I cannot continue because of the error in 2nd picture above.


If I unplug or do anything wrong now, the guide says I will hardbrick the phone.
Please help me.
Update: I think nothing bad happened to the phone. I was able to turn it off before battery ran out. I can still get into the boot loader. Everything in the bootloader looks the same as before(lock state-locked still), except the recovery mode which gives me a black screen when i try to go into it(probably because i used fastboot erase recovery)
When I start the phone now, it goes into the bootloader directly. Even after powering off and then plugging the usb cable to charge it, it opens the bootloader automatically. I'm afraid the battery might run out and I won't get a chance to fix the phone ever again because I read that the phone doesn't charge in bootloader mode.
I hit the power key after selecting Recovery Mode and now I see a black screen. I'm hoping it might charge in Recovery mode(while it is black screen) and hoping someone from here will help me :{
I would really appreciate any help I can get
Thanks
 
Well you should be able to flash 4.4.2 but there have been a few updates since then including 4.4.3 and 4.4.4. See HERE. (scroll to Nexus 4)

Unless you have a specific reason to downgrade, perhaps download the latest stock image (KTU8UP), verify the MD5 to ensure file integrity, and try using the same method as outlined in the thread you were using. Obviously the commands will be slightly different based on the names of the bootloader, radio and image zip which vary in each new package. But the overall structure of the commands will be the same.

It should be charging fine in recovery or with the phone powered entirely off. You can always use the external key combo to get back to the bootloader if need be. Sounds like yours is still alive and well.

I suppose the other option would be to just continue on with flashing the rest of the 4.4.2 img files unless you've already tried that without success.
 
Upvote 0
Well you should be able to flash 4.4.2 but there have been a few updates since then including 4.4.3 and 4.4.4. See HERE. (scroll to Nexus 4)

Unless you have a specific reason to downgrade, perhaps download the latest stock image (KTU8UP), verify the MD5 to ensure file integrity, and try using the same method as outlined in the thread you were using. Obviously the commands will be slightly different based on the names of the bootloader, radio and image zip which vary in each new package. But the overall structure of the commands will be the same.

It should be charging fine in recovery or with the phone powered entirely off. You can always use the external key combo to get back to the bootloader if need be. Sounds like yours is still alive and well.

I suppose the other option would be to just continue on with flashing the rest of the 4.4.2 img files unless you've already tried that without success.
TY very much. starving right now, i'll try this and update the status after 30 min(dinner)
Hey Vik,

Got your PM and have indeed moved you over to the N4 all-things-root area.

Looks like our awesome and very helpful IBT has provided some great advice for you already :thumbup: :).

Best of luck!
Thank you Scary, you are awesome:)

Update: I get an error saying: FAILED <remote: flash write failure>
I was following the steps from the other thread--my mistake. I followed the guide by jhawkkw this time.
I verified MD5 integrity using the MD5 checksum and .tgz file from google matched the md5 on google's site

I repeated all the steps in this order:
fastboot devices
fastboot oem unlock
fastboot erase boot
fastboot erase cache
fastboot erase recovery
fastboot erase system
fastboot flash bootloader bootloader-mako-makoz30d.img

when i wrote fastboot flash bootloader-mako-makoz30d.img, that is when it fails by saying:
sending 'bootloader'<2203 KB>...
OKAY [ 0.074s]
writing 'bootloader'...
FAILED <remote: flash write failure>
finished. total time: 0.083s

I took a screenshot to show you what happened
H9m1KCV.png


p.s. sorry i'm very slow so i take a while to update
 
  • Like
Reactions: scary alien
Upvote 0
Right, I was talking about following jhawk's thread.
Sorry for taking so long to edit. I've just finished editing the whole post and cut out that part and updated it with what happened after I followed jhawk's thread.
What am I doing wrong?
When I extract the .tgz file, it became a "TAR" file and then I extracted the Tar file and put the files I got from it inside the sdk-tools folder. Is this supposed to happen? I am using 7-zip to do this
 
Upvote 0
Sometimes there are zips within zips on these things. Bottom line, you want to see the radio, bootloader and image zip. If you can do that, you're good. If not, keep unpacking or I've found trying different unpack options with 7zip can yield different results on these types of files. So right click on the tgz or tar and try various 7zip unpack options if need be.

Also, I'm not a fan of using the runall.bat if that's what you did. I'm not saying it can't be done but it seems more problematic in my experience so I prefer to fastboot flash the img's separately.

So in the case of the 4.4.4 factory image, it appears the bootloader is unchanged. Same exact filename and size. Therefore, you can try flashing it if you want but it shouldn't be necessary. I'll include it in the command set anyway to be thorough.

So yeah you place the bootloader and radio img files into your sdk tools folder. May want to remove those 4.4.2 files from earlier so as not to cause confusion. You also place the image-occam-ktu84p.zip in there as well (leave that one fully zipped if you follow my method below). So 3 things total.

Then the command set for this firmware is:

fastboot flash bootloader bootloader-mako-makoz30d.img
fastboot flash radio radio-mako-m9615a-cefwmazm-2.0.1701.03.img
fastboot -w update image-occam-ktu84p.zip


Please double check the above commands to be sure they match exactly the file names you have. I transcribed them so just make sure I didn't make a spelling error anywhere please.
 
Upvote 0
Sometimes there are zips within zips on these things. Bottom line, you want to see the radio, bootloader and image zip. If you can do that, you're good. If not, keep unpacking or I've found trying different unpack options with 7zip can yield different results on these types of files. So right click on the tgz or tar and try various 7zip unpack options if need be.

Also, I'm not a fan of using the runall.bat if that's what you did. I'm not saying it can't be done but it seems more problematic in my experience so I prefer to fastboot flash the img's separately.

So in the case of the 4.4.4 factory image, it appears the bootloader is unchanged. Same exact filename and size. Therefore, you can try flashing it if you want but it shouldn't be necessary. I'll include it in the command set anyway to be thorough.

So yeah you place the bootloader and radio img files into your sdk tools folder. May want to remove those 4.4.2 files from earlier so as not to cause confusion. You also place the image-occam-ktu84p.zip in there as well (leave that one fully zipped if you follow my method below). So 3 things total.

Then the command set for this firmware is:

fastboot flash bootloader bootloader-mako-makoz30d.img
fastboot flash radio radio-mako-m9615a-cefwmazm-2.0.1701.03.img
fastboot -w update image-occam-ktu84p.zip


Please double check the above commands to be sure they match exactly the file names you have. I transcribed them so just make sure I didn't make a spelling error anywhere please.
I just double checked the above commands you wrote and they match the file names I have. I made a new folder with the mini-sdk files and put the extracted files from the tar file inside the folder of the mini-sdk files so I don't mix up any files from any previous android version.
I am not sure what to do now because I already did fastboot flash bootloader bootloader-mako-makoz30d.imgradio
This is where it stops and says <remote: flash write failure>
here is the picture I took showing what happens:
H9m1KCV.png


I thank you from the bottom of my heart for helping me. you are a great person.
 
  • Like
Reactions: scary alien
Upvote 0
Go ahead and skip the flashing of the bootloader and continue on with the other commands. Let us know how those go.

I get the same error with the other two commands
it says failed <remote: flash write failure>
here is a pic after I tried the two other commands
3BXbJeD.png


I don't know if this will help you help me but, I never had my phone unlocked and I never had usb debugging ticked in developer options
 
Upvote 0
Previously unlocked is not a problem as long as it's unlocked now. And you don't need debugging in this scenario.

Are you using the stock usb cable that came with the phone? All I can think of is there could be a failure in writing the file through your current cable. Also, try every usb port you have.
edit:
Thank you for clearing that up for me, I didn't know
Yes, I am using the stock cable
Ok. I don't have another cable at the moment so I will try using different ports right now and report back to you

Edit: I tried all the different usb ports and it still says the same error...I can't get a cable for another 7 hours, I will tell you if it works with a different cable today
Thanks
 
  • Like
Reactions: scary alien
Upvote 0
Previously unlocked is not a problem as long as it's unlocked now. And you don't need debugging in this scenario.

Are you using the stock usb cable that came with the phone? All I can think of is there could be a failure in writing the file through your current cable. Also, try every usb port you have.
I had that write failure error happen to me last year when tinkering with my phone. My problem was the wrong USB port. Looking back at my thread, Jhawk had suggested to be sure my ports were 2.0. If you're using USB 3.0 it might not work right.
I'm sorry I took longer than expected, I had 12 hrs of school and sickness to deal with :(
I just got a new cable to use and I made sure I was using USB 2.0 ports. when I tried to flash the boot loader I did the same steps as before and got the same error that says "FAILED <remote: flash write failure>" .
Same error shows when I try to flash radio and the zip files. here is a picture showing that:
TVZez7r.png


I believe I am using the correct drivers, please tell me if you can tell me by looking at this picture:
ZyW0Mts.png

Could I be doing something wrong?
What else can I do to try and fix the phone?
 
Upvote 0
I'm worried that the "flash write failure" is indeed telling you that it's the flash memory on your device that isn't working, vs. the cables and/or connectors to your device.

You should be able to soft-boot a custom recovery (whatever one is appropriate for the N4) and then do an adb shell find and run the e2fsck command on as many partitions as you can identify.

Soft-booting a custom recovery (i.e., it shouldn't write to flash) is done this way:

fastboot boot <custom-recovery.img file>

(this is in contrast to the "fastboot flash recovery <custom-recovery.img file>" that most folks would use to flash a recovery)

I've not used e2fsck before or it's been so long I can't remember, but researching and running that seems like your next best bet / option (and I don't have an N4 to test or tell you all of the partitions).

That's all I got :dontknow:.
 
Upvote 0
I'm worried that the "flash write failure" is indeed telling you that it's the flash memory on your device that isn't working, vs. the cables and/or connectors to your device.

I was about to reply with the same prognosis. I'm worried that your eMMc is corrupt or even unusable. I was silently thinking this could be the case previously but was hoping it would be a peripheral hardware issue instead.

Good idea on the e2fsck. I believe we have gone that route before on a Gnex if I remember right. There are some repair options built into that tool so you never know. It's last resort but you may be rapidly approaching that. :(
 
Upvote 0
I'm worried that the "flash write failure" is indeed telling you that it's the flash memory on your device that isn't working, vs. the cables and/or connectors to your device.

You should be able to soft-boot a custom recovery (whatever one is appropriate for the N4) and then do an adb shell find and run the e2fsck command on as many partitions as you can identify.

Soft-booting a custom recovery (i.e., it shouldn't write to flash) is done this way:



(this is in contrast to the "fastboot flash recovery <custom-recovery.img file>" that most folks would use to flash a recovery)

I've not used e2fsck before or it's been so long I can't remember, but researching and running that seems like your next best bet / option (and I don't have an N4 to test or tell you all of the partitions).

That's all I got :dontknow:.

I was about to reply with the same prognosis. I'm worried that your eMMc is corrupt or even unusable. I was silently thinking this could be the case previously but was hoping it would be a peripheral hardware issue instead.

Good idea on the e2fsck. I believe we have gone that route before on a Gnex if I remember right. There are some repair options built into that tool so you never know. It's last resort but you may be rapidly approaching that. :(

Thank you again for everything
edit: Can you please tell me if eMMc it is something that can be replaced?
I understand I need to boot a custom recovery first and then write adb shell in the command window of the sdk files folder.
I booted a custom recovery using by using fastboot boot recovery-clockwork-6.0.4.7-mako.img but it gave me an error saying: "FAILED (command write failed (Unknown error)).
this is the error:
Xw9LJfs.png


Am I supposed to write "adb shell find" in the cmd? If yes, I did write that and it says "error: device not found" when I write fastboot devices however, it gives me a device id. So the device is found by fastboot.exe but not adb.exe
I searched on the internet about e2fsck and I can't find much information about it besides the commands it uses. can you tell me where I can get the e2fsck utility from? I found this page about what e2fsck does but i'm not sure where I can download the utility from e2fsck(8): check ext2/ext3/ext4 file system - Linux man page
I can download ubuntu and run it on a partition if e2fsck is only for linux
Forgive me if I said something that didn't make sense...
Thanks
 
  • Like
Reactions: scary alien
Upvote 0
Vik,

Lemme do a little searching for you later when I get home from work...

We'll need to find a list of all of the N4's partitions.

Next, I'll find an appropriate custom recovery for your device--we'll need to try to find one with e2fsck in the /sbin folder so you don't have to push one over to it.

You'll move that to your Android SDK folder (or wherever your adb.exe utility is) and do this:

c:\> fastboot boot <custom-recovery.img>

After that (hopefully) boots-up on your device, you should be able to do this:

c:\> adb devices
c:\> adb shell

and from there you'll be able run the e2fsck utility.

edit: oh, I just saw your edits about the fastboot boot failed--that might be a deal-killer :(
 
Upvote 0
Vik,

Lemme do a little searching for you later when I get home from work...

We'll need to find a list of all of the N4's partitions.

Next, I'll find an appropriate custom recovery for your device--we'll need to try to find one with e2fsck in the /sbin folder so you don't have to push one over to it.

You'll move that to your Android SDK folder (or wherever your adb.exe utility is) and do this:



After that (hopefully) boots-up on your device, you should be able to do this:



and from there you'll be able run the e2fsck utility.

edit: oh, I just saw your edits about the fastboot boot failed--that might be a deal-killer :(
Sorry, I edited it because I forgot to use that command first and see what it would say.
What can I do now? :(
If everything doesn't work I'll have to call LG and see how much they'd charge to fix the phone by replacing emmc or whatever else the problem might be or end up buying a new phone
 
Upvote 0
I have good news for my phone :D
I unplugged the usb cable turned off the phone and started afresh and
recovery file worked this time when I wrote:
fastboot boot recovery-clockwork-6.0.4.7-mako.img
here is what it said:
downloading 'boot.img'...
OKAY [ 0.284s]
booting..
okay [0.026s]
finished.

Edit: Yes, it said* "Locked Status: Unlocked" or something like that(I don't see that screen anymore). After I booted the recovery image it is now showing a different screen with options:
- reboot system now
- install zip
-wipe data/factory reset
-backup and restore
-mounts and storage
-advanced
 
Upvote 0
I have good news for my phone :D
I unplugged the usb cable turned off the phone and started afresh and
recovery file worked this time when I wrote:
fastboot boot recovery-clockwork-6.0.4.7-mako.img
here is what it said:
downloading 'boot.img'...
OKAY [ 0.284s]
booting..
okay [0.026s]
finished.

:thumbup:

Do you see anything on your screen (i.e., is the custom recovery menu present)?

Also, does "adb devices" report your device's serial number? (you don't have to post that number here, though...).
 
  • Like
Reactions: viksince1993
Upvote 0
IBT, I thought his fastboot oem unlock attempts worked? :thinking:

I don't see a "FAILED" error in his screen shots above?

Is there an unlock symbol on the device and/or does the bootloader status show at the bottom of the bootloader screen like it does on the N5 and N7?


Hmm, i was looking at post #17...the cmd screenshot where it said the fastboot oem unlock failed. <status read failed - too many links>.

Was that just because it was already unlocked you suppose?

edit: well hey nevermind. I'm way behind the times here. Good news above. :D
 
  • Like
Reactions: viksince1993
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones