EFS Partition Backup and More [All G2 Variants] - G2 Android Development

LG G2 EFS Backup Zip
Background
The G2 has no built in EFS backup partitions. EFS contains things like your MEID or IMEI... your data profiles.. radio settings. The EFS cannot be replaced... it is unique to your phone only... backing up your OWN EFS is highly recommended.
I have added EFS backup to the IOroot scripts so that everyone that roots will have a copy of their EFS partitions on the computer you run IOroot from. Regardless, this current thread will still be a good "heads up" and an alternative for those who insist on using other shady root methods or for those who just want another way to back things up. ​Backing up EFS
In TWRP, flash the LG_G2_Backup_EFS.zip attached in this thread. LG_G2_Backup_EFS.zip creates a flashable zip backup of your EFS in /sdcard/EFS_Backup/. Please check to make sure the backup zip worked and actually made a .zip file. Any issues please list what recovery and version you are using and please post the recovery.log.
Backup your efsbackupflashable.zip somewhere else besides your internal SD!!! Email.. cloud.. PC..
Restoring EFS
To restore your original EFS just boot into recovery and flash the efsbackupflashable.zip in your /sdcard/EFS_Backup folder.
If flashable zip wasn't created or to manually restore efs img files run the following commands using adb shell while in recovery:
dd if=/sdcard/EFS_Backup/efs1.img of=/dev/block/platform/msm_sdcc.1/by-name/modemst1
dd if=/sdcard/EFS_Backup/efs2.img of=/dev/block/platform/msm_sdcc.1/by-name/modemst2
​
Backup ALL Partitions
Well almost all... I am attaching another zip which backs up most of your phones partitions.. excluding system/data/cache and some other useless partitions. Backing up all partitions isn't as important as backing up the EFS but it can't hurt. Never know when you may need it.. especially those who like to poke around with their phone and try new things.
Run the zip in recovery.. it will make backup .img files on your internal sdcard in a new folder named "backupz"... remember to copy your backups off the internal sdcard.​

Wow nice find and quick work! I wonder what the chances are of messing you current info up, so your backup would actually be necessary?

drkow19 said:
Wow nice find and quick work! I wonder what the chances are of messing you current info up, so your backup would actually be necessary?
Click to expand...
Click to collapse
Even if the chances are really small, it is always nice to have a backup.
Having to restore with QPST or other similar methods is not fun at all.

Thanks autoprime.
this was pretty fast considering i just saw you post this in irc

I'm on Verizon. It did make a folder but it was empty. No zip inside. Checked with es file explorer

bckrupps said:
I'm on Verizon. It did make a folder but it was empty. No zip inside. Checked with es file explorer
Click to expand...
Click to collapse
Same situation here.

bckrupps said:
I'm on Verizon. It did make a folder but it was empty. No zip inside. Checked with es file explorer
Click to expand...
Click to collapse
jasonsf said:
Same situation here.
Click to expand...
Click to collapse
hmm k... this happened on the LG OG as well... then some people had it working on CWM.. some people had to flash an AOSP rom first.. seems random. If someone can provide me the recovery.log after flashing the efs zip that would help. I'm going to bet its an issue with 7z packing the zip the new flashable zip for some reason or another.
i uploaded a new zip which will still try to make the flashable zip.. while also backing up the individual efs partitions.
redownload the new zip to backup efs img files.
To manually restore efs img files run the following commands using adb shell while in recovery:
dd if=/sdcard/EFS_Backup/efs1.img of=/dev/block/platform/msm_sdcc.1/by-name/modem_st1
dd if=/sdcard/EFS_Backup/efs2.img of=/dev/block/platform/msm_sdcc.1/by-name/modem_st2

autoprime said:
hmm k... this happened on the LG OG as well... then some people had it working on CWM.. some people had to flash an AOSP rom first.. seems random. If someone can provide me the recovery.log after flashing the efs zip that would help. I'm going to bet its an issue with 7z packing the zip the new flashable zip for some reason or another.
i uploaded a new zip which will still try to make the flashable zip.. while also backing up the individual efs partitions.
redownload the new zip to backup efs img files.
To manually restore efs img files run the following commands using adb shell while in recovery:
dd if=/sdcard/EFS_Backup/efs1.img of=/dev/block/platform/msm_sdcc.1/by-name/modem_st1
dd if=/sdcard/EFS_Backup/efs2.img of=/dev/block/platform/msm_sdcc.1/by-name/modem_st2
Click to expand...
Click to collapse
I have the recovery boot loop issue and was just using your zip to test out ADB Sideload in TWRP. I'll wait until my phone is working before I give your tool another try. Too many variables right now.
Jason

For w/e its worth this is not working on my att g2. There does not appear to be a /tmp folder
also on att the paths should be
/dev/block/platform/msm_sdcc.1/by-name/modemst1
/dev/block/platform/msm_sdcc.1/by-name/modemst2
(no "_")

jasonsf said:
Same situation here.
Click to expand...
Click to collapse
Same thing happens to me on VZW. Here is the recovery.log
http://pastebin.com/jhyHJ0Yz

jug6ernaut said:
For w/e its worth this is not working on my att g2. There does not appear to be a /tmp folder
also on att the paths should be
/dev/block/platform/msm_sdcc.1/by-name/modemst1
/dev/block/platform/msm_sdcc.1/by-name/modemst2
(no "_")
Click to expand...
Click to collapse
I can confirm this information on my AT&T G2. Maybe the script can be modified as such (unconfirmed):
Code:
# backup partitions
EFS_PREFIX=modem_st # Assume Verizon model (with underscore)
if [ -e /dev/block/platform/msm_sdcc.1/by-name/modemst1]; then # Use AT&T model nomenclature
EFS_PREFIX=modemst
fi
/sbin/busybox dd if=/dev/block/platform/msm_sdcc.1/by-name/${EFS_PREFIX}1 of=/tmp/efs1.img;
/sbin/busybox dd if=/dev/block/platform/msm_sdcc.1/by-name/${EFS_PREFIX}2 of=/tmp/efs2.img;

jug6ernaut said:
For w/e its worth this is not working on my att g2. There does not appear to be a /tmp folder
also on att the paths should be
/dev/block/platform/msm_sdcc.1/by-name/modemst1
/dev/block/platform/msm_sdcc.1/by-name/modemst2
(no "_")
Click to expand...
Click to collapse
Ugh.. sorry about this. I must have been in HTC mode.. they use the "_" derpppp.
updated the zip.. see how that goes.

mine did not create a .zip file. On At&t, but still thanks a ton! will keep these two efs.img's stored on my dropbox so that I always have a backup.
Anyway to make these two into a flashable zip manually? I'm sure the code is in the script somewhere I just don't feel like looking haha

This now works for me autoprime. It created efs1.img, and efs2.img on VZW. Thx!

Got my two image files, both 3mb....thanks! I am on ATT.

im on verizon. works great. kudos

Confirm works on ATT.
Sent from my LG-D800 using Tapatalk 2

I have updated the zip in the OP... it now creates a proper flashable backup zip as well as teh 2 efs img files.
thanks to @jug6ernaut for testing all of my broken zips :highfive:

In TWRP the zip fails every time..... attached photo of error.
Sent from my VS980 4G using XDA Premium HD app

anyone else have the error that @mouf32 is having? I have some users on IRC that say it's working just fine. And there's been 50+ downloads with no other issues.
@mouf32 have you tried to redownload the file? maybe the zip got messed up or is corrupted?

Related

[Q] EFS Backup

I have been trying to backup efs data prior to flashing away merrily.
I believe this important given the various reports of glitches.
I tried the guidelines here---
and had the following error---
busybox tar zcvf /sdcard/efs-backup.tar.gz /efs
busybox tar zcvf /sdcard/efs-backup.tar.gz /efs
tar: invalid option -- z
However when I removed the 'z' from 'zcvf' I had a verbose output of 37 files and an efs-backup.tar file.
Would this be the correct efs tarball?
The code --busybox cat /dev/block/stl3 > /sdcard/efs_dev-block-stl3.img
seemed to work correctly generating a disc image file.
I know less than you do about this, but couldn't you just go into your root with an application like root explorer and just back up the efs that way?
-Hercules composed this post and threw it at your face to be read-
does anyone have an efs backup they can share?
something went wrong with mine and i no longer have a lock screen and everytime i reboot, bluetooth is turned on and the screen is set to never shut off.
i just use root expolorer and find the efs file and copy it and paste it in ext sd and then transfer to pc for safe keeping, thats how it works for me.
movieaddict said:
i just use root expolorer and find the efs file and copy it and paste it in ext sd and then transfer to pc for safe keeping, thats how it works for me.
Click to expand...
Click to collapse
Yea I did the same but some how my memory card reformatted before I could save it on my computer and now I need to restore it and I no longer have one
Sent from my SGH-T989 using XDA App
Please Help
anyone has their efs backed up that they can share mine got deleted and i don't know how to recreate it
madamada31 said:
anyone has their efs backed up that they can share mine got deleted and i don't know how to recreate it
Click to expand...
Click to collapse
Just download nitrality app and backup efs with that. It's in the tools settings.
Sent from my SGH-T989 using Tapatalk
richardlibeau said:
Just download nitrality app and backup efs with that. It's in the tools settings.
Sent from my SGH-T989 using Tapatalk
Click to expand...
Click to collapse
as i said my efi folder is empty and the phone doesn't show any IMEI.. i tried the backup but it didn't do anything. is there any way to recreate the necessary files in that folder..

Restore 4G Partition

So I know this is a habitual question and over looked around but I'm not finding the method for me.
I rerooted my evolution and lost my RSA key but have a wimax partition saved. The kicker is its not the regular wimax.img. The file I have shows my phone id and then wimax img. So the file name is HT0AXHL06242_wimax.img. I have tried renaming it as wimax.img and flashing it but there is an error. I know it can be flashed because I had a similar issue when I first rooted my phone and I was able to flash it through recovery but there have been several updates. Any ideas?
Sent from my PC36100 using xda app-developers app
It needs to be flashed with the same recovery it was made with, if it was made with cwm it needs to be flashed with cwm, if u used amon_RA 2.3 u need to use it, if it was a variant of amon RA u need to use the variant u used to make the backup same recovery and version number for best results, some times backups made with an older version will fail to restore using a newer version. You may also be able to extract the files and push them with adb or make a zip that can flash the img file
We are legion, for we are many.
Sent from the DarkSide of the GalaXy with a MEK device
Trying the older CWM with no luck and the same for amon. How would I go about extracting the files? If it helps this file was created when I used the original one click auto root method. Like I said it has been used before to restore my wimax but I don't remember how.
Sent from my PC36100 using xda app-developers app
You can move the backup to your PC, if its just a .img and not compressed just move the .img file to a location where you won't lose it and then use adb to push it to the correct partition on the device. I'm not sure of the exact location or adb command to push it there but that should be fairly easy to find via Google. I haven't had to do the adb push to fix wimax before but I've seen instructions here on xda to do it, and its been a while since I've used adb. Another option is to use a root explorer like ES explorer to copy and paste the wimax.img file to the proper location in the /system folder if you don't have access to a PC. You may need to rename the file to wimax.img and set permissions or use recovery to fix permissions. I believe it goes in a folder named something like /system/wimax or something similar if you browse around you should find an empty folder named wimax that's where it should go
We are legion, for we are many.
Sent from the DarkSide of the GalaXy with a MEK device
I have had exactly the same problem. Sadly, flashing the wimax.img didn't work. The RSA key seems to be crucial.
By the way, I believe that the wimax.img should be flashed to the /etc/wimax folder. Not under the /system folder.
Sent from my PC36100 using xda app-developers app
One More Thing Before I Say F*** It
Thanks all for your comments so far. I'm going to try one last effort and then just accept defeat. I flashed the wimax update that awhile back corrupted 4g for a lot of people (after seeing the file I remebered that is what did it last time). My mac address for awhile was nothing intelligible and now it is the 001608002405. I found a forum http://forum.xda-developers.com/showthread.php?t=715525 that shows a way to change that mac but there are two files I apparently need but they are no longer hosted. Any ideas where I could pick them up? I'm going to PM the initial threader as well.

Can't restore?! Please help

I rooted my phone today and did a CWM backup - I then flashed CM10 and then tried to do a restore but when I try it I get the following error "Couldn't open directory, No files found"
Yet when I browse my files I can see the back up I made in the CWM folder - why won't it restore this?
Any thoughts?
Thanks in advance!
jackryan57 said:
I rooted my phone today and did a CWM backup - I then flashed CM10 and then tried to do a restore but when I try it I get the following error "Couldn't open directory, No files found"
Yet when I browse my files I can see the back up I made in the CWM folder - why won't it restore this?
Any thoughts?
Thanks in advance!
Click to expand...
Click to collapse
Hmm...not sure if it's related, but the only time my CWM backup didn't restore was some MD5 mismatch error. I renamed the backup to "backup.tar" (if you're using *.tar and not /blobs) after I read that worked on a thread, and wala, it worked! Unsure if that's what your issue is, though.
ikjadoon said:
Hmm...not sure if it's related, but the only time my CWM backup didn't restore was some MD5 mismatch error. I renamed the backup to "backup.tar" (if you're using *.tar and not /blobs) after I read that worked on a thread, and wala, it worked! Unsure if that's what your issue is, though.
Click to expand...
Click to collapse
I just tried what you said and it still doesn't work - I did notice that my backup is a file folder not just a file - so I don't think renaming the folder to a .tar will actually do anything to it?
Is there any other way to restore from a back up I have on my phone but that CWM doesn't seem to see??
You could try moving the file with a file manager or make sure permissions are good.
Sent from my SAMSUNG-SGH-I747 using xda premium
Push it with Odin? Or just grab the stock rooted file from the stickies and push that with Odin.
Sent from my SGH-I747 using xda app-developers app
What would I be looking for as far as permissions go?
jackryan57 said:
I just tried what you said and it still doesn't work - I did notice that my backup is a file folder not just a file - so I don't think renaming the folder to a .tar will actually do anything to it?
Click to expand...
Click to collapse
Hmm..it's been a while since CWM--do you have any folder called blobs? If so, then my tip to rename to "backup.tar" won't work. Basically, you're right. If you don't have a *.tar backup, then I got nothing. CWM used to be *.tar only, then defaulted to /blobs, and now is defaulting back to *.tar with the option of /blobs.
join the club...
http://forum.xda-developers.com/showthread.php?t=2101424
No idea what's going on with this crap. I've lost every backup now for two weeks, the worst of which was my stock backup.
i may have ended up finding a solution to the problem here, if yours is similar enough to mine.
http://forum.xda-developers.com/showthread.php?t=2101424

[Q] CWM Won't see backups

Hi guys. I figured it was time for a fresh install of CM 10.1 It didn't work out too well because TIBU wouldn't see my backups, but now CWM won't see my nandroids. I can find them under /storage/sdcard0/clockworkmod, but CWM doesn't see them. What can I possibly do?
ollien said:
Hi guys. I figured it was time for a fresh install of CM 10.1 It didn't work out too well because TIBU wouldn't see my backups, but now CWM won't see my nandroids. I can find them under /storage/sdcard0/clockworkmod, but CWM doesn't see them. What can I possibly do?
Click to expand...
Click to collapse
what version of cwm are you on?
Did you rename them? You can't have spaces in the naming of them or cwm won't recognize it.
Sent from my SAMSUNG-SGH-I747 using Tapatalk 4 Beta
Domoo said:
Did you rename them? You can't have spaces in the naming of them or cwm won't recognize it.
Sent from my SAMSUNG-SGH-I747 using Tapatalk 4 Beta
Click to expand...
Click to collapse
that has to do with flashing them. his cwm cant SEE them. ClockworkMod needs to be updated to properly understand 4.2's new filesystem structure so it can see its previous backups
Sorry for the delay, had to do something. My CWM version is 6.0.1.2
ollien said:
Sorry for the delay, had to do something. My CWM version is 6.0.1.2
Click to expand...
Click to collapse
uh yeah. update cwm. are you at&t? if so:
follow the link in my signature. near the bottom of post #2 there is a small segment called "Build your own Must Have toolkit." in there is a link to the latest cwm. download it and place it on your phone, boot into recovery, flash it, reboot recovery. you should be on 6.0.3.0 now.
xBeerdroiDx said:
uh yeah. update cwm. are you at&t? if so:
follow the link in my signature. near the bottom of post #2 there is a small segment called "Build your own Must Have toolkit." in there is a link to the latest cwm. download it and place it on your phone, boot into recovery, flash it, reboot recovery. you should be on 6.0.3.0 now.
Click to expand...
Click to collapse
Can't I just update via ROM Manager?
ollien said:
Can't I just update via ROM Manager?
Click to expand...
Click to collapse
Yes you can also use rom manager to update
I recommended the download just so you'd have the zip on your phone in case you needed it again another time
Still nada showing up for backups.
Have you tried to manage them in the Rom Manager app? hit manage backups then you can manage/delete backups
No backups found by rom manager, but I can find them if I look myself.
What do you have under data/media/clockworkmod/backup?
xBeerdroiDx said:
What do you have under data/media/clockworkmod/backup?
Click to expand...
Click to collapse
the backup folder dosen't exist. Should I move it from where it is now?
ollien said:
the backup folder dosen't exist. Should I move it from where it is now?
Click to expand...
Click to collapse
Try copy and paste. Don't rename anything. Just copy and paste the backup folder
Did that, it showed up, got "Error while restoring /system". Now phone won't boot, reflashing.
EDIT: What signifigance is the "blobs" folder?
Edit: Just to clarify, the commands I did in ADB
[email protected]:/ $ su
[email protected]:/ # cd /sdcard/0
[email protected]:/sdcard/0 # ls
0
Alarms
Android
DCIM
Download
Movies
Music
Notifications
Pictures
Podcasts
Ringtones
clockworkmod
data
legacy
obb
[email protected]:/sdcard/0 # cd clockworkmod/backup
[email protected]:/sdcard/0/clockworkmod/backup # cd ..
[email protected]:/sdcard/0/clockworkmod # cp backup /data/media/clockworkmod/
cp: backup is a directory (not copied).
1|[email protected]:/sdcard/0/clockworkmod # cp -r backup /data/media/clockworkmod>
[email protected]:/sdcard/0/clockworkmod # ls /data/media/clockworkmod
backup
[email protected]:/sdcard/0/clockworkmod #
Click to expand...
Click to collapse
where are you sitting right now?
i'm looking for an older cwm to possibly revert to (6.0.1.2), try and restore backup, update cwm and make a new backup...
EDIT
here's the link to a cwm 6.0.1.2 odin-flashable tar
ollien said:
Hi guys. I figured it was time for a fresh install of CM 10.1 It didn't work out too well because TIBU wouldn't see my backups, but now CWM won't see my nandroids. I can find them under /storage/sdcard0/clockworkmod, but CWM doesn't see them. What can I possibly do?
Click to expand...
Click to collapse
That happened to me the first time, then I started to use Rom Manager Premium and in settings change the path and press the option "use external storage"in setting. If you look for this folder in the root you can find it on sdcard1(external sd)
If you enter the recovery by pressing the power buttom all your backups would be saved on this path if you are using a 4.2.2 rom (mnt-shell-emulated-clockworkmod).
Personally if I did that way, I copy/paste the back up on the external sd.

TWRP can't recognize backup folder name

My phone is GT-N7105 (Samsung Note 2)
=============SHORT STORY=============
TWRP can't recognize my backup folder name which I am trying to restore
=====================================
=============LONG STORY=============
I had a nandroid backup before, then I copied the backup to PC, still have it. Then I flashed lineage 13. I deleted the nandroid backup on the phone storage. Now I want to restore the backup so I copied the backup files from the PC.
Now when I go to TWRP Restore mode, no backups are found.
I already searched through the internet and found the renaming method but there's a problem:
this is my original backup:
TWRP/backups/42f7491d7b409fc7/2017-03-01--05-28-34_JZO54K.N7105XXDMB
I tried to make a new backup of my current lineage (just to see if the folder name changed based on the new folder the backup process will create), here is what the resulting folder was:
TWRP/backups/42f7491d7b409fc7/2017-07-05--09-27-29_lineage_tOlte-userdebug_6.0.1_MOB31K_ab972c
As you can see, only the innermost folder name changed. So from what I found through searching, it said to rename the old backup folder to the new backup folder's name, meaning :
I changed
2017-03-01--05-28-34_JZO54K.N7105XXDMB
to
2017-07-05--09-27-29_lineage_tOlte-userdebug_6.0.1_MOB31K_ab972c
TWRP still can't see the original backup.
So what should I rename the original backup folder for TWRP to recognize it and make it appear?
EDIT:
I already updated my TWRP but problem still exists.
Create a new backup with your current rom, then remove it and add the old one instead.
futchy4u said:
Create a new backup with your current rom, then remove it and add the old one instead.
Click to expand...
Click to collapse
Sorry not really a developer type of guy and I regret tinkering with these stuff on my phone.
What you meant was to make a backup with current rom just to get the folder name that TWRP will recognize and then swap the old stock backup into the folder?
If I just rename the stock backup folder name to 2017-07-05--09-27-29_lineage_tOlte-userdebug_6.0.1_MOB31K_ab972c it's the same as what you said right?
and it should still run smoothly (stock rom should be restored without errors)?
Sorry just asking out of caution.
It's ok, we're all helping each others here. And we all had lots of mistakes and we still do.
Anyways, yes renaming it could do the trick but you don't need to rename the backup name directly. Instead, you need to rename the folder containing the backup.
TWRP path is going to be similar to that
/TWRP/BACKUPS/4d00475b004150de/2017-07-05--09-27-29_lineage_tOlte-userdebug_6.0.1_MOB31K_ab972c
Click to expand...
Click to collapse
All you need to get is that folder name "4d00475b004150de" because it's auto generated by twrp, that's why I asked you to create another backup even if you just backed up your boot file to generate the folder.
Once you did the backup you can then move your old backup to that folder or rename that old similar folder to the newly created one (not the rom backup folder itself).
sgn15 said:
Sorry not really a developer type of guy and I regret tinkering with these stuff on my phone.
What you meant was to make a backup with current rom just to get the folder name that TWRP will recognize and then swap the old stock backup into the folder?
If I just rename the stock backup folder name to 2017-07-05--09-27-29_lineage_tOlte-userdebug_6.0.1_MOB31K_ab972c it's the same as what you said right?
and it should still run smoothly (stock rom should be restored without errors)?
Sorry just asking out of caution.
Click to expand...
Click to collapse
futchy4u said:
It's ok, we're all helping each others here. And we all had lots of mistakes and we still do.
Anyways, yes renaming it could do the trick but you don't need to rename the backup name directly. Instead, you need to rename the folder containing the backup.
TWRP path is going to be similar to that
All you need to get is that folder name "4d00475b004150de" because it's auto generated by twrp, that's why I asked you to create another backup even if you just backed up your boot file to generate the folder.
Once you did the backup you can then move your old backup to that folder or rename that old similar folder to the newly created one (not the rom backup folder itself).
Click to expand...
Click to collapse
Oh, the folder name code you're referring to was 42f7491d7b409fc7 for me. Thanks. I tried it and everything worked (done restoring and it looks like everything is working so far). Thanks a lot again!
To moderators, this topic's problem is solved. Not sure if the topic needs to be locked after being solved, but yeah just a heads up. Not very active here.
Cheers.
sgn15 said:
Oh, the folder name code you're referring to was 42f7491d7b409fc7 for me. Thanks. I tried it and everything worked (done restoring and it looks like everything is working so far). Thanks a lot again!
To moderators, this topic's problem is solved. Not sure if the topic needs to be locked after being solved, but yeah just a heads up. Not very active here.
Cheers.
Click to expand...
Click to collapse
You're welcome. I think it's ok to be left here so that it could help others.

Categories

Resources