Moto G (unable to erase user data)

The whole problem started when I loaded a different theme in CM13.
And while restoring theme, my phone started giving error "System UI has stopped working", I tried 'factory reset' and all other attempts but nothing helped. Even I tried all recovery images like CWM, CWM_touch, teamRecovery, Philz, but none of them could recover it.
Even I tried 'mfastboot erase userdata' and it also failed :(

So, I did following:

a. Loaded stock ROM
see: http://forum.xda-developers.com/showthread.php?t=2542219

b. Booted successfully

c. Loaded CM13

d. Loaded gapp

That's it.

Edit1: Additional info

Phone model: XT1033 (falcon)
Tools: ADB, MotoG drivers, mfastboot-v2, ASIARETAIL_XT1033_5.0.2_LXB22.46-28_cid7_CFC.xml.zip, CM13 nightly build, open_gapps-arm-6.0-micro-20160124.zip, twrp-2.8.6.0-xt1032.img, philz_touch_6.58.7-falcon.img

Prerequisites: Install ADB and fastboot drivers and tools for OS.

Steps:
1. Put phone in fastboot mode
a. Power down phone
b. Press and hold volume down key
c. Press and hold power button
d. Release power button
e. If you see fastboot menu, release volume down key
f. If you do not see any menu, repeat from step c

2. Connect USB cable to PC.

3. Extract stock ROM and mfastboot utility in same folder

4. Give these commands
mfastboot flash partition gpt.bin
-->would fail
mfastboot flash motoboot motoboot.img
-->would fail

---following all would work.
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 system system.img_sparsechunk.3
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

5. Wait till stock ROM boots up completely

6. Power off the phone

7. Put phone in fastboot mode (follow step 1)

8. Load TeamRecovery image by following command
- mfastboot flash recovery twrp-2.8.6.0-xt1032.img

9. Press volume down key till 'Recovery' is selected in fastboot

10. Press volume up key

11. Wait till team recovery starts

12. Goto 'Mount' (This will mount phone as MTP)

13. Load CM13.zip and gapp zip to phone's internal storage

14. In team recovery now choose 'wipe' and choose 'factory reset'

15. Reboot device to fastboot

16. Load Philz recovery image: fastboot flash recovery philz_touch_6.58.7-falcon.img

17. Select 'Recovery' using Volume down key

18. Press Volume up key to boot into recovery


19. Select Install

20. Select 'CM13.zip and gapp zip'

21. Click install

22. After install finishes reboot phone

That is it....

For the stated TWRP, backup DOES NOT WORK FOR CM13 so use PHILZ for backup/restore.

Comments