Moto E4 Guide To Backup Stock ROM Rooted Device Only - Moto E4 Guides, News, & Discussion

This guide will help you to take backup of your device Stock ROM manually. For this you need a Moto E4 Device.
Requirements :
• Moto E4 Any Variant
• Unlocked Bootloader
• Rooted
• Installed Terminal Emulator Application​
Procedure :
Install Terminal Emulator
--- After Installing Follow These Commands ---​
Terminal commands :
Type :
PHP:
su
After getting Superuser permission type all the below commands
---- For Mediatek Variant ----​
Boot image​
PHP:
dd if=/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/boot of=/sdcard/boot.img
Expdb​
PHP:
dd if=/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/expdb of=/sdcard/expdb.img
Frp​
PHP:
dd if=/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/frp of=/sdcard/frp.img
Logo​
PHP:
dd if=/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/logo of=/sdcard/logo.img
Preloader​
PHP:
dd if=/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/lk of=/sdcard/lk.img
Nvram​
PHP:
dd if=/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/nvram of=/sdcard/nvram.img
Nvdata​
PHP:
dd if=/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/nvdata of=/sdcard/nvdata.img
OEM​
PHP:
dd if=/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/oem of=/sdcard/oem.img
Protect1
PHP:
dd if=/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/protect1 of=/sdcard/protect1.img
Protect2
PHP:
dd if=/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/protect2 of=/sdcard/protect2.img
Persist​
PHP:
dd if=/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/persist of=/sdcard/persist.img
Proinfo​
PHP:
dd if=/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/proinfo of=/sdcard/proinfo.img
Para​
PHP:
dd if=/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/para of=/sdcard/para.img
Recovery​
PHP:
dd if=/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/recovery of=/sdcard/recovery.img
Secro​
PHP:
dd if=/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/secro of=/sdcard/secro.img
Seccfg​
PHP:
dd if=/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/seccfg of=/sdcard/seccfg.img
Tee1​
PHP:
dd if=/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/tee1 of=/sdcard/tee1.img
Tee2​
PHP:
dd if=/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/tee2 of=/sdcard/tee2.img
System​
PHP:
dd if=/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/system of=/sdcard/system.img
---- For Qualcomm Variant ----
System
PHP:
dd if=/dev/block/bootdevice/by-name/system of=/sdcard/system.img
Keystore
PHP:
dd if=/dev/block/bootdevice/by-name/keymaster of=/sdcard/keymaster.img
Boot image
PHP:
dd if=/dev/block/bootdevice/by-name/boot of=/sdcard/boot.img
Recovery
PHP:
dd if=/dev/block/bootdevice/by-name/recovery of=/sdcard/recovery.img
OEM
PHP:
dd if=/dev/block/bootdevice/by-name/oem of=/sdcard/oem.img
Persist
PHP:
dd if=/dev/block/bootdevice/by-name/persist of=/sdcard/persist.img
Radio
PHP:
dd if=/dev/block/bootdevice/by-name/modem of=/sdcard/modem.img
Misc
PHP:
dd if=/dev/block/bootdevice/by-name/misc of=/sdcard/misc.img
Nvram
PHP:
dd if=/dev/block/bootdevice/by-name/nvram of=/sdcard/nvram.img
Nvdata
PHP:
dd if=/dev/block/bootdevice/by-name/nvdata of=/sdcard/nvdata.img
Here in these commands i use *.img format. You can change *.img format to *.bin format.​

What's the need when you have twrp recovery to backup.
Moderator Edit:
I have deleted your quote of the entire OP (the post above this). There is no need to do this - apart from being unnecessary, it can cause issues for those members on limited bandwidth or when Mobile. Thanks for your future consideration.

drganbds said:
What's the need when you have twrp recovery to backup.
Click to expand...
Click to collapse
TWRP is limited.
you can only take backup of system, data, cache & boot with TWRP recovery. you cannot take backup of nvram with twrp recovery. If you accidently wiped nvram data, you will lost all your device wireless functionality like wifi, radio, bluetooth & etc. so only this guide will going to help you.

You should specify this guide as being for the mtk variants, not all variants because the commands are not the same as the Qualcomm variants

amarc78 said:
You should specify this guide as being for the mtk variants, not all variants because the commands are not the same as the Qualcomm variants
Click to expand...
Click to collapse
Yes qualcomm variant of Moto E4 have different "block device path" and thanks for your suggestion will update the OP when i get free time.

If anyone has a backup of the XT1766 Boost Mobile Qualcomm variant I would love to have a copy of it

PimpMy5Ton said:
If anyone has a backup of the XT1766 Boost Mobile Qualcomm variant I would love to have a copy of it
Click to expand...
Click to collapse
Their's a qualcomm subforum ask there for help or stock backup :good:

Worked great, though there were no nvram partitions to back up on my metro model.
Nice to have a full stock backup just in case, thanks!
Sent from my XT1765 using Tapatalk

nekomancey said:
Worked great, though there were no nvram partitions to back up on my metro model.
Nice to have a full stock backup just in case, thanks!
Sent from my XT1765 using Tapatalk
Click to expand...
Click to collapse
-OP- is dead now.
No thanked to him. LOL
---------- Post added at 08:18 AM ---------- Previous post was at 08:16 AM ----------
nekomancey said:
Worked great, though there were no nvram partitions to back up on my metro model.
Nice to have a full stock backup just in case, thanks!
Sent from my XT1765 using Tapatalk
Click to expand...
Click to collapse
*Radio* is your device nv partition.

Francesco Franz said:
Their's a qualcomm subforum ask there for help or stock backup :good:
Click to expand...
Click to collapse
I'm asking here because this is a backup thread, I will not ask elsewhere.

Related

[HOWTO] Backup your EFS partition

As with newer Samsung Android phones it is practically essential that if you go to the modding scene and start uploading custom roms you should have a backup of your efs
For simple backup of efs partition
by sishgupta
Code:
adb shell
su
dd if=/dev/block/platform/omap/omap_hsmmc.0/by-name/efs of=/sdcard/efs.img
and for a full image of your brand new phone
as various users have stated there are other more correct ways of backing up your new efs partition,
the one i liked the most is this one by because it backs up all your partitions
by c0ns0le
Code:
IF YOU HAVE BUSY BOX INSTALLED
adb shell
su -
for i in $(ls /dev/block/platform/omap/omap_hsmmc.0/by-name/ | grep -v user)
do
dd if=/dev/block/platform/omap/omap_hsmmc.0/by-name/${i} of=/sdcard/${i}.img &
done
NO BUSYBOX:
adb shell
su -
for i in boot cache dgs efs metadata misc param radio recovery sbl system xloader
do
dd if=/dev/block/platform/omap/omap_hsmmc.0/by-name/${i} of=/sdcard/${i}.img &
done
deprecated just staying here because this started all the correct backup commands for your efs
In order to do this for your galaxy nexus you should have adb working on your machine and also debugging enabled in your phone
this is practically easy, your phone must be rooted, or at least booted with the boot.img of this thread How to Root GALAXY NEXUS
Code:
adb root
adb remount
adb pull /factory
and now backup that file to at least 2 places lol
I always get paranoid with this
have fun installing custom roms
i don't think that works for GN
Samsung changed their EFS recently on the new released phones
it's no longer how it was with the Galaxy S line of phones
No one know if we really can backup and restore /factory (EFS)?
this should put an .img file in /sdcard. It's the same method as the one in the sgs2 section but with different paths.
Code:
adb shell
su
cat /dev/block/platform/omap/omap_hsmmc.0/by-name/efs > /sdcard/efs.img
edit: you'll need to be root, obviously
edit again:
this is technically better but does the same thing:
Code:
adb shell
su
dd if=/dev/block/platform/omap/omap_hsmmc.0/by-name/efs of=/sdcard/efs.img
Out of curiosity, what is efs?
I am pretty familiar with flashing my HTC Desire, but there is not an efs partition (AFAIK)?
Cheers!
It backs up your imei information in case it gets corrupted by flashing custom roms and mods
Sent from my GT-I9000 using xda premium
420SYN said:
It backs up your imei information in case it gets corrupted by flashing custom roms and mods
Sent from my GT-I9000 using xda premium
Click to expand...
Click to collapse
Cool thanks!
Stew
Is this something specific to Samsung phones? I have been rooting and flashing since the nexus one and have never needed this.
Doesn't clockwork mod back this up? If not, why not?
Sent from my LG-P999
dave_t321 said:
Code:
adb shell
su
dd if=/dev/block/platform/omap/omap_hsmmc.0/by-name/efs of=/sdcard/efs.img
Click to expand...
Click to collapse
Would it be if=/dev/block/platform/omap/omap_hsmmc.0/by-name/factory since this partition is named "factory" now?
If the efs is really in the /factory folder and its not hardlinked files sitting somewhere else is there a better way to save the files and keeping the permissions?
Using tar or gzip on them before?
So which method to follow in order to backup my efs folder?All information is under /factory
use
Code:
adb shell
su
dd if=/dev/block/platform/omap/omap_hsmmc.0/by-name/efs of=/sdcard/efs.img
this is the right command as if you run ls on the by-name folder you can see that it is still efs not factory
factory must be a link to this
omg, i have a 0049... IMEI after flashing ICL53F via fastboot!
how could i restore my old IMEI?
edit: jippie, i got my IMEI back after flashing the ITL41F odin version from this post!
i suggest everyone to backup the efs before flashing other firmwares!
Could someone provide the correct commands to restore the efs folder please Ive backed it up just need to know how to restore it if something bad happens
There is a guide for it on these forums. Google 'efs restore android' and you should find it.
There is also an efs restore application that will use img files (like how we made in this guide) instead of just the nv_data.bin
Sent from my Galaxy Nexus using XDA App
does it actually work with this phone?
fun w/ shellfoo
Code:
IF YOU HAVE BUSY BOX INSTALLED
adb shell
su -
for i in $(ls /dev/block/platform/omap/omap_hsmmc.0/by-name/ | grep -v user)
do
dd if=/dev/block/platform/omap/omap_hsmmc.0/by-name/${i} of=/sdcard/${i}.img &
done
NO BUSYBOX:
adb shell
su -
for i in boot cache dgs efs metadata misc param radio recovery sbl system xloader
do
dd if=/dev/block/platform/omap/omap_hsmmc.0/by-name/${i} of=/sdcard/${i}.img &
done
---------- Post added at 03:43 PM ---------- Previous post was at 03:15 PM ----------
[/COLOR]
dave_t321 said:
this should put an .img file in /sdcard. It's the same method as the one in the sgs2 section but with different paths.
Code:
adb shell
su
cat /dev/block/platform/omap/omap_hsmmc.0/by-name/efs > /sdcard/efs.img
edit: you'll need to be root, obviously
edit again:
this is technically better but does the same thing:
Code:
adb shell
su
dd if=/dev/block/platform/omap/omap_hsmmc.0/by-name/efs of=/sdcard/efs.img
Click to expand...
Click to collapse
i've foud this one..wich is better?
adb shell
su
busybox dd if=/dev/block/platform/omap/omap_hsmmc.0/by-name/efs of=/data/media/my_efs_backup.img
They are the same with different output locations. The one that leads with busy box is for a configuration where the commands are not aliased for a busy box setup.
Sent from my Galaxy Nexus using XDA App
Similar thing happened to me. I got a 2nd nexus, decided to restore a nandroid from my 1st nexus onto the 2nd one. Restore went fine, it was like a clone of the 1st phone except the IMEI was corrupt with a generic 0049... one. I flashed the phone back to a google factory ITL41D and the IMEI was restored. Needless to say I won't be doing that again!
paratox said:
omg, i have a 0049... IMEI after flashing ICL53F via fastboot!
how could i restore my old IMEI?
edit: jippie, i got my IMEI back after flashing the ITL41F odin version from this post!
i suggest everyone to backup the efs before flashing other firmwares!
Click to expand...
Click to collapse

[Q] How to restore images which are backuped with dd via ADB

First of all I'm still exploring Androide and Linux = bit of a noob still
I rooted and then saved those images like this:
dd if=/dev/block/mmcblk0p10 of=/storage/extSdCard/backup/recovery/recovery_dd.img
dd if=/dev/block/mmcblk0p3 of=/storage/extSdCard/backup/efs/efs_dd.img
How can I restore them ?? (via ADB, Odin, Flashify)
In the opposite way
dd if=/storage/extSdCard/backup/recovery/recovery_dd.img of=/dev/block/mmcblk0p10
dd if=/storage/extSdCard/backup/efs/efs_dd.img of=/dev/block/mmcblk0p3
radkor said:
In the opposite way
dd if=/storage/extSdCard/backup/recovery/recovery_dd.img of=/dev/block/mmcblk0p10
dd if=/storage/extSdCard/backup/efs/efs_dd.img of=/dev/block/mmcblk0p3
Click to expand...
Click to collapse
THX, didnt know that it is that simple. Can this be done during the device is in normal ON mode or do I have to set the device into a special mode after boot ?
How would you restare a system.img made with dd ? (I think ist not such a good idea to do it in normal ON mode ??)
How would you restore a system.img ?
a) extracted from StockROM package (does it need any conversion first ?)
b) made with dd
I think ist might not be a good idea to do it in normal ON mode ?? (Odin, ....???)

Pre-rooted v10D please

Hi1 my device running 5.1 V10C (H815). I want to flash prerooted v10c or D. Please give a guide to how to flash. Thanks
Do you have an image for it?
*edit*
Here's a pre-rooted H815 EUR 10D image I made:
https://www.androidfilehost.com/?fid=24052804347837030
With this image, SuperSu will ask to update. I'd recommend doing it.
Knowbody42 said:
Do you have an image for it?
*edit*
Here's a pre-rooted H815 EUR 10D image I made:
https://www.androidfilehost.com/?fid=24052804347837030
With this image, SuperSu will ask to update. I'd recommend doing it.
Click to expand...
Click to collapse
Thank you. I am new on Lg. How can i flash this image safely?
Use thete steps: http://forum.xda-developers.com/g4/orig-development/root-tmo-vzw-intl-variants-soon-root-lg-t3164765
With this command (H815 specific):
Code:
dd if=/data/media/0/rootedsystem.img bs=8192 seek=55296 count=529920 of=/dev/block/mmcblk0
If you want to back up your current system partition first, use this command before running the above one:
Code:
dd if=/dev/block/mmcblk0 bs=8192 seek=55296 count=529920 of=/data/media/0/system.img
And if things go wrong, you can restore your backup with this:
Code:
dd if=/data/media/0/system.img bs=8192 seek=55296 count=529920 of=/dev/block/mmcblk0
Knowbody42 said:
Do you have an image for it?
*edit*
Here's a pre-rooted H815 EUR 10D image I made:
https://www.androidfilehost.com/?fid=24052804347837030
With this image, SuperSu will ask to update. I'd recommend doing it.
Click to expand...
Click to collapse
Thanks a lot.
Could you make the same image for H815 V10F ??
Thanks in advance..
Knowbody42 said:
Use thete steps: http://forum.xda-developers.com/g4/orig-development/root-tmo-vzw-intl-variants-soon-root-lg-t3164765
With this command (H815 specific):
Code:
dd if=/data/media/0/rootedsystem.img bs=8192 seek=55296 count=529920 of=/dev/block/mmcblk0
If you want to back up your current system partition first, use this command before running the above one:
Code:
dd if=/dev/block/mmcblk0 bs=8192 seek=55296 count=529920 of=/data/media/0/system.img
And if things go wrong, you can restore your backup with this:
Code:
dd if=/data/media/0/system.img bs=8192 seek=55296 count=529920 of=/dev/block/mmcblk0
Click to expand...
Click to collapse
What will happen if i don't backup partition (actually i don't know what is that)?
Darudakos said:
Thanks a lot.
Could you make the same image for H815 V10F ??
Thanks in advance..
Click to expand...
Click to collapse
If you have an unrooted system.img I could make it a rooted one.
Or follow the root injection method here to do it yourself (requires a linux OS):
http://forum.xda-developers.com/g4/general/lg-g4-100-root-success-directives-root-t3180586
xdaorxan said:
What will happen if i don't backup partition (actually i don't know what is that)?
Click to expand...
Click to collapse
If you don't back up your system partition, it means more effort required to re-flash a stock KDZ if it breaks. Or if you needed to revert to the previous version (v10c) or something.
You could also keep the rootedsystem.img I made on there and use that as a backup, assuming it works on your device.

[solved] TWRP Bootloop after LineageOS update/OTA

Hi, i'm stuck on TWRP 2.8.7.1 after a failed attempts to update LineageOS via OTA.
I cannot boot in bootloader nor in system, it always shows TWRP.
I found everywhere that in this case you should use these command lines :
Code:
dd if=/dev/zero of=/dev/block/platform/msm_sdcc.1/by-name/fota
dd if=/dev/zero of=/dev/block/platform/msm_sdcc.1/by-name/misc
but it gives me "no such file or directory" error :
Code:
~ # dd if=/dev/zero of=/dev/block/platform/msm_sdcc.1/by-name/fota
dd: can't open '/dev/block/platform/msm_sdcc.1/by-name/fota': No such file or directory
~ # ls /dev/block/platform/
7824900.sdhci 7864900.sdhci
These are the only files I have in /dev/block/platform/
I don't know why but I can't update TWRP via TWRP : when I try to flash the image it just proposes me to flash the boot partition (not the recovery).
What could I do ?
I forgot to mention I flashed the correct crackling LineageOS image afterward, and it worked, but I'm still blocked in TWRP.
I handled it !
I just changed the command line to :
Code:
dd if=/dev/zero of=/dev/block/platform/7824900.sdhci/by-name/fota
dd if=/dev/zero of=/dev/block/platform/7824900.sdhci/by-name/misc
Too bad I completely wiped all my phone trying to make things work. I hope it will be useful to someone !
Hello, same twrp loop with 3.0.0 or brick with twrp 3.0.3 by fastboot
I find "fastboot continue" to boot in system
I'm testing with last nightly,
after update twrp with playstore
krodelabestiole said:
I handled it !
I just changed the command line to :
Code:
dd if=/dev/zero of=/dev/block/platform/7824900.sdhci/by-name/fota
dd if=/dev/zero of=/dev/block/platform/7824900.sdhci/by-name/misc
Too bad I completely wiped all my phone trying to make things work. I hope it will be useful to someone !
Click to expand...
Click to collapse
This just saved my son's phone
Thanks for your message and knowledge on this matter. The force salutes you and is with you
I keep coming to this thread for the commands.
Thanks krodelabestiole
krodelabestiole said:
I handled it !
I just changed the command line to :
Code:
dd if=/dev/zero of=/dev/block/platform/7824900.sdhci/by-name/fota
dd if=/dev/zero of=/dev/block/platform/7824900.sdhci/by-name/misc
Too bad I completely wiped all my phone trying to make things work. I hope it will be useful to someone !
Click to expand...
Click to collapse
This finally saved me. I was trying the same two commands that you started with and got the same "no such directory..." error and your new commands worked. That was a tense few hours.

Is there anyway to delete files on "bootdevice" file with TWRP Terminal?

So today I was trying to backup my EFS/IMEI and found that I could do so using the TWRP Terminal commands:
dd if=/dev/block/bootdevice/by-name/modemst1 of=/sdcard/modemst1.emmc.win
dd if=/dev/block/bootdevice/by-name/modemst2 of=/sdcard/modemst2.emmc.win
Click to expand...
Click to collapse
However I typed it wrong, doing this:
dd if=/dev/block/bootdevice/by-name/modemst1 of=/dev/block/bootdevice/by-name/modemst1emmc.win
dd if=/dev/block/bootdevice/by-name/modemst2 of=/dev/block/bootdevice/by-name/modemst2.emmc.win
Click to expand...
Click to collapse
This resulted in having the backups inside the bootdevice file, is there any way I can delete these files with a TWRP terminal command?

Categories

Resources