yashsingh1/xdaforums huggingface dataset:
[G2 Android Development] 4Freedom:
i have root but no recovery for now and i want to backup all my partitions

here is the backup.sh from backup_all_partition.zip of 1st post of this thread

#!/system/bin/sh
[COLOR="Lime"]# make dirs[/COLOR]
/sbin/busybox mkdir -p /sdcard/backupz;
[COLOR="lime"]# backup partitions[/COLOR]
/sbin/busybox dd if=/dev/block/platform/msm_sdcc.1/by-name/sbl1 of=/sdcard/backupz/sbl1.img;
/sbin/busybox dd if=/dev/block/platform/msm_sdcc.1/by-name/aboot of=/sdcard/backupz/aboot.img;
/sbin/busybox dd if=/dev/block/platform/msm_sdcc.1/by-name/rpm of=/sdcard/backupz/rpm.img;
/sbin/busybox dd if=/dev/block/platform/msm_sdcc.1/by-name/boot of=/sdcard/backupz/boot.img;
/sbin/busybox dd if=/dev/block/platform/msm_sdcc.1/by-name/tz of=/sdcard/backupz/tz.img;
/sbin/busybox dd if=/dev/block/platform/msm_sdcc.1/by-name/modemst1 of=/sdcard/backupz/modemst1.img;
/sbin/busybox dd if=/dev/block/platform/msm_sdcc.1/by-name/modemst2 of=/sdcard/backupz/modemst2.img;
/sbin/busybox dd if=/dev/block/platform/msm_sdcc.1/by-name/sns of=/sdcard/backupz/sns.img;
/sbin/busybox dd if=/dev/block/platform/msm_sdcc.1/by-name/spare of=/sdcard/backupz/spare.img;
/sbin/busybox dd if=/dev/block/platform/msm_sdcc.1/by-name/ssd of=/sdcard/backupz/ssd.img;
/sbin/busybox dd if=/dev/block/platform/msm_sdcc.1/by-name/misc of=/sdcard/backupz/misc.img;
/sbin/busybox dd if=/dev/block/platform/msm_sdcc.1/by-name/encrypt of=/sdcard/backupz/encrypt.img;
/sbin/busybox dd if=/dev/block/platform/msm_sdcc.1/by-name/eri of=/sdcard/backupz/eri.img;
/sbin/busybox dd if=/dev/block/platform/msm_sdcc.1/by-name/persist of=/sdcard/backupz/persist.img;
/sbin/busybox dd if=/dev/block/platform/msm_sdcc.1/by-name/rct of=/sdcard/backupz/rct.img;
/sbin/busybox dd if=/dev/block/platform/msm_sdcc.1/by-name/recovery of=/sdcard/backupz/recovery.img;
/sbin/busybox dd if=/dev/block/platform/msm_sdcc.1/by-name/fsg of=/sdcard/backupz/fsg.img;
/sbin/busybox dd if=/dev/block/platform/msm_sdcc.1/by-name/fsc of=/sdcard/backupz/fsc.img;
/sbin/busybox dd if=/dev/block/platform/msm_sdcc.1/by-name/DDR of=/sdcard/backupz/DDR.img;
/sbin/busybox dd if=/dev/block/platform/msm_sdcc.1/by-name/fota of=/sdcard/backupz/fota.img;
/sbin/busybox dd if=/dev/block/platform/msm_sdcc.1/by-name/mpt of=/sdcard/backupz/mpt.img;
/sbin/busybox dd if=/dev/block/platform/msm_sdcc.1/by-name/carrier of=/sdcard/backupz/carrier.img;
/sbin/busybox dd if=/dev/block/platform/msm_sdcc.1/by-name/blus of=/sdcard/backupz/blus.img;
/sbin/busybox dd if=/dev/block/platform/msm_sdcc.1/by-name/laf of=/sdcard/backupz/laf.img;
/sbin/busybox dd if=/dev/block/platform/msm_sdcc.1/by-name/ve of=/sdcard/backupz/ve.img;

Could i run this .sh from android-terminal-emulator app?

will it backup everything also if the phone is ON? [MENTION=2684188]autoprime[/MENTION] or anyone can give me a correct answer?
[G2 Android Development] OfficerJimLahey:
I've had problems running shell scripts in terminal emulator, maybe even ADB, so I needed an external app like SManager to do my dirty work.

When I got my F3Q, I backed every partition up via ADB (much like the script above) and had no problems with it. Mind you, all I really used since then was /system and probably /boot.

I tried the same thing on a smaller scale with my ASUS tablet (/system, /boot, /cache) and was forced into recovery to finish the job as the partitions I was dd'ing were either the wrong partitions (sizes and contents were all wrong) or otherwise meant nothing to me. Could just be an ASUS thing too.

So if it worked for my LG device, it should work for yours as well. Cheers.
[G2 Android Development] minhaz.sourav:
Can I use use this EFS partition backup to revert back to Kitkat roms from Stock Lollipop Roms (Stock Grola rom)??
[G2 Android Development] Wintersdark:
Do EFS partitions change with OS version changes?

Back when I got my LG G2, I made backups of my EFS partitions, which I backed up all over the place.

I ran into a problem when flashing various custom roms back pre-kitkat, where I was no longer able to get GPS locks at all, and restoring my EFS partition by having TWRP rip it out of an old backup worked just fine.

Since then, I managed to bork my phone, and flashed it back to it's new KitKat stock rom. It's rooted now, though I don't have TWRP installed, nor do I have any of my old TWRP backups as I lost internal storage in the process, and never bothered backing up the TWRP files off the phone.

So, now I'm running the stock, current Rogers (d803) KitKat firmware. Everything runs fine, except again absolutely no GPS locks. GPS tools shows that my phone can see all the local satellites, but doesn't connect to any of them to get a fix - exactly what it did before, where restoring the EFS backup fixed it.

I saved my modemst1.img and modemst2.img backups to /sdcard, and in a root ADB shell, used:

root@g2:/ # dd if=/dev/block/platform/msm_sdcc.1/by-name/modemst1 of=/sdcard/modemst1_current.img

root@g2:/ # dd if=/dev/block/platform/msm_sdcc.1/by-name/modemst2 of=/sdcard/modemst2_current.img

to back up my current settings, just in case. Then:

dd if=/sdcard/modemst1.img of=/dev/block/platform/msm_sdcc.1/by-name/modemst1

dd if=/sdcard/modemst2.img of=/dev/block/platform/msm_sdcc.1/by-name/modemst2

(I checked to ensure that modemst1 and modemst2 where the correct names first, with:

ls /dev/block/platform/msm_sdcc.1/by-name/

just in case there was a "_" in the name - there wasn't.)

Reboot phone, and get "Service Disabled" and no cell service whatsoever. Eek.

dd'd my new backups back and the phone gets service again, but still no GPS lock. Am I basically in a spot where the old EFS backups are somehow no longer valid? New modem with KitKat rom, does that matter? And if so, is there any way I can repair my GPS, or should I just accept that it (GPS) is toast and move on to a new phone when I can?

Or, did I do something really silly wrong?
[G2 Android Development] Murshad007:
Baseband and IMEI Unknown

My G2 D801 have lost Baseband and IMEI after flashing..

Can this method restores my Baseband?
[G2 Android Development] 4Freedom:
I am on lollipop and i tried to backup flashing the zip that should backup every partition but i cant find nothing into /sdcard0/ where does it store the backup?

Are partitions different in lollipop?

SOLUTION:

i dont know why, but i cant see twrp folder in my sdcard, but i can see it using root explorer and going to /data/media/0

SOLUTION OF SOLUTION

:in terminal type:

su
<press enter>
restorecon -FR /data/media/0/*
<press enter>
<reboot>

All files will be back,and you can see everything from your file manager or from your pc
[G2 Android Development] 4Freedom:
why while flashing LG_G2_Backup_All_Partitions.zip it say "converting to korean version"??
[MENTION=2684188]autoprime[/MENTION]
[G2 Android Development] 4Freedom:
I checked the MD5 of kitkat efs img and the MD5 of lollipop efs img and they are different : (

So,i am really thinking that after the update something change.

However gps problem can be a baseband/radio/sensors problem, it ia hard to link it to efs.

Try to restore one of those partitions.
[G2 Android Development] gamerZ1:
I have a little question.So I rooted my LG G2 installed TWRP on it and backed-up everything in recovery including EFS Partition,sensors.....I saved in on my PC everything good.I had some problems with my OS and reinstalled my PCs OS and forgot to save my backups to the cloud or flash drive.I installed to my phone a custom ROM,kernel the phone is running fine.The EFS partition is intact right now?I mean with these custom roms and kernels can I still save ma EFS partition?Is it still there?
[G2 Android Development] autoprime:
if phones radio still works.. signal... data..wifi.. gps all working.. then you still have a proper EFS... it may or may not be perfect but if you make a backup now.. its the best copy of it youre gonna get. the idea is to just get an efs backup as soon as possible while everything still works as it should. only 1 backup per exact device is needed... so be sure to store it somewhere safe this time.
[G2 Android Development] gamerZ1:
Everything is working fine.
[G2 Android Development] xmyszka:
0 bytes in backuped files.

Not working on LP - D802 ???
[G2 Android Development] tooobe:
I have no signal. I have backup from TWRP of efs1.emmc.win efs2.emmc.win and radio.emmc.win

What do I do with these files to restore them? Thanks
[G2 Android Development] OfficerJimLahey:
If TWRP was able to back them up, then TWRP would have an option to select to restore them as well.

Before you do anything, ensure that you have a null or corrupted IMEI by going into your About Phone settings. If something is up, dd backup the broken efs just in case anyway.

Then while in TWRP, press restore, select the appropriate backup archive, and make sure that efs1 and efs2 are selected. Hope this helps.
[G2 Android Development] tooobe:
The problem is that the backups aren't in archives, they're in the files i wrote... Can't find how to restore them.
[G2 Android Development] OfficerJimLahey:
I guess I am not understanding ... how did you write the files? Why TWRP images? Are there .img files in there in the end?
[G2 Android Development] tooobe:
I made them in TWRP. No IMG files, just the ones I wrote. I think they are just copies of the efs folders just not in archived form... Have the backup log file as well... But that's it.
[G2 Android Development] OfficerJimLahey:
How big are the files? I don't know if they would be usable, because it sounds like a file copy of a mount point (which would just be a few bytes), as opposed to a dump of the actual partition (EFS for LG are partitions, not folders).
[G2 Android Development] tooobe:
The efs files are 3MB each and the radio file is 67MB. Pretty sure they are actual backups. Made them through TWRP, backup and chose efs and radio I think. This was like 6 months ago so don't remember the details... Thanks for trying to help me!
[G2 Android Development] OfficerJimLahey:
I think I know what you mean now, you copied them out of the TWRP folder and don't know how to bring it back so TWRP can recognize it.

So TWRP had this for a backup folder:

[storage (e.g. sdcard)]/TWRP/[device name]/[Backup Label (partially date stamp unless set otherwise)]

So if [device name] is missing, the easy way to create it is to make a backup of say, cache. Once that is backed up, copy your efs files into that folder. Reboolt back into TWRP, select restore, select the backup label created earlier, and then your efs files should show to be able to check off (you can uncheck cache at this point). Select restore.

Hope this helps.
[G2 Android Development] tooobe:
That sounds about right! Thanks, will try that! :)
[G2 Android Development] radeon6002:
It doesn't work for me. Im on LP 5.0.2 D802, backup all partition shows me Converting to Korean G2 and after script finished there is no file with backup, same thing with EFS backup final. Im using the newest twrp recovery.
[G2 Android Development] Kornelije23:
Hello this is off the topic, but I am desperate, I update my lg g2 32 gb d802 android 4.4.2 to official lollipop. After that my phone becomes 16 gb (it shows 32 gb, but 21 is used for other) and when I connect it to computer I can only use 10 gb, I reed it is because of bad firmvare, and I tried everthing to fix it but failed. My question is can I flash a backup of partitions from someone else phone who have europien open g2 d802 32 gb, whuld that fix my problem, and if that can help, can some one upload me their partitions back up. Thanks in advance, and sorry again for bodering you.
[G2 Android Development] OfficerJimLahey:
Before doing anything drastic (sounds like that will make things worse), do this in a terminal emulator or adb shell (preferred):

su
cat /proc/partitions
ls -l /dev/block/platform/msm_sdcc.1/by-name/

...and send back the output. Find someone with your model and region but still on 4.4 to do the same.

We will then see if the update messes up the partitions, and if there is a way to recover from that.
[G2 Android Development] Kornelije23:
I will do that when I come back home, now I am on cloudly 3.3. This is what happened on my first regulr update:

I got phone with stock, no root android 4.4.2. I update my rom over official lg update, but as soon as update finished I got message settings stoped working or something like that.

I rebute to recovery and I have wiped data. when phone booted everthing was ok. I connected it to computer, and I had only 16 bg, (10.7 usable). Since than I tried flashing stock 4.4.2, 32 gb, no luck, followed procedure to recover 32 gb from other threds, and no luck.

Now I rooted phone and instled twrp and I am using it like 16 gb :/

Than I found this tread, I buck up my EFS, and come to idea to ask about partition flash thrugh twrp.
[G2 Android Development] drew150931:
one question i have problem with my phone d802 variant. i have no cell or phone signal but my wifi, bluetooth are still working also my sim card are able to detect in my phone and my signal is also working in the other phone.. my IMEI are still there and not missing. what should be the problem of my phone? thanks in advance.
[G2 Android Development] marioz10:
can someone send me a efs backup and qcn for lg vs980?
[G2 Android Development] Murshad007:
What's the problem you are facing?
[G2 Android Development] marioz10:
i change imei with service box but i dont save the backup of qcn and efs and now i cant get network signal
[G2 Android Development] gosserness:
D802 EFS ZERO backup request

Hello,

i have issues with my D802 which i am sure are related to efs/baseband, happened after playing too heavy...

Would someone send me in private a backup of his EFS? my phone is D802 32GB. After i will change all the id data, obviously!!

Thanks dudes!
[G2 Android Development] casual_kikoo:
As EFS belongs to a single phone, I don't think that dd's (" dd if=/ of=/ ") will work. And also I don't think someone will send you them EFS partitions: you can be honest as what you want, it contains private informations, related to every single phone, so...
[G2 Android Development] gosserness:
i hoped that people that comes in this site were smarter than you...

how do you dare to say i want to steal people?

before you should look for some doc: efs doesn't contains only id data.
[G2 Android Development] casual_kikoo:
I don't dare anything dude: it can be you or someone else, I don't think people will give you there private infos. But if someone do it for you, nice about you. So guy, have a nice day, and in the future, don't be so disrespectful please, 'cause I don't remember I had been disrespectful with you.
[G2 Android Development] dodora3d:
there's way to do backup without custom recovery ?! just STock LP and Root ?
[G2 Android Development] OfficerJimLahey:
For sure. Just fire up adb shell (or - but not recommended due to the right rate of typing error - get a terminal emulator app for your phone) and enter:

su
dd if=/dev/block/platform/msm_sdcc.1/by-name/modem_st1 of=/sdcard/efs1.img
dd if=/dev/block/platform/msm_sdcc.1/by-name/modem_st2 of=/sdcard/efs2.img
[G2 Android Development] dodora3d:
i will do it.... can you tell me if i want restore it how ?
[G2 Android Development] OfficerJimLahey:
See post 7...

http://xdaforums.com/showthread.php?p=45754267

...or, swap the "if" and "of" paths in the example I gave above. Both examples give the same result, except autoprimes post 7 example assumes you have copied the backup files to a subfolder.

Hope this helps.

Sent from my ASUS_Z00AD
[G2 Android Development] dodora3d:
thank you . i flash recovery and i did backup for EFS and radio type . WIN not zip so that's normal or what?
[G2 Android Development] OfficerJimLahey:
For TWRP it is normal, yes.

Sent from my ASUS_Z00AD
[G2 Android Development] Kornelije23:
Hello mate, again, my computer was broken, I fixed it, and now, I hope, I can fix my storage on my phone.

My friend got lg d802 32gb (same as mine) he is on stock 4.4.2. I ll do this with adb shell tonight and send you logs, also tomorrow I ll back up his partitions, and mine partitions and send you files.

I hope I will finaly have 32 gb again. By the way I ma on cloudy 3.3. rom

Thanks again mate.

Edit: here is the screenshoot of what Igot from entering this commands in terminal emulator.
[G2 Android Development] OfficerJimLahey:
It's actually "ls -l" (dash ell), not "ls -1" (dash one). Hence the error. ;)

With your computer up and running, can you run the commands again via adb shell, and copy/paste the text output? If you can do that with your friends phone as well, it would be most helpful. My inference is that only the second last partition (p35) will have a different size.

By my quick calculation, there is 15276038KB being unused, or ~14.5GB. I don't know what partition is p36 though, and that may be a problem. The way I would go about it is to backup p36, remove it, extend p35 (i am assuming your userdata) by 14GB, recreate p36, (in this case it has to be exactly the same size as it was, for the) dd restore.

That still leaves a little over 1/2 a GB of wasted space, but it gives room for calculation error.

Also, I got your PM, still working my way through it, and I may have answered most here. If you want to avoid the offtopic, can start a new thread in the G2 Q&A and then report your posts here to be moved there (I think the mods are able to do that). I like to keep technical stuff in the forums. :cowboy:
[G2 Android Development] Kornelije23:
Thanks a lot mate. Well I do not know will I use regular method, or try using this, I think it is safer with regular I ll wait for new flash tool because my phone stuck at 2%. Thanks for your help again, and sorry for bothering you with messages.
[G2 Android Development] danon.brown:
Kind of off topic since this thread is to restore. However does anyone know how to delete the EFS partition? I'm purposely trying to get rid of my imei info/number. I do have a backup and this is for a good cause.
[G2 Android Development] dodora3d:
I flash it and in twrp said done ... but i can't find /sdcard/EFS_Backup/!! but if go to twrp then install find it .. so how can get copy to PC ?
[G2 Android Development] mmd1907:
thank you very much . I made the backup. ı was worrying about imei while flashing.
[G2 Android Development] uttamsuthar459:
i have rooted my lg g2 vs980 verizon.

i have root my phone using twrp two days ago. but when i restart my phone it is always going bootloop and its appear only lg logo.and not going on phone starting home page.

show please suggest me what i do.
[G2 Android Development] Rammsteinfanat:
Friends, please help... At I need your help... Load please EFS BACKUP from VS980... I have no place to take more... if not difficult the QCN file too from VS980... I already long suffer with this phone... hope only for you. :crying:
[G2 Android Development] ajituchiha:
I seem to have found a way to destroy my EFS and now my IMEI is lost, would it be possible to restore someone else's EFS backup and then manually rewrite my IMEI ?
[G2 Android Development] MAILCOMX:
Hello,

I have a problem with lg g2 and I think the EFS partition is corrupt because it reboots very often when I turn on wifi or simply when it is overheated if I require it using data. I would like to know how I can repair that partition so that the files there are working better. This happened because I installed many roms for a day. I also tell you that I made a STOCK TOT flash to leave the device as the original factory. Still unstable. I have tried everything that is due and I just need to repair EFS please some help to fix EFS from my LG G2 F320K,
[G2 Android Development] ARDV:
after flashing d800 with tot i lost the imei of the phone

how to repair it?
[G2 Android Development] mouf32:
I have tried V1, V2 and now the Final.... all downloaded from the XDA app. And ran from the XDA Download folder.

Does it make a difference where the file is located when ran from TWRP?

---------- Post added at 04:27 PM ---------- Previous post was at 03:37 PM ----------

Just realized I have TWRP 2.6.3.1 installed.. Will download 2.6.3.2 and try again later....
[G2 Android Development] bos1:
delete
[G2 Android Development] autoprime:
try downloading it thru the mobile browser instead of the app. or try on your pc then move the zip onto the phone. it seems teh xda app corrupts downloads sometimes.
[G2 Android Development] mouf32:
Tried downloading using the barcode and downloading directly to my PC and transferring it. Still no dice. Haven't tried the newest TWRP yet though.
[G2 Android Development] mouf32:
Installed newest TWRP .2 and unchecked zip verification and it worked.
[G2 Android Development] somboons:
what' happen when EFS loss?
[G2 Android Development] jug6ernaut:
Phone(cell, ie calling, texting, data) cant work. EFS holds things like imei, mac address, basically the data that is unique to your phone.
[G2 Android Development] Michael77500:
I have many HTC devices and we didn't need to backup EFS, why we on LG devices ? Thanks :)

Envoyé depuis mon LG-D802 avec Tapatalk 4
[G2 Android Development] jug6ernaut:
Others could Answer this better then me. But basically on other devices the efs data was stored on its own partition. And there for safer then I the g2 where it is not saved on its own partition.
[G2 Android Development] somboons:
what is something do EFS loss ?
[G2 Android Development] atsfrnd:
for those who uses CWM Recovery i can confirm it's working fine with both efs1.img, efs2.img and the .zip file created under the EFS_Backup folder..

do you mean what to do if EFS are lost?

well if you had the phone's IMEI (which is usually comes with the box) bring the phone to the service center and get it fixed..
[G2 Android Development] somboons:
I mean.what does it make our phone loss EFS?
[G2 Android Development] tonyb81:
Just to clarify...the zip for all partitions includes efs right?
[G2 Android Development] autoprime:
yes, it's included in the "all partitions" backup... but does NOT pack them into a nice flashable zip afterwards like the original efs zip does.

modemst1 and modemst2 is efs.
[G2 Android Development] karstensson:
Hi!

I recently got in to some problem while restoring my cell to stock. Now my 32 gb phone is converted to 16 gb. It is not only on rom level but even TWRP shows the size of 10.66 gb. So my question is if i get an efs backup from a same model as mine, will i get my storage back?
[G2 Android Development] rfarrah:
Thanks for this. I didn't use your zip, but saw the new checkbox on TWRP. Now I just have to remember to copy it somewhere else. Excellent information and I appreciate the heads up!
[G2 Android Development] irish.iolar:
When you back up your phone with TWRP and click on EFS backup, does that cover everything that this does?
[G2 Android Development] diffstyle:
After the backup is created, I can see the folder through CWM recovery but am unable to see the folder EFS_Backup or backupz when i connected the phone after it boots to copy the 2 zip files, what option will allow me to view the files?
[G2 Android Development] suryad:
Same here can not find the folder . Anyone can help ?
[G2 Android Development] diffstyle:
No one really seems to care to give us an answer lol...
[G2 Android Development] rfarrah:
I'm running TWRP and I have four folders: efs1.emmc, efs1.emmc.win, efs2.emmc, and efs2.emmc.win.
[G2 Android Development] diffstyle:
I am on cwm
[G2 Android Development] autoprime:
the *.emmc/*.win files are made when doing the EFS backup in TWRP. My backup zip puts them elsewhere. TWRP and my zip pretty much do the same thing.. this thread was made before EFS Backup was added into G2 TWRP.

as for pulling the files off of the phone... I have no clue why you are unable to see the files while the phone is booted but I suggest just using ADB pull commands for grabbing the files while in recovery.

adb pull /sdcard/EFS_Backup/efsbackupflashable.zip
[G2 Android Development] diffstyle:
It's weird, when I navigate through CWM recovery I can see the folder and file but once my phone boots, I can not see that folder via any file explore. I'll try to use adb pull. But hope there is I way for me to do it with out using adb pull. When CWM does a backup, does it automatically backup my efs info like twr?

Edit: all good, I just use twrp as my recovery.