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

Mods [Guide]How to flash a Nexus Factory Image manually.

Hello again!

@Brian706, using adb sideload to flash an image and update the phone is a great idea. However, it also doesn't work.


I am using a different USB cable, the original LG, hardly any use ever.

The output in the command line is the following:

-----------------------------------------
C:\Users\tedka\Desktop\Minimal ADB and Fastboot>fastboot devices
0745212c0063a116 fastboot

C:\Users\tedka\Desktop\Minimal ADB and Fastboot>adb sideload hammerhead-ota-mob30m.zip
loading: 'hammerhead-ota-mob30m.zip'* daemon not running. starting it now on port 5037 *
* daemon started successfully *
Total xfer: 0.00x

-----------------------------------------

The whole process takes about two seconds, with a filesize of 561 MB.
On the phone screen, I get the following:

-----------------------------------------
Supported API: 3
E: failed to mount /cache (Invalid argument)

Now send the package you want to apply
to the device with "adb sideload <filename>"...

E: failed to mount /cache (Invalid argument)
E: failed to mount /cache
E: failed to set up expected mounts for install; aborting
Installation aborted.
E: failed to mount /cache (Invalid argument)
E: failed to mount /cache (Invalid argument)
E: failed to mount /cache (Invalid argument)
E:Can't mount /cache/recovery/log
E:Can't open /cache/recovery/log
E: failed to mount /cache (Invalid argument)
E:Can't mount /cache/recovery/last_log
E:Can't open /cache/recovery/last_log
E: failed to mount /cache (Invalid argument)
E:Can't mount /cache/recovery/last_install
E:Can't open /cache/recovery/last_install
E: failed to mount /cache (Invalid argument)
E:Can't mount /cache/recovery/log
E:Can't open /cache/recovery/log
E: failed to mount /cache (Invalid argument)
E:Can't mount /cache/recovery/last_log
E:Can't open /cache/recovery/last_log
E: failed to mount /cache (Invalid argument)
E:Can't mount /cache/recovery/last_install
E:Can't open /cache/recovery/last_install
E: failed to mount /cache (Invalid argument)

-----------------------------------------

The first two lines (Supported API: 3 E: failed to mount /cache (Invalid argument)) are there since the moment I enter into Android Recovery.

As to flashing the .IMG files directly via fastboot, this is what I get:

-----------------------------------------
C:\Users\tedka\Desktop\Minimal ADB and Fastboot>fastboot devices
0745212c0063a116 fastboot

C:\Users\tedka\Desktop\Minimal ADB and Fastboot>fastboot oem unlock
...
OKAY [ 6.085s]
finished. total time: 6.160s

C:\Users\tedka\Desktop\Minimal ADB and Fastboot>fastboot oem unlock
...
FAILED (remote: Already Unlocked)
finished. total time: 0.000s

C:\Users\tedka\Desktop\Minimal ADB and Fastboot>fastboot flash bootloader bootloader-hammerhead-hhz20f.img
target reported max download size of 1073741824 bytes
sending 'bootloader' (3120 KB)...
OKAY [ 0.239s]
writing 'bootloader'...
FAILED (remote: flash write failure)
finished. total time: 0.449s

C:\Users\tedka\Desktop\Minimal ADB and Fastboot>fastboot flash recovery recovery.img
target reported max download size of 1073741824 bytes
sending 'recovery' (10004 KB)...
OKAY [ 0.504s]
writing 'recovery'...
FAILED (remote: flash write failure)
finished. total time: 0.696s

C:\Users\tedka\Desktop\Minimal ADB and Fastboot>fastboot flash boot boot.img
target reported max download size of 1073741824 bytes
sending 'boot' (9146 KB)...
OKAY [ 0.484s]
writing 'boot'...
FAILED (remote: flash write failure)
finished. total time: 0.671s

C:\Users\tedka\Desktop\Minimal ADB and Fastboot>fastboot flash cache cache.img
target reported max download size of 1073741824 bytes
erasing 'cache'...
FAILED (remote: failed to erase partition)
finished. total time: 0.130s

C:\Users\tedka\Desktop\Minimal ADB and Fastboot>fastboot flash userdata userdata
.img
target reported max download size of 1073741824 bytes
erasing 'userdata'...
FAILED (remote: failed to erase partition)
finished. total time: 0.179s

C:\Users\tedka\Desktop\Minimal ADB and Fastboot>fastboot flash system system.img

target reported max download size of 1073741824 bytes
erasing 'system'...
FAILED (remote: failed to erase partition)
finished. total time: 0.125s




C:\Users\tedka\Desktop\Minimal ADB and Fastboot>fastboot erase cache
******** Did you mean to fastboot format this ext4 partition?
erasing 'cache'...
FAILED (remote: failed to erase partition)
finished. total time: 0.218s



C:\Users\tedka\Desktop\Minimal ADB and Fastboot>fastboot format cache
Creating filesystem with parameters:
Size: 734003200
Block size: 4096
Blocks per group: 32768
Inodes per group: 7472
Inode size: 256
Journal blocks: 2800
Label:
Blocks: 179200
Block groups: 6
Reserved block group size: 47
Created filesystem with 11/44832 inodes and 5813/179200 blocks
target reported max download size of 1073741824 bytes
erasing 'cache'...
FAILED (remote: failed to erase partition)
finished. total time: 0.172s

-----------------------------------------

It is a pity that I did not take screenshots or copy the command line output the first time, when the erase commands return success one after the other. Now not only am I unable to push or pull files to/from the phone, but it also seems like I cannot erase or format anything either.

Any clues?
 
  • Like
Reactions: scary alien
Upvote 0
Only two other things I can think of just to cross them off the list:

1. Are you using a USB 2.0 port? I've had troubles in the past using a 3.0 port for fastboot activities in the past (long shot here, I know...)

2. Did you verify the MD5 or SHA1 sum of the hammerhead-ota-mob30m-1af36a17.zip file?

Here's the SHA256 sum listed on the OTA download page:

1af36a1788360dbae08f3dd9fce905f65ca0942078acafc807600910e066ea5c

and here are the SHA1 and MD5 sums which might be easier to obtain:

C:\Users\Scary Alien\Downloads>dir *mob30m*
Volume in drive C has no label.
Volume Serial Number is 843C-52A5

Directory of C:\Users\Scary Alien\Downloads

06/19/2016 08:53 PM 588,613,009 hammerhead-ota-mob30m-1af36a17.zip
1 File(s) 588,613,009 bytes
0 Dir(s) 254,002,094,080 bytes free

C:\Users\Scary Alien\Downloads>sha1sum hammer*mob30m*
30858e097a2455c09cf47f5ecb4a3e9563f244f9 *hammerhead-ota-mob30m-1af36a17.zip

C:\Users\Scary Alien\Downloads>md5sum hammer*mob30m*
4a47e5ce77a388dc9bb0ad826f81d81d *hammerhead-ota-mob30m-1af36a17.zip

C:\Users\Scary Alien\Downloads>​

Still thinking about this...
 
Upvote 0
I am using a USB 2.0 port. Tried three different cables already, and somehow still have a feeling that there might be something there.

SHA256 checksum from the Google OTA web:

6.0.1 (MOB30M) Link 1af36a1788360dbae08f3dd9fce905f65ca0942078acafc807600910e066ea5c

Checksums on my PC:

CRC32: F5DF1DCD
MD5: 4A47E5CE77A388DC9BB0AD826F81D81D
SHA-1: 30858E097A2455C09CF47F5ECB4A3E9563F244F9
SHA-256: 1AF36A1788360DBAE08F3DD9FCE905F65CA0942078ACAFC807600910E066EA5C

The SHA256, SHA1 and MD5 checksums match (used HashTab v5.2.0).

Just tried to sideload it again, full archive name this time, same output on the command line and on the phone display as in my previous post.


---------------------------------------------------------------
C:\Users\tedka\Desktop\Minimal ADB and Fastboot>adb devices
List of devices attached
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
0745212c0063a116 sideload


C:\Users\tedka\Desktop\Minimal ADB and Fastboot>adb sideload hammerhead-ota-mob30m-1af36a17.zip
Total xfer: 0.00x
---------------------------------------------------------------

I also did a battery pull just in case. The issue remains.

By the way, what does this line say to you?

E: failed to mount /cache (Invalid argument)

It shows when I do a /data wipe (data wipe seems to be successful, but it also tries to format /cache and all the errors start showing).

---Data Wipe---------------------------------------------------------------
-- Wiping data...
Formatting /data...

E:failed to mount /cache (Invalid argument)
Formatting /cache...
E: failed to mount /cache (Invalid argument)
E:Can't mount /cache/recovery/log
E:Can't open /cache/recovery/log
E: failed to mount /cache (Invalid argument)
E:Can't mount /cache/recovery/last_log
E:Can't open /cache/recovery/last_log
E: failed to mount /cache (Invalid argument)
E:Can't mount /cache/recovery/last_install
E:Can't open /cache/recovery/last_install
E: failed to mount /cache (Invalid argument)

Data wipe complete.
E: failed to mount /cache (Invalid argument)
E:Can't mount /cache/recovery/log
E:Can't open /cache/recovery/log
E: failed to mount /cache (Invalid argument)
E:Can't mount /cache/recovery/last_log
E:Can't open /cache/recovery/last_log
E: failed to mount /cache (Invalid argument)
E:Can't mount /cache/recovery/last_install
E:Can't open /cache/recovery/last_install
E: failed to mount /cache (Invalid argument)

-------------------------------------------------------------------



When trying to mount /system, same thing.

---System mount----------------------------------------------------------------
Mounted /system
E: failed to mount /cache (Invalid argument)
E:Can't mount /cache/recovery/log
E:Can't open /cache/recovery/log
E: failed to mount /cache (Invalid argument)
E:Can't mount /cache/recovery/last_log
E:Can't open /cache/recovery/last_log
E: failed to mount /cache (Invalid argument)
E:Can't mount /cache/recovery/last_install
E:Can't open /cache/recovery/last_install
E: failed to mount /cache (Invalid argument)
-------------------------------------------------------------------



If I choose "Apply update from SD card":

---Update from SD card----------------------------------------------------------------
-- Couldn't mount /sdcard.
Installation aborted.
E: failed to mount /cache (Invalid argument)
E:Can't mount /cache/recovery/log
E:Can't open /cache/recovery/log
E: failed to mount /cache (Invalid argument)
E:Can't mount /cache/recovery/last_log
E:Can't open /cache/recovery/last_log
E: failed to mount /cache (Invalid argument)
E:Can't mount /cache/recovery/last_install
E:Can't open /cache/recovery/last_install
E: failed to mount /cache (Invalid argument)
E:Can't mount /cache/recovery/log
E:Can't open /cache/recovery/log
E: failed to mount /cache (Invalid argument)
E:Can't mount /cache/recovery/last_log
E:Can't open /cache/recovery/last_log
E: failed to mount /cache (Invalid argument)
E:Can't mount /cache/recovery/last_install
E:Can't open /cache/recovery/last_install
E: failed to mount /cache (Invalid argument)
-------------------------------------------------------------------


The E:failed to mount /cache (Invalid argument) appears on the bottom of the screen as soon as the phone enters in the Android Recovery menu. Seems like the partitions on the phone are messed up?

Smells like an eMMC problem? Something could've fried? After all, the phone did just shut off while reading a newspaper and that's where all the problems started. Actually unsure if there was an update going on meanwhile.

Now to the crazy ideas section:

1. The phone is currently without a SIM. May putting in a SIM card change anything?
2. I'm not an advanced user of Ubuntu Linux, but might there be any difference in the way ADB or Fastboot pushes the file to the phone? Or is it possible to check and repair the partitions?
3. Is it realistic to complain to Google about all this?

And by the way, I'd like to thank you all for taking your time. It is quite reassuring for someone messing on their own with this. :)

Regards,
Ted.
 
Upvote 0
Hey Ted, no worries--that's what we're here for :).

I am beginning to suspect there's an eMMC issue with your device--we saw a lot of similar issues with the 1st gen / 2012 Nexus 7 tablet where re-flashing like this failed despite numerous tries in different ways.

1. I don't think the absence or presence of a SIM card would make any difference--I can't believe it's being checked/looked-for in any of the flashing operations.

2. The adb/fastboot code would be identical, compiler targets and USB drivers notwithstanding between the different platforms. You could rule-out any USB port or driver issues by trying to access your device from a Linux PC, but I'm not confident or hopeful re. that, unfortunately :(.

3. I'm not sure about this...it wouldn't hurt to try to contacting them and say that despite best efforts, you can't resurrect your device via the public and proscribed recovery methods.
 
  • Like
Reactions: Brian706 and tedka
Upvote 0
^^^ What he said. 1 & 2. The cable and the port are much more likely to be causing problems than the OS.

As far as three, an out-of-warranty hardware failure is really just bad luck. While I wouldn't dissuade you from making a complaint, I would be surprised if anything but a boilerplate platitude was forthcoming.
 
  • Like
Reactions: Brian706 and tedka
Upvote 0
Hey Albert, welcome to our AndroidForums :).

Is the bootloader-hammerhead-hhz20g.img file in the local directory that you're currently focused in (i.e., the you cd'd to)?

For example if you do a "dir bootloader-hammerhead-hhz20g.img" does it show the file attributes?

I'm thinking that you're just not cd'd into the folder that contains the bootloader-hammerhead-hhz20g.img file...

Can you paste a screenshot of what your doing and the output of just a "dir" command?

Thanks!
 
  • Like
Reactions: Brian706
Upvote 0
It looks like you need extract the contents of the image-hammerhead-mob30p.zip file (the one that says "Compressed (zipped)") into the same folder that your fastboot utility lives--it can't find those files because they're not in there.

Or conversely, move the fastboot utility to the folder where you extracted the contents of the image-hammerhead-mob30p.zip file.

The various .img files that you're going to flash with fastboot are in the image-hammerhead-mob30p.zip file and need to be pulled-out / extracted from there so that fastboot can see/flash them.

Does that make sense?

[edit: doh! this wasn't necessary...not sure what I was thinking :p--sorry!]
 
Last edited:
  • Like
Reactions: Brian706
Upvote 0
Okay, lemme back up here a second...

I led you astray with extracting the contents of the image-hammerhead-mob30p.zip file--you don't need those individual files like I thought (I haven't had any caffeine yet this morning--my apologies :p :oops:).

In the first image you posted, it looks like you tried various "fastboot flash bootloader..." commands, trying to reference the bootloader-hammerhead-hhz20g.img file, but either the file was misspelled (missing the .img suffix, etc.) or the file wasn't present in the same folder where the fastboot utility lives.

The second image you posted shows that the bootloader-hammerhead-hhz20g.img file does exist in the same folder as the fastboot command, so a "fastboot flash bootloader bootloader-hammerhead-hhz20g.img" should have worked for you at that time...so that's a little confusing to me...

In the third image, the bootloader-hammerhead-hhz20g.img is no longer present--what happened to that file?

The files that you really need in the same folder as the fastboot utility are the files referenced in the flash-all.bat file:

fastboot flash bootloader bootloader-hammerhead-hhz20g.img
fastboot reboot-bootloader
ping -n 5 127.0.0.1 >nul
fastboot flash radio radio-hammerhead-m8974a-2.0.50.2.29.img
fastboot reboot-bootloader
ping -n 5 127.0.0.1 >nul
fastboot -w update image-hammerhead-mob30p.zip

So, you just need the three file listed above, which should match what you had in the first image you posted.

Then, you should be able to copy and paste exactly those commands, in order and things should work.

Sorry for all of the confusion on my end, too :(.
 
  • Like
Reactions: Brian706
Upvote 0
I tried all those things because I read somewhere that renaming it might have helped, but it didn't.
For the third image, the file was still in the original folder, I just screenshotted a different folder.
Everything looks identical to my first image posted, but when I enter the commands it still doesn't work, but when I run the actual flash.all.bat, I get a slightly different response. Instead of "error cannot load bootloader", It seems to work, but then it says "Failed <Remote not supported in locked device>.
http://imgur.com/JDescmn
 
Upvote 0
Ah, that's a bit of progress :)...

I don't see the "Failed <Remote not supported in locked device>" in that most recent screenshot, though...

I do see

checking version-bootloader...
FAILED

Device version-bootloader is 'HHZ12k'.
Update requires 'HHz20g'.

which tells me that the bootloader didn't flash (is that where you saw the "Failed <Remote not supported in locked device>" message?)

Is your bootloader unlocked?
 
  • Like
Reactions: Brian706
Upvote 0
Also, can you do a "fastboot getvar all" command, please?

It should look something like this:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\Scary Alien>fastboot getvar all
(bootloader) max-download-size: 0x40000000
(bootloader) version-hardware: rev_11
(bootloader) version-baseband: M8974A-2.0.50.2.28
(bootloader) version-bootloader: HHZ12k
(bootloader) version-cdma: N/A
(bootloader) variant: hammerhead D820(E) 16GB
(bootloader) serialno: xxxxxxxxxxxxxxxxx
(bootloader) carrier: None
(bootloader) secure-boot: yes
(bootloader) unlocked: yes
(bootloader) product: hammerhead
(bootloader) partition-size:aboot: 80000
(bootloader) partition-type:aboot: emmc
(bootloader) partition-size:boot: 1600000
(bootloader) partition-type:boot: emmc
(bootloader) partition-size:recovery: 1600000
(bootloader) partition-type:recovery: emmc
(bootloader) partition-size:system: 40000000
(bootloader) partition-type:system: ext4
(bootloader) partition-size:userdata: 3321fa800
(bootloader) partition-type:userdata: ext4
(bootloader) partition-size:cache: 2bc00000
(bootloader) partition-type:cache: ext4
(bootloader) partition-size:persist: 1000000
(bootloader) partition-type:persist: ext4
all:
finished. total time: 0.045s

C:\Users\Scary Alien>​
 
  • Like
Reactions: Brian706
Upvote 0
http://imgur.com/NDDqeZT it appears that the bootloader is locked

:(

...and a "fastboot oem unlock" says/shows successful or not?

Try that again and then do the "fastboot getvar unlocked" command to show what the unlock status is afterwards.

Does your device still boot-up normally? If so, you could try sideloading (via adb) the most current block OTA on your device, using the instructions in this page:


and using this file:


that should amount to the same as flashing a factory image (same/most recent version).
 
  • Like
Reactions: Brian706
Upvote 0
Yes it says it's unlocked now. By booting it up, do you mean fully booting it up to the passcode screen? Or just to the fastboot menu? Regardless of the answer, will it mess up my device? It says that if you disconnect or mess with it then the device will be hard bricked.

Ah, if it truly is unlocked (and stays unlocked--that's been a weird artifact for some when they try to do the subsequent flashing steps that you are/were), then you should be able to proceed with the fastboot commands as listed in post #215 above.

Regarding the booting up thing, I meant booting-up in normal Android so you could make sure that USB debugging had been enabled so you could use fastboot and do the adb sideloading if need be...
 
Upvote 0
Unfortunately I don't think it would boot up. My device was stuck in a bootloop around the four spinning dots with the android logo, so I thought that I would resset it to factory settings.

I then tried to do the commands again, and it still says "error cannot load bootloader-hammerhead-hhz20g"
After that, I ran the flash.all.bat file, and it says something different as an error, but then once it continues for the radio file, my phone bootloader goes back into the locked state.
 

Attachments

  • bbbbbbbbbbbbb.PNG
    bbbbbbbbbbbbb.PNG
    33.4 KB · Views: 438
  • Like
Reactions: scary alien
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