[Galaxy S II Q&A, Help & Troubleshooting] dav pahwa:
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)

* Terminal Emulator by Jack Palevich (available from the market) <-Terminal Emulator or use ADB which is included in the SDK Development Tools

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:

su

busybox cp -a /efs /sdcard/efs/

Clean :

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:

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.

Hi theghost & thanks for replying. Yes, i had read that link . But being a starter in androids, i had some doubts n thought if someone else knows a more simplified thread. Eventually i followed the same thread only.

As the author said, there r two methods - clean & raw n he advises to use both. when u used raw , in the end comes- no such file directory exists. When i checked my files->sdcard , i could see efs folder n some files inside it (which wasn`t happening even with astro file manger) I copied the efs folder N pasted it into Externalsd folder (default Ext. sd card folder ?)

R my efs folder files safe now ?

Is there any other precaution to be taken , any files to be saved before i embark on installing New villain rom 2.0 as per instructions given here http://xdaforums.com/showthread.php?t=1081368 .

Strangely efs folder saving point isn`t mentioned here , even though its so important. (But then may be its very basic) Is there any other basic that i should know ?

Thanks a lot again.

with regards.