[GUIDE] Nexus 4 - Factory Image Restore

You don't need usb debugging enabled for fastboot. What exactly is happening when you are in the bootloader, plugged in, and enter fastboot devices?

Also given that you had an unrooted, locked (I'm presuming) device which froze up after the update, you may possibly just want to contact Google and get a new one sent rather than start hacking at it.

Given that he's stuck at the X boot animation maybe he can give the oem-lock/unlock trick a try?
 
You don't need usb debugging enabled for fastboot. What exactly is happening when you are in the bootloader, plugged in, and enter fastboot devices?

Also given that you had an unrooted, locked (I'm presuming) device which froze up after the update, you may possibly just want to contact Google and get a new one sent rather than start hacking at it.

when i am in bootloader, plugged in & enter fastboot devices, it does not return anything. just a blank line. i assumed that it is not able to detect my device.
i can not contact Google so easily because i purchased phone in US & I stay in India.
 
Sir, you are a GENIUS!! The 4.3 OTA update caused me major problems. This guide resolved them. Thanks a lot!!
 
4.3 OTA update also stopped my nexus 4 from booting up. I kept getting error messages when the update was installing and phone was stuck in a loop. It was then stuck on the Nexus logo loading screen.

Followed these instructions and its fully resolved it. I suspect it was because I installed Avast! a few months back. Presume that that means I no longer had a stock nexus and so OTA failed.

The only tiny thing to add is that my phone was locked so when I tried step 5 nothing happened. Obviously read a little further and learned how to unlock it, but wasn't immediately obvious.

Anyway, major thanks to 2defmouze, appreciate your time and effort putting this guide together.
 
Ok, thanks, I now know my Nexus 4 wasn't bricked!

I had to play with the spacing between -w and update and I finally got it to work.

Then I tried what 2defmouze (OP) said to see if troubleshooting worked, and it did! :-)

All I had to do was boot into the bootloader and run

" fastboot-windows oem lock " (enter)
" fastboot-windows oem unlock " (enter).

I feel embarrassed :D
 
Last edited:
WARNING WARNING WARNING FOLLOWING OP'S INSTRUCTIONS BRICKED MY DEVICE.

I followed the instructions, with the fastboot-windows -w having 2 spaces between the next command (update) to get OP'S instructions to work.
BUT, when I did this it got stuck on the X boot logo, and nothing I do seems to work!
I can't use ADB as I'm stuck at the X logo :-(.

I unbricked by following instructions from xda..." Okay, one thing you could try is to go to the bootloader. Once there, click volume buttons til "recovery" is displayed. Then press power to confirm. You'll see a little android with a red sign --> press vol +, vol - and power at the same time. You'll have a little menu where you can execute a "factory reset". Press it and maybe will it be okay ! "

Just a wording point here. "Bricked" your device means it's dead beyond saving. If you were able to "un-brick it" as you stated, it was never bricked to begin with. There's usually a way to recover from bad flashes as you found.
 
WARNING WARNING WARNING FOLLOWING OP'S INSTRUCTIONS BRICKED MY DEVICE.

I followed the instructions, with the fastboot-windows -w having 2 spaces between the next command (update) to get OP'S instructions to work.
BUT, when I did this it got stuck on the X boot logo, and nothing I do seems to work!
I can't use ADB as I'm stuck at the X logo :-(.

I unbricked by following instructions from xda..." Okay, one thing you could try is to go to the bootloader. Once there, click volume buttons til "recovery" is displayed. Then press power to confirm. You'll see a little android with a red sign --> press vol +, vol - and power at the same time. You'll have a little menu where you can execute a "factory reset". Press it and maybe will it be okay ! "

Just a wording point here. "Bricked" your device means it's dead beyond saving. If you were able to "un-brick it" as you stated, it was never bricked to begin with. There's usually a way to recover from bad flashes as you found.

This.

The extra factory reset you did is basically the same as my Troubleshooting instructions to lock/unlock the device again. I've gotten plenty of people through this process safely, you were far from bricked my friend :)

Sent from my Nexus 4 using Tapatalk 2
 
I get the following error: load_file: could not allocate 351375882 bytes
error: failed to load 'image-occam-jwr66v.zip': Not enough space
 
I get the following error: load_file: could not allocate 351375882 bytes
error: failed to load 'image-occam-jwr66v.zip': Not enough space

What kind of system are you using? Have another computer you can try it out from?

Sent from my Nexus 4 using Tapatalk 2
 
This thread saved my phone. I tried to root to get LTE, but I could not get past boot screen. I am a complete noob (first time ever doing this) and was able to follow this tutorial after a few tries. Thank you!!!

I have OTA 4.3. Is there any safe way for me to get LTE?
 
This thread saved my phone. I tried to root to get LTE, but I could not get past boot screen. I am a complete noob (first time ever doing this) and was able to follow this tutorial after a few tries. Thank you!!!

I have OTA 4.3. Is there any safe way for me to get LTE?
You don't need to root for LTE because you'd have to flash the older radio which does require the unlocked bootloader as far as I know. Try skimming through XDA-Developers' Nexus 4 LTE thread.
 
Thank you
i get yhis
it is ok now ?
Code:
archive does not contain 'boot.sig'
archive does not contain 'recovery.sig'
archive does not contain 'system.sig'
--------------------------------------------
Bootloader Version...: MAKOZ20i
Baseband Version.....: M9615A-CEFWMAZM-2.0.1700.84
Serial Number........: 005fe761e350a4ee
--------------------------------------------
checking product...
OKAY [  0.002s]
checking version-bootloader...
OKAY [  0.002s]
checking version-baseband...
OKAY [  0.002s]
sending 'boot' (6194 KB)...
OKAY [  0.199s]
writing 'boot'...
OKAY [  0.383s]
sending 'recovery' (6738 KB)...
OKAY [  0.229s]
writing 'recovery'...
OKAY [  0.421s]
erasing 'system'...
OKAY [  0.040s]
sending 'system' (570666 KB)...
OKAY [ 17.965s]
writing 'system'...
OKAY [ 36.246s]
erasing 'userdata'...
OKAY [  0.468s]
formatting 'userdata' partition...
Creating filesystem with parameters:
    Size: 14129561600
    Block size: 4096
    Blocks per group: 32768
    Inodes per group: 8144
    Inode size: 256
    Journal blocks: 32768
    Label: 
    Blocks: 3449600
    Block groups: 106
    Reserved block group size: 847
Created filesystem with 11/863264 inodes and 95427/3449600 blocks
sending 'userdata' (137438 KB)...
writing 'userdata'...
OKAY [ 12.575s]
erasing 'cache'...
OKAY [  0.030s]
formatting 'cache' partition...
Creating filesystem with parameters:
    Size: 587202560
    Block size: 4096
    Blocks per group: 32768
    Inodes per group: 7168
    Inode size: 256
    Journal blocks: 2240
    Label: 
    Blocks: 143360
    Block groups: 5
    Reserved block group size: 39
Created filesystem with 11/35840 inodes and 4616/143360 blocks
sending 'cache' (10984 KB)...
writing 'cache'...
OKAY [  1.043s]
rebooting...

finished. total time: 69.613s
thank you again
 
Thank you
i get yhis
it is ok now ?
Code:
archive does not contain 'boot.sig'
archive does not contain 'recovery.sig'
archive does not contain 'system.sig'
--------------------------------------------
Bootloader Version...: MAKOZ20i
Baseband Version.....: M9615A-CEFWMAZM-2.0.1700.84
Serial Number........: 005fe761e350a4ee
--------------------------------------------
checking product...
OKAY [  0.002s]
checking version-bootloader...
OKAY [  0.002s]
checking version-baseband...
OKAY [  0.002s]
sending 'boot' (6194 KB)...
OKAY [  0.199s]
writing 'boot'...
OKAY [  0.383s]
sending 'recovery' (6738 KB)...
OKAY [  0.229s]
writing 'recovery'...
OKAY [  0.421s]
erasing 'system'...
OKAY [  0.040s]
sending 'system' (570666 KB)...
OKAY [ 17.965s]
writing 'system'...
OKAY [ 36.246s]
erasing 'userdata'...
OKAY [  0.468s]
formatting 'userdata' partition...
Creating filesystem with parameters:
    Size: 14129561600
    Block size: 4096
    Blocks per group: 32768
    Inodes per group: 8144
    Inode size: 256
    Journal blocks: 32768
    Label: 
    Blocks: 3449600
    Block groups: 106
    Reserved block group size: 847
Created filesystem with 11/863264 inodes and 95427/3449600 blocks
sending 'userdata' (137438 KB)...
writing 'userdata'...
OKAY [ 12.575s]
erasing 'cache'...
OKAY [  0.030s]
formatting 'cache' partition...
Creating filesystem with parameters:
    Size: 587202560
    Block size: 4096
    Blocks per group: 32768
    Inodes per group: 7168
    Inode size: 256
    Journal blocks: 2240
    Label: 
    Blocks: 143360
    Block groups: 5
    Reserved block group size: 39
Created filesystem with 11/35840 inodes and 4616/143360 blocks
sending 'cache' (10984 KB)...
writing 'cache'...
OKAY [  1.043s]
rebooting...

finished. total time: 69.613s
thank you again

Looks perfect to me... Any issues after booting up?

Sent from my Nexus 4 using Tapatalk 2
 
hi guys, i got my 4.3 OTA update and installation went fine. But for the last couple of days the wifi was acting weird . And yesterday evening processes started crashing on my phone in a loop. So i shutdown my phone thinking that it might just be a system crash. But when i tried restarting my phone i got stuck on X screen. So i thought i would just flash the rom with the factory image and reset. So i found this thread and was following.

Steps i was following :

got into recovery mode.
did fastboot oem unlock -- to unlock bootloader.

fastboot erase boot
erasing 'boot'...
OKAY [ 0.390s]
finished. total time: 0.390s

astboot erase cache
******** Did you mean to fastboot format this partition?
erasing 'cache'...
OKAY [ 0.021s]
finished. total time: 0.021s

astboot erase recovery
erasing 'recovery'...
OKAY [ 0.390s]
finished. total time: 0.390s

fastboot erase system
******** Did you mean to fastboot format this partition?
erasing 'system'...
OKAY [ 0.028s]
finished. total time: 0.028s

fastboot erase userdata
******** Did you mean to fastboot format this partition?
erasing 'userdata'...
OKAY [ 1.019s]
finished. total time: 1.019s


----
So at this point everything is deleted properly.

Now i try to flash the bootloader

fastboot flash bootloader bootloader-mako-makoz20i.img
sending 'bootloader' (2201 KB)...
OKAY [ 0.073s]
writing 'bootloader'...
FAILED (remote: flash write failure)
finished. total time: 0.077s

Same for radio

astboot flash radio radio-mako-m9615a-cefwmazm-2.0.1700.84.img
sending 'radio' (54321 KB)...
OKAY [ 1.944s]
writing 'radio'...
FAILED (remote: flash write failure)
finished. total time: 1.947s

i thought maybe i don't need to flash . lets just update image. but

fastboot -w update image-occam-jwr66v.zip
archive does not contain 'boot.sig'
archive does not contain 'recovery.sig'
archive does not contain 'system.sig'
--------------------------------------------
Bootloader Version...: MAKOZ20i
Baseband Version.....: M9615A-CEFWMAZM-2.0.1700.84
Serial Number........: 0041b18ed419b776
--------------------------------------------
checking product...
OKAY [ 0.002s]
checking version-bootloader...
OKAY [ 0.002s]
checking version-baseband...
OKAY [ 0.002s]
sending 'boot' (6194 KB)...
OKAY [ 0.211s]
writing 'boot'...
FAILED (remote: flash write failure)
finished. total time: 0.228s

I have tried doing this multiple times. Its the same result always. I am guessing for some reason the rom is write locked .. Beats me why it would be like that. (This phone is unlocked,i bought it from google). I am pretty much stuck right now. Any help would be really appreciated. Thanks in advance.

cheers
bil
 
@bil what os are you using (windows, Mac..)? Try reinstalling the drivers? Using a rear usb port?

Sent from my Nexus 4 using Tapatalk 2
 
Hello, thanks for the awesome guide, it's very well explained and even for mac users :)
However, I juste want to make sure I have to follow this, so here's my situation :
I'm using a 4.2.2 nexus 4 with stock rom/kernel but with TWRP installed ( in fact, I even had franco but flashed back the stock kernel ).
So my question is : do I need to completely go back to the factory image to be able to apply OTA? I don't really care about root and twrp anymore, as long as I can get OTA in the future. I know I could flash a 4.3 zip but I want to be able to simply apply OTA updates in the future.
And if I actually need to perform this, does it also erase Helium backup data? ( I want to save my SMS and apps data ... )
Thanks a lot !
 
@2defmouse. i am doing this from Mac (OSX 10.8.4). Its actually a macbook pro so the direct usb ports in there. Stupid questions: reinstalling what driver ? for the phone ?