yashsingh1/xdaforums huggingface dataset:
[Galaxy S II Themes and Apps] clovek1:
this is the content of my /efs folder.

unfortunately, i can't mount it -rw for unknown reason.

# ls -a -l
ls -a -l
-rw-r--r-- root root 1 2010-12-31 16:00 cryptprop_rebootMode
-rw-r--r-- root root 0 2011-07-18 15:16 cryptprop_onetimeboot
-rw-r--r-- root root 3 2011-07-17 11:56 cryptprop_securewipedata
drwxrwxr-x root root 2000-01-01 01:03 .files
-rwx------ radio radio 2097152 2011-07-17 12:29 nv_data.bin
-rw-rw-rw- radio radio 1065 2010-12-31 16:00 nv.log
-rwx------ radio radio 32 2011-07-17 12:29 nv_data.bin.md5
drwx------ system system 2010-12-31 16:01 dmp
-rw-r--r-- system system 9 2010-12-31 16:01 cryptprop_applied_result
drwxrwxr-x radio radio 2011-05-21 04:10 imei
-rw-rw-rw- system system 6 2000-01-01 01:04 calibration_data
-rwx------ radio radio 1048576 2010-12-31 16:00 .nv_core.bak
-rwx------ radio radio 32 2010-12-31 16:00 .nv_core.bak.md5
-rwx------ radio radio 2097152 2010-12-31 16:00 .nv_data.bak
-rwx------ radio radio 32 2010-12-31 16:00 .nv_data.bak.md5
-rw-rw-rw- radio radio 1 2010-12-31 16:00 .nv_state
-rw-r--r-- system system 3 2011-07-17 03:00 cryptprop_persist.sys.lan
guage
-rwxrwxr-- radio radio 880 2010-12-31 16:02 redata.bin
-rw-rw-rw- system system 256 2010-12-31 16:00 edk_p
-rw-r--r-- system system 18 2011-07-17 03:00 cryptprop_persist.sys.tim
ezone
-rw-r--r-- system system 6 2011-07-10 18:12 cryptprop_lock_pattern_au
tolock
-rw-r--r-- system system 6 2011-07-10 18:12 cryptprop_lockscreen.pass
word_type
-rw-r--r-- system system 5 2011-07-09 22:41 cryptprop_lockscreen.patt
erneverchosen
-rw-r--r-- system system 5 2011-06-19 09:09 cryptprop_lock_pattern_vi
sible_pattern
-rw-r--r-- system system 6 2011-06-05 00:53 cryptprop_lock_pattern_ta
ctile_feedback_enabled
#
[Galaxy S II Themes and Apps] clovek1:
finally i managed to get the /efs with -rw rights. but it didnt help, because all my *nv_data* files are probably allready corrupted.

here is the sequence:

busybox umount /efs
busybox mount -o rw -t ext4 /dev/block/mmcblk0p1 /efs
busybox mv .nv_data.bak nv_data.bin
busybox mv .nv_data.bak.md5 nv_data.bin.md5
[Galaxy S II Themes and Apps] EarlZ:
Is the backup function provided by nitrality good enough, or maybe someone could make an automated app to back it up as raw.
[Galaxy S II Themes and Apps] HellcatDroid:
It's only one command on the shell, do we really need an app for that? :confused:

If you have ADB on your comp you can even make a two-command batch that then via mouseclick copies the EFS raw backup directely onto your PC :D

Can't be much more convinient IMO.
[Galaxy S II Themes and Apps] sicopat:
Please, what is the exact command to restore the .img file ?

Thanks :D
[Galaxy S II Themes and Apps] HellcatDroid:
The raw image?

Either

dd if=/path/to/image.img of=/dev/block/mmcblk0p1 bs=4096

or

cat /path/to/image.img > /dev/block/mmcblk0p1

will do the trick.
[Galaxy S II Themes and Apps] Lownita:
Quick question: Would a Nandroid backup of any working state/rom do the restore too if the IMEI would get lost?
[Galaxy S II Themes and Apps] aydc:
Nope, efs doesn't get backed up or restored by nandroid, for safety reasons I think.
[Galaxy S II Themes and Apps] Thijs96:
Working on that, shouldn't take more than a few hours. That includes testing.
[Galaxy S II Themes and Apps] Lownita:
So did I get it right: I install Terminal Emulator on rooted phone, then open the console, type in

su (enter)

busybox cp -a /efs /sdcard/efs/ (enter)

then (restart because of freeze of app?)

su (enter)

busybox tar zcvf /sdcard/efs/efs-backup.tar.gz /efs (enter)

then

su (enter)

cat /dev/block/mmcblk0p1 > /sdcard/efs/efs_dev-block-mmcblk0p1.img (enter)

that's it?

I'm sorry but that is pretty much completely new to me :( .
[Galaxy S II Themes and Apps] anonymous572:
If I put file nv_data.bin from another galaxys2 to my galaxys2 - mac, imei, product code will be changes?
[Galaxy S II Themes and Apps] Thijs96:
Theoretically speaking yes. But there's a lot of risks involved, I wouldn't try it. Unless you make a backup of your original /efs first.
[Galaxy S II Themes and Apps] anonymous572:
Here's mine nv_data.bin if someone want to try change it. Write your test results.
[Galaxy S II Themes and Apps] prodygee:
I just don't have this folder. None of the sd-cards, not on the phone's storage. Is it hidden?
[Galaxy S II Themes and Apps] anonymous572:
Try ES File Explorer. Don't forget to enable root and system folder in options of ES File Explorer.
[Galaxy S II Themes and Apps] Rawat:
No. You'll end up with a dummy imei number because the new one doesn't match up with the original.
[Galaxy S II Themes and Apps] HellcatDroid:
Hi guys :)

I just finished my little companion tool for my kernel, it can also dump/backup and flash/restore the EFS via a simple tap onto a button.

(requires root, of course!)

Maybe some might find it usefull:

kTool.apk

(click for larger view)

More details about it in my kernel thread.
[Galaxy S II Themes and Apps] ratcom:
ok so I tried to restore via the adb commands and that resulted in no imei number however using your tool I sucessfully restored my save img :D

So thank you very very much for saving my phone and I would like to offer my wife as a reward should you ever be in central england lol
[Galaxy S II Themes and Apps] tuvi123:
What is the sizes of the RAW an CLEAN outout files?

mine is:

efs_dev-block-mmcblk0p1.img - 20.0 MB

efs-backup.tar.gz - 27.9 KB

is it normal?
[Galaxy S II Themes and Apps] HellcatDroid:
That looks about right.

Thae raw dump is.... well, a raw one. Byte by byte of the whole partition incl. unused space while the tarball is only a (even compressed) archive of only the actual files in it.

@ratcom:

Glad it helped :)
[Galaxy S II Themes and Apps] Liet Kynes:
Hi, I'm sorry because this is probably a very stupid question, but I know nothing about code and I really want to back up the /efs folder for safety reasons. What does the option 'v' (verbose) in the command 'tar' mean? Reading around, that is supposed to show the responses of the command I gave -sorry for my poor knowledge of technical terms- isn't it?
[Galaxy S II Themes and Apps] HellcatDroid:
using the -v flag on tar causes it to print the path/name of every file archived onto the screen.

Without -v it does its job silently.
[Galaxy S II Themes and Apps] Rawat:
HellcatDroid - I'm going to add a link and details about your app to OP [when I have time, been busy recently]. That's okay, right?
[Galaxy S II Themes and Apps] HellcatDroid:
Oh yes, perfectly OK, please do :)
[Galaxy S II Themes and Apps] tonycfc:
Reading the thread from page one to eight, I am very sure this question hasn't been asked before.

So, if I were to do a backup using CWM, is the /efs folder backed up as well? It is supposed to backup everything? Correct me if I am wrong here. ;)

@HellcatDroid

Your app will save a lot of people's ass, good work! Will donate to you when I have the funds, quite dry this month. ;)
[Galaxy S II Themes and Apps] Rawat:
A CWM backup doesn't backup /efs. Also, FWIW, I think it has been asked before, but I don't mind :)
[Galaxy S II Themes and Apps] tonycfc:
I've read a post about a Nandroid backup but I didn't think it was the same as a CWM backup? Sorry if they are the same.

Thanks for the info, just backed up my efs.img using Hellcat's tool, going to sync it all over the web for safe keeping! XD
[Galaxy S II Themes and Apps] JGS2:
Silly question but can I use your tool on any rom?
[Galaxy S II Themes and Apps] wql:
Restoring efs backup (It helped me when the phone is not working and imei is blank):

put your efs-backup.tar.gz in sdcard then in adb shell

su
umount /efs
mke2fs /dev/block/mmcblk0p1
mount -w -t ext4 /dev/block/mmcblk0p1 /efs
busybox tar zxvf /sdcard/efs-backup.tar.gz -C /

Restart phone
[Galaxy S II Themes and Apps] ricey1986:
can i run these commands using terminal emulator on my phone?
[Galaxy S II Themes and Apps] Rawat:
Yes, 10char
[Galaxy S II Themes and Apps] Hunteres:
great work. thumbs up
[Galaxy S II Themes and Apps] tonycfc:
I've used Hellcat's kTool.apk and a terminal emulator on the device itself to backup the efs.img. What I found out was two of them have different MD5 values. Hmm, doubting it now.

But I was using another ROM when I backup-ed my efs using kTool though.
[Galaxy S II Themes and Apps] koolshubh:
Is backing up EFS folder using the Rawats method same as using HellCats method..
[Galaxy S II Themes and Apps] HellcatDroid:
All the App does is a dd from the EFS partition into an image file.

So it should produce the same result as the cat method described in the first post :)

If anyone has doubt or worries, I can post the source.
[Galaxy S II Themes and Apps] dazstoke:
Ok I have lost my IMEI number I do have a backup of my efs folder that was made by criskekelo rom but is not an image.

I have tried everything I can find to no avail please can someone help me I am on kh3 stock now with cfroot and busybox installed but cannot get my efs folder as R/W to copy bk the backup (tried root explorer and es file manager).

How can I change the permission to R/W or edit the image made using this method in here to backup?

I'm using terminal emulator

any help greatly recieved ty.
[Galaxy S II Themes and Apps] HellcatDroid:
busybox mount -o rw,remount /efs

If you're still getting IO errors after that, the filesystem is corrupted and needs to be reinitialized/formatted.
[Galaxy S II Themes and Apps] dazstoke:
Ok thanks so now I should be able to just copy and paste into efs :)

should I just copy the whole folder???

Ok done that just rebooting (fingers crossed)

wierd how it happend my phone locked up last night when I was entering the simlock pin, I left it for 10 mins but it was still frozen so I powered down and rebooted. It never asked me for a pin and has not read a sim card since, then today I noticed my imei number was gone :(

No it's still not registering my sim or imei.

any suggestions
[Galaxy S II Themes and Apps] dazstoke:
Just noticed theres a new folder inside efs now called lost and found but its empty.

ok thats not there now think I'm gonna need to buy a jig aqnd give it bk to sammy
[Galaxy S II Themes and Apps] sewe:
long shoot but juwes rom at SGS there were many who had their imei unknown, solution: flash the modem/another modem
[Galaxy S II Themes and Apps] inkyadrian:
My imei was lost; I deleted the folder. Samsung told me to take it to Carphone ****ehouse, which I did. They installed the operating system. Same imei! I contacted Samsung by phone. They are waiting for a part???

,
[Galaxy S II Themes and Apps] dazstoke:
slight development now I have managed to revert to the sgs2 generic imei so I guess I'm at least 1 step closer lol

I have tried different roms/modems gonna try a later efs backup now to see if that has my right imei number ffs
[Galaxy S II Themes and Apps] dazstoke:
You mean the Sammy generic 1?

just glad I can recieve calls again now phew
[Galaxy S II Themes and Apps] dazstoke:
Is it not possible now I have an imei number to navigate and change it manually to the right 1? surely fixing it can't be illegal pmsl
[Galaxy S II Themes and Apps] dazstoke:
Fixed and back to original imei now thx to all those who gave assistance
[Galaxy S II Themes and Apps] tonycfc:
Used kTool to backup the efs.img every time I go to a different ROM and found out MD5 sums are different. Sure this is okay? :)
[Galaxy S II Themes and Apps] HellcatDroid:
Assuming the system updates and/or stores some data on it, this is to be expected, yes.

Thing is that no one really knows what's all stored in the EFS and how the thing works exactely....
[Galaxy S II Themes and Apps] Northern-Loop:
Says server down for me.
[Galaxy S II Themes and Apps] rickytenzer:
Thanks for the warning. I personally thought the EFS was wiped the second you flashed a custom ROM (don't know where I read that) until I was reading things like "EFS wiped, couldn't get signal" so I looked and saw my IMEI number in system status prompting me to back that **** up ASAP!
[Galaxy S II Themes and Apps] inkyadrian:
Always back up your imei. I learnt the hard way. As far as I know, if you delete that folder, efs, you are knackt.
[Galaxy S II Themes and Apps] ricey1986:
Okay im trying to run these commands using terminal emulator. But no matter which command i run it keeps returning saying cant open no such file or directory. Any ideas? Ive backed up using insanity app but want a full backup incase i lose it and have trouble restoring it using the app
[Galaxy S II Themes and Apps] KennyLegend:
I'm getting this too.
[Galaxy S II Themes and Apps] ricey1986:
Okay i got rid of that message by installing the latest busybox. But now when i enter the command its just giving me a list options and not actually backing up. Any ideas? Also what size is the folder when backing yp using hellcats app? even getting the same thing when using adb? And ive triple checked that ive wrote the command down correctly
[Galaxy S II Themes and Apps] ricey1986:
ok im getting severly annoyed now (i have no patience lol) anyway ive managed to do the basic and the raw one but whenever i try to do the clean option, it show invalid option and shows me a load of options. If i have managed the RAW option do i not need to do the other two?

Ricey
[Galaxy S II Themes and Apps] HellcatDroid:
The raw one (the one via "cat" or "dd") is the best one IMO, as it's a 1:1 copy of every byte of the partition and can be restored no matter of the current state.

In other words, yeah, that should be good enough :)
[Galaxy S II Themes and Apps] ricey1986:
Cheers hellcat ill just stick with that. Is it just the one img file?
[Galaxy S II Themes and Apps] KennyLegend:
Ricey

where did u get the hellcat app ? I've checked the market.

I cant seem to get rid of that error with terminal emulator. I've used nitrality app alright but I'm not sure that's good enough.
[Galaxy S II Themes and Apps] ricey1986:
got it from his kernel thread:

http://xdaforums.com/showthread.php?t=1182922

Think it basically does the same as the nitrality app though.

Ricey

Hit thanks if it helped.
[Galaxy S II Themes and Apps] miketwn:
The apk is in his kernel thread here http://xdaforums.com/showthread.php?t=1182922
[Galaxy S II Themes and Apps] koolshubh:
Successfully backed up my efs folder..

Thanks for the great work...
[Galaxy S II Themes and Apps] randy_khoo:
Hi there,

I'm rooted, but i seem to have hit a wall with this backup

Whenever i type SU, the icon chances to #. Good..

But whenever i command it to backup,

It says operation not permitted, cp: can't preserve ownership of XXXXXXXX
[Galaxy S II Themes and Apps] tshoulihane:
That means the copy succeeded, but because you are copying to FAT32 rather than a linux filesystem, the permissions have not been set.
[Galaxy S II Themes and Apps] jh3ss:
i did get this efs-backup.tar.gz but when i open it using winrar theres nothing on it??

but when i erase the .gz than i open it again using winrar i saw this file efs-backup, is that what i supposed to do efs-backup.tar put this in the PDA section then flash it ??

how about this??

cat /dev/block/mmcblk0p1 > /sdcard/efs/efs_dev-block-mmcblk0p1.img >> sorry to ask, what is the use of this??

thanks,,,

the reason why i asked this is because i did get an error while doing this command but i still continue.. i still get that 2 file

efs-backup.tar.gz

efs_dev-block-mmcblk0p1.img

galaxy ace

custom rom: gingerreal v1.0kph

2.3.4
[Galaxy S II Themes and Apps] inkyadrian:
Nitrality and Revolution ROM have the availability to back-up efs folder.
[Galaxy S II Themes and Apps] koolshubh:
Can any one tell me the procedure to restore the efs back to the original directory in case imei gets corrupted/lost??

Thanks...
[Galaxy S II Themes and Apps] technotika:
easiest way just use hellcats app listed in this thread

back up & restore (if needed) (save in dropbox like a few have)

---------- Post added at 11:46 AM ---------- Previous post was at 11:44 AM ----------

Can I run a scenario by some one

I mash my phone by wiping EFS or what ever

need to JIG, download mode, and put some stock back on.......

THEN either use term emulator to restore clean/raw back up

or even KTOOl to restore if got a back up using that

is that the right idea????
[Galaxy S II Themes and Apps] dickie2007:
in case anyone has an IMEI issue caused by a corrupt /efs, like i did, where they cant connect to the network but still have the /efs folder and contents, i have listed the method i used to fix it in my thread: http://xdaforums.com/showthread.php?t=1261948

hope this helps someone, took 2 days of messing to get it sorted...

Dickie
[Galaxy S II Themes and Apps] mfenix130:
guys i accidently deleted all the files inside /efs while messing with root explorer.Now the /efs folder is empty. in the /efs folder it says 4.04mb used and 15.64mb free.

but i had done backup (both clean and raw).

What should i do ??

i still have signal (am receiving text messages).
[Galaxy S II Themes and Apps] donalgodon:
Can one use hellcat's app with any kernel to back up the efs folder, or is hellcat's kernel required to use the companion app to backup the efs?
[Galaxy S II Themes and Apps] cooza:
You can use hellcats app on any kernel.I went and checked it out.Download and un-zip to get the apk. file.I just installed and backed up my efs file.Easy as!!!!!

http://xdaforums.com/showthread.php?t=1182922

It tells you there.scroll down to ktool download.Or if you want,here it is.

http://f.lui.li/get_99_f13d.html
[Galaxy S II Themes and Apps] inkyadrian:
Looked at my efs and it is 4 megs-ish
[Galaxy S II Themes and Apps] Mastermnd:
Ok I know this has been mentioned by hellcatdroid somewhere in the thread, but I'm going to nag about it now, because the first post is not corrected.

how can this be called "RAW" if you're using cat? It does text conversion! To be sure, better use dd.

Thanks for the good advice though. I have backed up :)
[Galaxy S II Themes and Apps] SalvoIX:
Hi Mastermnd, i'm not an expert of this kind of command, could you please report the whole strings to backup and if needed restore mmcblk0p1 using the dd command?

many thanks!
[Galaxy S II Themes and Apps] zenkinz:
cat does not do any conversion.....

-- Sent from my HP TouchPad using Communities
[Galaxy S II Themes and Apps] fibrook:
I have just taken a new out-of-the-box Galaxy S2, rooted it with an appropriate KG1 CF-Root, ticked USB-Debugging mode and entered Win 7 cmd.

This was the process and its results:

C:\Android-sdk\platform-tools>adb shell

* daemon not running. starting it now on port 5037 *

* daemon started successfully *

$ su

su

# busybox tar zcvf /sdcard/efs/efs-backup.tar.gz /efs

busybox tar zcvf /sdcard/efs/efs-backup.tar.gz /efs

tar: can't open '/sdcard/efs/efs-backup.tar.gz': No such file or directory

Why can't i complete the back up process?

I have tried both "clean" and "raw" options.

To mention that it is a new device without linking it to a Gmail account. Like i have mentioned - only taken out of the box, rooted and tried to complete this tutorial.
[Galaxy S II Themes and Apps] shadowofdarkness:
You have to make the efs folder first with

mkdir /sdcard/efs
[Galaxy S II Themes and Apps] hajduk000:
easy backup

I wonder if useful :)
[Galaxy S II Themes and Apps] panhavuth:
My phone become unknown base band and imei.and I have deleted efs folder.is there anyway to repair it.sorry that I can't search any answer to solve this problem.please help me on this.
[Galaxy S II Themes and Apps] inkyadrian:
If you have done a backup of the efs, then your ok. If you have no efs at all, then there is only one thing you can do. The phone most go to an authorised repairer chosen by Samsung. The phone must have the stock, unrooted rom installed. Hopefully you are within warranty and it will be repaired free of charge. This happened to me.
[Galaxy S II Themes and Apps] panhavuth:
So it finish for me. No authorized repairing center for samsung in cambodia.my phone not void warranty also.is there other way to do it myself? Your help would be much appreciate.
[Galaxy S II Themes and Apps] jay_993:
http://www.youtube.com/watch?v=rZzjt5zw9X0<< is this a fine way to do it as well?

http://www.youtube.com/watch?v=5PjP3pfgEWU<<video showing how to do it with nitrality. is this fine as well?

If they do, I feel this is an easier way for "noobs" like me lol
[Galaxy S II Themes and Apps] chickenhead:
I'm stuck! I appear to have lost baseband & IMEI, so I've been trying to restore the efs.img file I've had since I did a backup using Hellkats tool. When I do it, I get a message saying the EFS has been restored & I should reboot. After doing this, nothing has changed - no baseband in settings/about phone, no imei, no signal.

Any ideas?
[Galaxy S II Themes and Apps] koolshubh:
Thanks for this awesome guide.....

But can anyone give me the commands to restore it if in case I mess with efs folder....

Thanks....
[Galaxy S II Themes and Apps] mikengtw:
I think you have to check out Android Market first, and the review by the

users who have been installing it.. Not so good from review users reports, do

check out the link below..

https://market.android.com/details?id=com.nfye.insanity.toolbox&feature=search_result
[Galaxy S II Themes and Apps] Nepyk:
Like I understood I should do both Clean and RAW methods and basic isn't neccessary. Yes?
[Galaxy S II Themes and Apps] cooza:
all i get after hitting enter is a list of commands im not sure what to do with.i cant get this to work.Ive made the folders as suggested from other people and even selected "c" for create but nothing happens.Same with RAW aswell.
[Galaxy S II Themes and Apps] whobeit:
How did you get back to the original? i have efs backups but i'm stuck with the wrong imei, same as you were.
[Galaxy S II Themes and Apps] inkyadrian:
Put stock ROM on, the latest Kies one. Find it on xda. Take it back to whom you bought it off.
[Galaxy S II Themes and Apps] majinbooo:
thanks a lot for that, helped me backing that stuff up quite a lot.

well written
[Galaxy S II Themes and Apps] lyriquidperfection:
I have made a one click backup and restore tool especially for EFS which I will be releasing soon. It can backup efs to sdcard and also provides functions to backup and restore from pc. I will create a new thread in due course. Hope this will help alot of people out there! :)
[Galaxy S II Themes and Apps] cooza:
Dude,bring it on cos i cant get this thing to work no matter what i do.One more thing please dont make it like ktool which i used to back-up my efs and when i went to restore it wiped clean the back-up and root efs folders:eek:....Make it bullet proof dude and ill be the first to donate:D...ill even donate my wife,shes blonde:)
[Galaxy S II Themes and Apps] inkyadrian:
Already done. Make backup with Nitrality app.
[Galaxy S II Themes and Apps] lyriquidperfection:
EFS Pro

Here is my app to fully Backup and Restore your device's '/efs' folder.

http://xdaforums.com/showthread.php?t=1308546

Have fun! :)
[Galaxy S II Themes and Apps] KennyLegend:
Backed up with no issues.

I'm not sure how id check restore though :)
[Galaxy S II Themes and Apps] lyriquidperfection:
I checked the restore process during development by deleting all the files in the efs folder in root explorer. But as I took the risk an know it works, if backup worked then restore will also work! :)
[Galaxy S II Themes and Apps] KennyLegend:
And it sets permissions too on restore..yeah?
[Galaxy S II Themes and Apps] lyriquidperfection:
Of course! ;)
[Galaxy S II Themes and Apps] KennyLegend:
Excellent. Thanks man ;)