Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,742,912 Members 40,086 Now Online
XDA Developers Android and Mobile Development Forum

[REF] Backup /efs folder. IMPORTANT.

Tip us?
 
Rawat
Old
(Last edited by Rawat; 4th June 2011 at 08:50 PM.)
#1  
Rawat's Avatar
Senior Member - OP
Thanks Meter 533
Posts: 764
Join Date: Jun 2010
Location: London
Default [REF] Backup /efs folder. IMPORTANT.

This guide is based on a guide by Candanga on the i9000 forums, and some commands from supercurio
Please hit thanks on their posts and show them some love for the write up.

-----------------------------------------------------------------------------------------------------------------------

I’ve compiled a quick guide to instruct how to make a copy of the /efs folder. I’ve found in many threads suggestions about backing up this folder but the methods itself are very general. Most of the times they suggest to “root and copy the folder” with Root Explorer or similar, but usually it’s not that easy or it just doesn't work for everyone.

This guide ASUMES you have read this Excellent Guide by Darkstrikerfirst:
H E R E <-- Make sure to read the ADB Guide.

I recommend doing this with a Mobile just taken out of the box or with any Official ROM of its Service Provider. If you have already Flashed your phone with another ROM but its working fine, then you can use that /efs also.

Why the /efs folder?
This is a very sensitive system folder that contains Phone-specific information such as the IMEI (encrypted in the nv_data.bin), wireless devices MAC addresses, product code (also in the nv_data.bin), and much more. Often users trying to change product codes or trying to unlock the mobile will end up corrupting data in this location.

Why back it up?
Well, let’s resume it saying that backing-up this little folder will keep you away from Samsung service centres.

***WARNING: I take no responsibility to any damage caused by the methods cited and/or written here. Their sole purpose is to back-up data and not to alter in any way the integrity of the original files of the mobile***

What you will need:
  • Rooted SGS II to get permissions as a SU (Super User) and perform the backup
  • I would suggest learning a little about the terminal commands used (in case you are not familiar with them), as it’s better to know what you are doing rather than typing strings like a little chimp without knowing what they are; if you are a little lazy, then you have a good chance bricking your mobile. <- Busybox Commands(or Google them)

The standard prompt of terminal (adb) is a $ sign. Once you enter “SU” it will become a # Sign.

***NOTE: Make sure to keep an eye on the screen of your SGS II during this process, because it may request SU permissions [currently doesn't on CF-root]; else, you will get an error (just if it’s the first time). In Terminal Emulator you will need to reset the app after granting permissions cause it usually freezes***

*Remember: to use ADB you need to enable USB DEBUGGING under Applications/Development in your SGS II.

Here are 3 methods, I recommend that you do both Clean and RAW.

Basic, unix permissions lost :
Code:
Select Code
su
busybox cp -a /efs /sdcard/efs/
Clean :
Code:
Select Code
su
busybox tar zcvf /sdcard/efs/efs-backup.tar.gz /efs
After this, you will end up with the file efs-backup.tar.gz in your INTERNAL SDCARD in sdcard/efs/, which is a “tarball” or a ZIP of the /efs folder. That file is your backup. You can expand it with Winrar.

You can also back up the mmcblk0p1 (where /efs is stored) under /dev/block which can greatly support in recovering your IMEI in case of a screw-up:

RAW :
Code:
Select Code
su 
cat /dev/block/mmcblk0p1 > /sdcard/efs/efs_dev-block-mmcblk0p1.img
Same thing, the target is the INTERNAL SDCARD in sdcard/efs/, so go ahead and copy the file.
The Following 91 Users Say Thank You to Rawat For This Useful Post: [ Click to Expand ]
 
Elite GunnerX
Old
#2  
Member
Thanks Meter 16
Posts: 89
Join Date: Aug 2010
Location: Austin, Texas
+1 just do it....
Google
The Following User Says Thank You to Elite GunnerX For This Useful Post: [ Click to Expand ]
 
JJEgan
Old
#3  
Senior Member
Thanks Meter 4416
Posts: 23,036
Join Date: Oct 2010
Can this not be tasked by using a root file explorer and copying efs folder as i have always done .

jje
 
Rawat
Old
(Last edited by Rawat; 7th May 2011 at 07:45 PM.)
#4  
Rawat's Avatar
Senior Member - OP
Thanks Meter 533
Posts: 764
Join Date: Jun 2010
Location: London
Quote:
Originally Posted by JJEgan View Post
Can this not be tasked by using a root file explorer and copying efs folder as i have always done .

jje
From the thread:
Quote:
I’ve found in many threads suggestions about backing up this folder but the methods itself are very general. Most of the times they suggest to “root and copy the folder” with Root Explorer or similar, but usually it’s not that easy or it just doesn't work for everyone.
And just copying the folder won't preserve permissions etc.
 
RyanZA
Old
#5  
Senior Member
Thanks Meter 732
Posts: 2,021
Join Date: Jan 2006
Location: JHB
Quote:
Originally Posted by JJEgan View Post
Can this not be tasked by using a root file explorer and copying efs folder as i have always done .

jje
As long as you don't copy it to /sdcard, because it's VFAT and you'll lose the permissions settings on the files. If you copy it to /data or something then that's fine.
The Following User Says Thank You to RyanZA For This Useful Post: [ Click to Expand ]
 
Rawat
Old
#6  
Rawat's Avatar
Senior Member - OP
Thanks Meter 533
Posts: 764
Join Date: Jun 2010
Location: London
bumpity bump
 
JJEgan
Old
#7  
Senior Member
Thanks Meter 4416
Posts: 23,036
Join Date: Oct 2010
Quote:
Originally Posted by RyanZA View Post
As long as you don't copy it to /sdcard, because it's VFAT and you'll lose the permissions settings on the files. If you copy it to /data or something then that's fine.
Thanks the SGS 1 EFs i copied was copied to external sd card and then copied off to PC . Did likewise on SGS 2 using Super Manager .
So according to what you are saying that was not going to back up if needed .

jje
 
RyanZA
Old
#8  
Senior Member
Thanks Meter 732
Posts: 2,021
Join Date: Jan 2006
Location: JHB
Quote:
Originally Posted by JJEgan View Post
Thanks the SGS 1 EFs i copied was copied to external sd card and then copied off to PC . Did likewise on SGS 2 using Super Manager .
So according to what you are saying that was not going to back up if needed .

jje
It would probably have worked, but it would have made your EFS files readable and writable by any app that tried - not the end of the world since it's unlikely that any apps would try, but you still might as well avoid it if you can. I don't think there are any executables in EFS or anything that this will actually break though.
The Following User Says Thank You to RyanZA For This Useful Post: [ Click to Expand ]
 
JJEgan
Old
#9  
Senior Member
Thanks Meter 4416
Posts: 23,036
Join Date: Oct 2010
Thanks i did lose IMEI at one flash on SGS1 but a second flash recovered it .
I do like full backup of original firmware and anything else before playing with phone .

jje
 
Rawat
Old
#10  
Rawat's Avatar
Senior Member - OP
Thanks Meter 533
Posts: 764
Join Date: Jun 2010
Location: London
I've done all 3 forms of backup myself. . Clean, raw and basic

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes