Help needed, installing stock firmware on a LG / Google Nexus 5X (bullhead)”

$ fastboot erase userdata
******** Did you mean to fastboot format this ext4 partition?
Erasing ‘userdata’ OKAY [ 0.551s]
Finished. Total time: 0.575s
cate@cate-1011PX:~/Downloads/Bull/bullhead-opm7.181205.001-factory-5f189d84/bullhead-opm7.181205.001$ fastboot reboot recovery
Rebooting into recovery OKAY [ 0.009s]
Finished. Total time: 0.060s

it did send the phone on its loop

Yes, that is the sort of thing that I know we can do from adb but not as I know yet how to do from fastboot. Hence @piero and I both keen just to have it in recovery.

However you have just confirmed that you can do

$ fastboot erase userdata
******** Did you mean to fastboot format this ext4 partition?
Erasing ‘userdata’ OKAY [ 0.551s]
Finished. Total time: 0.575s

which was what we wanted.

Perhaps one more

./flash-all.sh

This will be the modified script without the -w

(where -w = Wipe, and this form of wipe had been problematic each time.)

This time l got the erasing circle again… then android booting for a moment, that one l recognise from my tv, then black screen battery and off…

$ ./flash-all.sh
< waiting for any device >
Sending 'bootloader' (4610 KB)                     OKAY [  0.279s]
Writing 'bootloader'                               OKAY [  0.291s]
Finished. Total time: 0.684s
Rebooting into bootloader                          OKAY [  0.007s]
Finished. Total time: 0.058s
< waiting for any device >
Sending 'radio' (56630 KB)                         OKAY [  2.737s]
Writing 'radio'                                    OKAY [  0.673s]
Finished. Total time: 3.721s
Rebooting into bootloader                          OKAY [  0.004s]
Finished. Total time: 0.054s
< waiting for any device >
--------------------------------------------
Bootloader Version...: BHZ32c
Baseband Version.....: M8994F-2.6.42.5.03
Serial Number........: 0271e789ba5bb3a3
--------------------------------------------
extracting android-info.txt (0 MB) to RAM...
Checking 'product'                                 OKAY [  0.014s]
Checking 'version-bootloader'                      OKAY [  0.015s]
Checking 'version-baseband'                        OKAY [  0.013s]
extracting boot.img (11 MB) to disk... took 0.218s
archive does not contain 'boot.sig'
Sending 'boot' (11781 KB)                          OKAY [  0.640s]
Writing 'boot'                                     OKAY [  0.151s]
archive does not contain 'dtbo.img'
archive does not contain 'dt.img'
extracting recovery.img (17 MB) to disk... took 0.298s
archive does not contain 'recovery.sig'
Sending 'recovery' (17425 KB)                      OKAY [  0.881s]
Writing 'recovery'                                 OKAY [  0.273s]
archive does not contain 'vbmeta.img'
archive does not contain 'vbmeta_system.img'
archive does not contain 'super_empty.img'
archive does not contain 'odm.img'
archive does not contain 'product.img'
archive does not contain 'product_services.img'
extracting system.img (1909 MB) to disk... took 52.500s
archive does not contain 'system.sig'
Sending sparse 'system' 1/4 (508768 KB)            OKAY [ 26.897s]
Writing 'system'                                   OKAY [  6.661s]
Sending sparse 'system' 2/4 (524238 KB)            OKAY [ 27.506s]
Writing 'system'                                   OKAY [  6.469s]
Sending sparse 'system' 3/4 (501061 KB)            OKAY [ 26.691s]
Writing 'system'                                   OKAY [  6.604s]
Sending sparse 'system' 4/4 (421469 KB)            OKAY [ 22.037s]
Writing 'system'                                   OKAY [  4.726s]
extracting vendor.img (185 MB) to disk... took 5.189s
archive does not contain 'vendor.sig'
Sending 'vendor' (190332 KB)                       OKAY [  9.140s]
Writing 'vendor'                                   OKAY [  2.730s]
Rebooting                                          OKAY [  0.011s]
Finished. Total time: 201.654s

This seems as clean as we can get for now, I think.

Maybe we should pack it in for now and see if anyone comes up with another way of looking at it. I do think you have made some useful progress even if no resolution right now.

1 Like

yes l do see an improvement and l thank you for that…
For now let’s wait and see…
Goodnight then😉

1 Like

Good morning @Catrine as it has come up in one or two threads I wonder how much RAM your laptop has? Please can you show the output of

free -m

(Whenever doing an awkward flashing job I close all windows especially Browser leaving only Terminal running.)

A proposal

I think an ideal thing to do is something like outlined in How I fixed my bricked Nexus 5 (corrupted userdata, bootlooping) which, @Catrine, you linked in Post #141 . This would require booting to a stable recovery then using parted through adb shell. The OP there also includes a useful list of threads on the subject to which I would add Resurrecting a bootlooped Nexus 5X | tony is coding.

Simplified proposal

Loosely speaking just describing the idea before we start … maybe a graphical way to do this is to "fastboot boot twrp-recovery.img (this way TWRP will be on the fly not flashed to the phone). Then we would try to use the graphical tools in TWRP to do How to fix unable to mount data. We would aim to

  • Repair userdata file system … by
  • convert filesystem to Ext2 … then
  • change back to Ext4.

Before I provide a link, @piero, @Xxpsilon have you a view on best TWRP version to use. I would be inclined to pick twrp-3.2.3-0-bullhead.img the

top of this list
twrp-3.2.3-0-bullhead.img	15.9M	2018-07-29 05:58:59 UTC
twrp-3.2.2-0-bullhead.img	16.1M	2018-06-30 05:17:02 UTC
twrp-3.2.1-0-bullhead.img	16.1M	2017-12-09 02:42:38 UTC

twrp-3.1.1-0-bullhead.img	16M		2017-05-17 03:59:36 UTC
twrp-3.1.0-0-bullhead.img	16.1M	2017-03-08 07:28:30 UTC

twrp-3.0.2-2-bullhead.img	16M		2016-09-02 02:41:57 UTC
twrp-3.0.2-1-bullhead.img	16M		2016-08-22 21:23:26 UTC
twrp-3.0.2-0-bullhead.img	16.1M	2016-04-05 14:39:13 UTC
twrp-3.0.1-0-bullhead.img	16M		2016-03-31 21:29:25 UTC
twrp-3.0.0-1-bullhead.img	16M		2016-03-11 04:08:36 UTC
twrp-3.0.0-0-bullhead.img	16M		2016-02-06 14:27:26 UTC

Even if we get it wrong first time @Catrine we would aim to look for the twrp.log of the attempted boot before we make any intervention.

To recap on the ROM in use
bullhead-opm7.181205.001-factory-5f189d84.zip
         |     |
         Oreo  |
              2018 December

The contained images available are limited to

bootloader-bullhead-bhz32c.img
radio-bullhead-m8994f-2.6.42.5.03.img
boot.img
recovery.img
system.img
vendor.img

The Contents ofandroid-info.txt reads

require board=bullhead
require version-bootloader=BHZ32c
require version-baseband=M8994F-2.6.42.5.03

Anyone see a better way forward ?


This seems rather high risk

In the image in Post #115 the phone itself suggests to Lock the bootloader. The merit here would be that on unlock the phone itself would format userdata rather than fastboot. I would hesitate to do this, but the suggestion is coming from stock ROM and this “unusual switch” may have been included to allow a user friendly method to recover from a “known weakness” in the device (??)

It seems unlikely to me, or is this a fairly standard thing, … to see advice to lock the bootloader when the device “knows” that it is corrupted (??)

1 Like

Good Morning !

$ free -m
total used free shared buff/cache available
Mem: 1958 906 85 75 966 823
Swap: 6053 498 5555

Thanks, we may need to bear this in mind as more than one thread I have seen mentions the possibility that the contents of the flash-all.sh cannot be held in memory of 2G (as you have). The work around is to flash individual partitions one by one. However I think the flash-all.sh is acceptable … till we learn different.

I don’t recommend this right now. Maybe we come back to it … similar any work with TWRP I do not think I can manage right now.

What about this one ?
I can borrow it in the evenings…

Maybe useful … but let’s stick to the working directory you are familiar with for the next run.

Here is what we expect to see in TWRP

The “Home” position (the back button should get you back here if lost).

At the first run of TWRP, try to test the button marked “Press for log” to check if a log is available.


Please Select Wipe (from top image) → Advanced Wipe → Select the Data partition → Repair or Change File System → Swipe to Execute.

Please Select (similar to ) “Change filesystem”. (Not shown in images).

Select exFAT or tell us what is available, it is not critical.

Swipe from the left to the right to execute.

Carefully get back to
Please Select (similar to ) “Change filesystem”.

Select ext4
Swipe from the left to the right to execute.

Check the log again, can you get a photo, if in any doubt it was successful.


Reboot is found from the "Home" position -> leads to options shown in final image.

I think this phone has no SD card (??) If there is an SD card then Power + Volume UP from TWRP will probably save a screenshot to SD card. (Obviously of little use to us if it saves to device!)

The source of TWRP is LG Nexus 5X.

I suggest you download the file from this link into your working directory Bull

Yes l have used twrp on other device although blue but who cares and succesfully installed Lineage
But never on this Nexus

No SD in the phone

I just thought I would put this up here but I have chores to get on with during daylight, so sorry to disappear again !

1 Like

Meanwhile l did what U asked

so what is the result ?

Nothing yet l dunno the command line to install twrp on the phone…

…of course you do :

I am getting this

$ fastboot flash recovery /home/cate/Downloads/Bull/twrp-3.2.3-0-bullhead.img
Sending ‘recovery’ (16289 KB) OKAY [ 0.853s]
Writing ‘recovery’ OKAY [ 0.172s]
Finished. Total time: 1.135s

Hi @Catrine, just got home this second, glad I did not miss the big event !

1 Like

That is great – Swipe to allow modification.

1 Like