[Moto G Q&A, Help & Troubleshooting] tostada:
I had 5.0.2 on my Moto G, and I unlocked/rooted it. But then the 5.1 OTA wasn't working, and it wouldn't stop harassing me to update.

I have a US Moto G XT1034 which I bought from the Motorola website. I'm on Ubuntu so I don't have the mfastboot-v2, but ADB and fastboot work fine.

So I tried to downgrade to stock 4.4.2, but it won't let me downgrade the gpt.bin or motoboot.img.

I've tried every image I can find of 5.0.2 and 5.1 and none of them work. I've tried erasing/formatting/wiping everything that can be erased/formatted/wiped. I've tried sideloading ZIPs, copying ZIPs to /sdcard and installing them there, and I've tried TWRP and ClockwordMod (several versions of each).

I have several ZIPs of 4.4, 5.0.2, and 5.1, but I only have flashable images for 4.4 and 5.1.

I had installed 5.1 by manually flashing:

sudo fastboot getvar max-sparse-size

sudo fastboot oem fb_mode_set

sudo fastboot flash partition gpt.bin

sudo fastboot flash motoboot motoboot.img

sudo fastboot flash modem NON-HLOS.bin

sudo fastboot flash fsg fsg.mbn

sudo fastboot erase modemst1

sudo fastboot erase modemst2

sudo fastboot flash logo logo.bin

sudo fastboot flash boot boot.img

sudo fastboot flash recovery recovery.img

sudo fastboot flash system system.img_sparsechunk.0

sudo fastboot flash system system.img_sparsechunk.1

sudo fastboot flash system system.img_sparsechunk.2

sudo fastboot flash system system.img_sparsechunk.3

sudo fastboot erase cache

sudo fastboot erase userdata

sudo fastboot oem fb_mode_clear

At that point it was stuck on the Android loading screen. So I did:

sudo fastboot erase userdata

sudo fastboot erase cache

sudo fastboot reboot

That's when it started bootlooping on the distressed android saying "no command". I can hold Vol Down and get into the bootloader, and I can flash a new recovery. But it always wants to boot to the recovery. I never get into Android.

I flashed twrp-2.8.7.0-falcon_STOCK.img

Did a wipe.

It said there was no OS installed.

I installed:

XT1034_Retail_US_AWS_51_Untouched.zip

Didn't boot. Just kept going to TWRP.

Trying to wipe, it said /system wasn't mounted.

Mounted it, Fixed permissions, Re-installed 5.1.

Didn't work.

I tried clockwork-6.0.4.7-falcon.img.

Formatted /data /system /cache.

Installed ZIP for 5.1.

Didn't work.

Tried manually mounting /system, /data, /cache, /fsg, /firmware, /persist, /modem. Rebooted. But /cache was the only thing showing up as mounted.

Went to the bootloader and did:

sudo fastboot oem fb_mode_clear

Still booting to recovery.

Formatted everything again. Formatted /system, /data, /data/media.

Installed ZIP from sideload in ClockworkMod:

sudo adb sideload XT1034_AWS_Retail_US_51_Optimized_v1.0.zip

Didn't work.

sudo adb sideload XT1034_Retail_US_AWS_51_Untouched.zip

* failed to write data 'protocol fault (status len)' *

Switch to TWRP:

sudo fastboot flash recovery twrp-2.6.3.0-falcon_umts.img

sudo adb kill-server

sudo adb usb

sudo adb push XT1034_Retail_US_AWS_51_Untouched.zip /sdcard

Install

But it still says:

E:Unable to mount '/system'

Wipe Cache & Dalvik.

Reboot ... took me to recovery.

Install XT1034_Retail_US_AWS_51_Untouched.zip AGAIN

...this time it didn't say E:Unable to mount '/system'.

Says script succeeded.

Reboot ... took me to recovery.

So everything installed OK, no errors, but we're still rebooting to recovery.

Factory Reset.

Reboot ... took me to recovery.

Try a different Clockwork.

sudo fastboot flash recovery recovery-clockwork-6.0.4.7-falcon.img

format /mount /system

adb push Blur_Version.220.41.36.falcon_umts.AWSRetail.en.US.zip /sdcard

didn't show up in /sdcard

sudo adb start-server

sudo adb sideload Blur_Version.220.41.36.falcon_umts.AWSRetail.en.US.zip

...package expects build fingerprint of

motorola/falcon_retuaws/falcon_umts:5.0.2/LXB22.99-36/19:user/release-keys

or

motorola/falcon_retuaws/falcon_umts:5.1/LPB23.13-58/61:user/release-keys

this device has

motorola/falcon_retuaws/falcon_umts:4.4.2/KXB20.9-

So that seemed crazy, that it was saying I had 4.4.2 when I'd installed a million images of 5.0 and 5.1.

reboot to bootloader, install XT1034_FALCON_RETUAWS_5.1

sudo fastboot getvar max-sparse-size

sudo fastboot oem fb_mode_set

sudo fastboot flash partition gpt.bin

sudo fastboot flash motoboot motoboot.img

sudo fastboot flash modem NON-HLOS.bin

sudo fastboot flash fsg fsg.mbn

sudo fastboot erase modemst1

sudo fastboot erase modemst2

sudo fastboot flash logo logo.bin

sudo fastboot flash boot boot.img

(didn't re-flash the recovery)

sudo fastboot flash system system.img_sparsechunk.0

sudo fastboot flash system system.img_sparsechunk.1

sudo fastboot flash system system.img_sparsechunk.2

sudo fastboot flash system system.img_sparsechunk.3

sudo fastboot erase cache

sudo fastboot erase userdata

sudo fastboot oem fb_mode_clear

reboot (normal powerup) ... took me to recovery.

Try installing with sideload...

sudo adb sideload Blur_Version.220.41.36.falcon_umts.AWSRetail.en.US.zip

error - package expects build fingerprint ...

Flash the 5.1 recovery:

sudo fastboot flash recovery recovery.img

sudo fastboot erase cache

sudo fastboot erase userdata

sudo fastboot oem fb_mode_clear

boot loops on "no command" with the sad android...

Get into the bootloader again.

sudo fastboot -w update Blur_Version.220.41.36.falcon_umts.AWSRetail.en.US.zip

error: update package has no android-info.txt or android-product.txt

sudo fastboot -w update XT1034_Retail_US_AWS_51_Untouched.zip

error: update package has no android-info.txt or android-product.txt

So I gave up on 5.1. But I don't have a flashable 5.0.2, and I can't flash 4.4.

So all I have left to try is 5.0 ZIPs.

Flash ClockworkMod 6.0.4.7.

Reboot into recovery.

ClockworkMod complained that a lot of stuff wasn't mounted.

Wipe data/factory reset. Reboot.

The not mounted errors went away.

Install ZIP from sideload.

sudo adb sideload XT1034_AWS_Retail_US_502_Stock_Untouched.zip

* failed to write data 'protocol fault (status len)' *

I guess the bigger Untouched one is too big to sideload... Try the other one...

sudo adb sideload XT1034_AWS_Retail_US_502_Optimized_v1.3.zip

Installing update...

>>> XT1034 AWS Retail US 5.0.2 Stock Rom (Optimized) v1.3 <<<

Everything said it was successful, but it just booted back into Recovery.

Wipe data/factory reset.

Error mounting /data!

E: unknown volume for path [/sd-ext]

Error mounting /sdcard/.android_secure!

Went to Mounts and Storage Menu

format /data and /data/media (/sdcard)

Reboot.

Wipe data/factory reset.

Reboot.

Try installing again from sideload.

sudo adb sideload XT1034_AWS_Retail_US_502_Optimized_v1.3.zip

Installing update...

>>> XT1034 AWS Retail US 5.0.2 Stock Rom (Optimized) v1.3 <<<

symlink: no of symlinks failed = 1

Installation aborted.

OK, I'll try installing the ZIP normally.

sudo adb kill-server

sudo adb usb

sudo adb push XT1034_AWS_Retail_US_502_Stock_Untouched.zip /sdcard

Install ZIP.

Choose ZIP from /sdcard.

Couldn't open directory.

No files found.

Reboot to bootloader.

Giving up on ClockworkMod ... trying TWRP

sudo fastboot flash recovery twrp-2.8.6.0-xt1032.img

reboot to TeamWin Recovery 2.8.6.

Wipe.

Unable to mount /system.

Format.

unknown mtp message type 1

Reboot to bootloader.

sudo fastboot flash recovery twrp-2.6.3.0-falcon_umts.img

reboot to TeamWin Recovery 2.6.3.

Wipe.

Unable to mount /system.

Format.

Unable to mount /system.

Advanced Wipe, wipe System.

Regular Wipe seems successful now.

Reboot to recovery.

Wipe is successful.

Mount System.

Wipe.

Reboot.

System is not mounted.

sudo adb push XT1034_AWS_Retail_US_502_Stock_Untouched.zip /sdcard

ZIP is now in /sdcard.

Install ZIP.

>>> XT1034 AWS Retail US 5.0.2 Stock ROM (Untouched) <<<

Successful.

Wipe cache/dalvik.

Reboot System.

Boots to recovery.

Power Off.

Does not power off. Boots to recovery.

Factory Reset.

Reboot to System.

Reboots to Recovery.

That's all it over does.