Tuesday 10 December 2013

How to flash stock rom on Motorola Moto G - updated

In Polish: http://motorolaforum.pl/viewtopic.php?f=128&t=3988

Hello,

in this tutorial I will show you how to install stock ROM on Motorola Moto G. It may be useful for branded devices to remove all the bloatware. Also it's good if you mess to much in your ROM and want it to work as you would remove the device from the box.



DISCLAIMER: You flash the ROM on your own risk! Remember that after the process you will lose all the data, including apps, messages and saved progress. Before installation, you may consider doing backup using Titanium Backup (available on Google Play).
P.S. You don't have to unlock the bootloader in order to successfully flash the system.



1. Download following:
a) Official Motorola drivers and install them:
https://motorola-global-portal.custhelp.com/app/answers/prod_answer_detail/a_id/97326/p/30,6720,9050/action/auth

b) Stock ROM of your choice and then extract:
http://sbf.droid-developers.org/phone.php?device=14
Remember: "ds" stands for Dual Sim so better do not install Dual Sim system on Single Sim and vice-versa

c) Motorola fastboot and extract it in place where are all ROM files. 
https://www.dropbox.com/s/qurxaln5zfya6j0/mfastboot.zip

d) ADB (I recommend light version compiled by shimp208):
https://www.dropbox.com/s/stgp6hce6r4e0iz/minimal_adb_fastboot_v1.1.3_setup.exe

2. Stock ROM installation

1) Turn on the developer mode options
Go to Settings -> About phone -> and tap 7 times"Build number"
2) Enable USB Debugging 
Settings -> Developer options-> and check USB Debugging
3) Plug in Moto G to the computer 
4) Boot Moto G into bootloader
a) Turn off the phone
b) When holding vol- press power button


5a) If your rom is in tar.gz file, run "flashall.bat" from the archieve. The phone should reboot itself after the installation is done.

Be careful when you downgrade using tar.gz file! Using notepad, you need to delete lines 89-90 in flashall.bat and 120-121 from file flashall.sh (if you have MAC/Linux).

These lines are:

89-90 in flashall.bat:
CALL :fastboot_flash partition gpt.bin
IF %errorlevel% NEQ 0 EXIT /b 1

120-120 in flashall.sh:
run $fastboot -s "$serial_number" flash partition gpt.bin
if [ $? -ne 0 ]; then echo "ERROR: fastboot failed."; exit -1; fi
 
5b) If your rom is in xml.zip file, run installed ADB program and type:

adb reboot-bootloader


6) In Windows open the folder where you have all the ROM files and fastboot.exe. There hold shift and press right click in free space. Then choose "Open Command Window Here" or open Command Prompt by holding windows logo on keyboard + R. Type cmd and hit enter. Then navigate to ROM's folder.
7) Command Prompt enter following commands one by one. Be careful to not make any mistake!
mfastboot flash partition gpt.bin
mfastboot flash motoboot motoboot.img
mfastboot flash logo logo.bin
mfastboot flash boot boot.img
mfastboot flash recovery recovery.img
mfastboot flash system system.img_sparsechunk.0
mfastboot flash system system.img_sparsechunk.1
mfastboot flash system system.img_sparsechunk.2
mfastboot flash modem NON-HLOS.bin
mfastboot erase modemst1 
mfastboot erase modemst2 
mfastboot flash fsg fsg.mbn
mfastboot erase cache 
mfastboot erase userdata 
mfastboot reboot

8) Your phone should now reboot to your freshly installed stock rom. Remember that first boot may take longer time than usual.


FAQ:
1. Does the installation of stock rom lock the previously unlocked bootloader?
No
2. Phone does not want to boot/stuck on bootanimation
Do wipe data/factory reset in stock recovery and/or flash the system once again


TAGS: Moto G, stock rom, flash, install, restore
Polish: Jak wgrać stock ROM do Motoroli Moto G

56 comments:

  1. what if i flash the single sim rom on my dual sim? Then I will Only Be Able To Use One Sim Right?

    ReplyDelete
    Replies
    1. Yes, I think it will work but only with one sim. P.S. Why won't you jsut install the "ds" - dual sim soft?

      Delete
    2. Hi, i did downgrade from lollipop to kitkat, then again again i did kitkat to lollipop, but my phone is died. its not switching ON, boot loading its not working totaly, but when i connect the in computer its detecting the port connected with something else. so is there any tools to flash the OS Without enabling bootloADER MODE.

      Delete
  2. hi i did steps above and it says failed to validate system image
    fastboot reason: fall-through from normal boot mode

    ReplyDelete
    Replies
    1. Which soft you had and which you wanted to install? The error appears on PC?

      Delete
  3. thanks for the tutorial, you revived my moto g :)))

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
  5. hello there, I have alrdy put my stock rom, AsiaRetail.en.03.. but when phone restarts it keeps showing this warning message, regarded the WARNING BOOTLOADER UNLOCKED.. How do i remove this ?

    ReplyDelete
    Replies
    1. There is fix for that. I'll do the tutorial soon :) (hope that this evening)

      Delete
  6. Replies
    1. Done :)
      http://motorola-g.blogspot.com/2014/03/how-to-remove-unlocked-bootloader.html

      Delete
  7. how to boot into boot loader??

    ReplyDelete
    Replies
    1. 4) Boot Moto G into bootloader
      a) Turn off the phone
      b) When holding vol- press power button
      5) Run installed ADB program and type:
      adb reboot-bootloader

      Delete
    2. my xt1033 is stuck in fastboot mode with low battery problem.neither i can charge my phone nor i can flash files.what should i do?

      Delete
    3. my xt1033 is stuck in fastboot mode with low battery problem.neither i can charge my phone nor i can flash files.what should i do?

      Delete
    4. my xt1033 is stuck in fastboot mode with low battery problem.neither i can charge my phone nor i can flash files.what should i do?

      Delete
  8. C:\adb\adb-tools\Compressed\falcon_asia_ds_user_4.3_14.10.0Q3.X-84-7-LCG-4_4_rel
    ease-keys-cid7-AsiaRetail_03>mfastboot flash system system.img_sparsechunk.0
    error: cannot load 'system.img_sparsechunk.0'

    i got this error:(

    ReplyDelete
    Replies
    1. What system you had, and which you are trying to install?

      Delete
    2. i am having windows 8.1....i tried to install flash rom by executing the commands you have given above...but after 3 commands on executing the 4th command this error came...

      Delete
    3. What is the file extension of the downloaded system? Do you see a flsashall.bat file? What system you had before on the phone and which version are you trying to install?

      Delete
    4. i have same problem........i have 4.4.4 and wanted to install 4.4.2.....plz help as i wanted to downgrade the kitkat coz the new 4.4.4 has decreased moto g s wifi range

      Delete
  9. i am using indian version moto g xt1033 now i want to install stock rom so which rom should i download there are many countrys given here but there is no retail indian rom in the link that you gave
    please help

    ReplyDelete
    Replies
    1. Sorry, I have no idea where you could find Indian roms. Try asking here: http://forum.xda-developers.com/moto-g/help

      Delete
    2. I had the exact same error and found that when i looked in the file downloaded the system image on line 4 should read mfastboot flash system system.img_sparsechunk1
      mfastboot flash system system.img_sparsechunk2
      mfastboot flash system system.img_sparsechunk3 if your files are the same as mine where just double click the download and then double click it once more and see if your files are as i stated above instead of .0 .1 .2 at the end if they are just change it to what i did and it worked great thanks for the help

      Delete
  10. Respect man..... You made my day....Thank you so much...:))

    ReplyDelete
  11. thanks bro it worked for me Thumbs up

    ReplyDelete
  12. I need help, It does not work :/ when I write mfastboot flash partition gpt.bin it says -bash: mfastboot: command not found. What can I do?
    I installed a ROM on my XT 1032 (DE) and it dows not work but I dont have a nandroid backup. And I am on Mac. Can someone please help me?!

    ReplyDelete
  13. I have a problem with my moto g...
    my moblile is unable to bootup
    i was trying to reinstall stock ROM, i got a error (had check failed for boot) and (had check failed for recovery)
    how can i fix this problem...
    plz i need ur help..

    ReplyDelete
  14. Yes, but you need to instal ds- dualsim software. Otherwise you won't be anle to use Sim2.

    ReplyDelete
  15. Hello thank you for this tutorial, but i am looking for rom for t-mobile carrier and i can't find it. I bought my moto g in another country, now i am home and i can't use my sim.

    ReplyDelete
    Replies
    1. T-mobile for which country? And where did you buy your phone? Is it GSM model ?

      Delete
    2. This comment has been removed by the author.

      Delete
    3. I bought my phone in Italy. Now i am in Macedonia. how can i see if is GSM model ?

      Delete
    4. Well, it has the sim slot :P you are looking for tmobile system for Macedonia? It may not exist. Anyway, the system is universal and branding doesn't change anything in basebands. You said you can't use your sim- why exactly? You can talk to me on hangouts or here ;)

      Delete
    5. When i put my sim, says put the network code. Someone told me, reflash the phone and it will work with your sim.

      Delete
  16. T-mobile for which country? And where did you buy your phone? Is it GSM model ?

    ReplyDelete
  17. @Pierre I just wanted to say thank you for this post. you really helped me restore my phone, because I had the rom before i read your post and it did not work. The bit a bout removing line 89 and 90 is what did the trick. small notice though after step 5a) that should be it for tar.gz roms. thanks again

    ReplyDelete
  18. Awesome, I got stuck in CM 11 bootloop and couldn't remember the order to flash stock img in bootloader. Thanks!

    ReplyDelete
  19. @ Pierre M. Please help! I follow your instructions to downgrade my phone to 4.3 but after I finished all the commands, the phone didn't reboot well, it keeps trying to reboot with message "warning, bootloader unlocked" (I rooted the phone before when I upgraded it from 4.4.2 to 4.4.4). Could you please give me some advices.

    ReplyDelete
  20. I have Moto G XT1032. I went through every possible thing which I have came across for restoring my phone. I can enter to AP Fastboot Flash Mode screen. Then using hardware fastboot commands will also go fine. But, after that when I enter recovery nothing happens it falls into bootloop. The recovery menu like Install from SD, wipe cache etc should show up but my mobile is not going to that menu intstead goes into rebooting loop. Please suggest some solution.

    ReplyDelete
  21. i have a moto g XT1031 that i got brand new well long story sorta short i wanted to wifi teather with it for my computer and boost wanted me to pay for it (Ya right) so i rooted my phone and did the Falcon Teather Fix and Falcon Custom Recovery Everything was going good had no problems with the phone until last month when the new update came out i woke up in the middle of the night and was not paying attention and click my phone and ended up installing the new update only to find that when i woke up my phone would boot up to the point where it said Starting Services Then after about 45 secs it freezes and repeats the process i have done everything i can think of with it now i have about 15 of work on it since i broke it i have adb drivers and lots of other tools and programs i cannot get this thing to come alive and boot up how it needs to Any Help would be Appreciated So much

    ReplyDelete
    Replies
    1. Possibly someone point me in the right direction http://sbf.droid-developers.org/phone.php?device=14 and with this i don't know which one to choose

      Delete
  22. If you have any problem with motorola then simply go and contact Motorola Repair UK

    ReplyDelete
  23. Thank you very much for sharing this type of information with us..because this is very useful for me..If you are looking for More Best Brand Repair for your Motorola Gadgets then it's better to simply go for Motorola Repair Centre Leeds

    ReplyDelete
  24. thank you so much , you made my day.

    ReplyDelete
  25. We are the fastest growing organization in the present market and providing the technical support for the customers’ computers across the globe.
    Quickbooks/ Family Tree application/Quickens/Turbo Tax not launching
    Unable to boot the computer in normal mode

    ReplyDelete
  26. I have moto g3 with marshmallow 6.0.1, automatically all photos from camera folder are deleted, now I want to get back them.I searched about this,there is only one option, root my phone and then use recovery s/w but I want my phone as newer as it was in box(like in locked bootloader state by company). So provide me the way to root-->photos recovery --> unroot and newer like box.
    Please provide me compete guide with software link.

    ReplyDelete
  27. I have moto g3 with marshmallow 6.0.1, automatically all photos from camera folder are deleted, now I want to get back them.I searched about this,there is only one option, root my phone and then use recovery s/w but I want my phone as newer as it was in box(like in locked bootloader state by company). So provide me the way to root-->photos recovery --> unroot and newer like box.
    Please provide me compete guide with software link.

    ReplyDelete
  28. www.allfreeperks.in for all guides

    ReplyDelete
  29. I forget my moto g password. And im getting erroe no command in recovery. How can i swicth on my phone?

    ReplyDelete
  30. anyone plzz help....
    while flashing gpt.bin is failed and boot.logo is too failed. otherwise everything is installed correctly. but while booting it stuck at the your bootloader is unlock screen. i dont know what to do

    ReplyDelete