[GUIDE] Recover your IMEI in 9 steps.

Search This thread

ammadeusy

Member
Aug 2, 2012
25
1
If you did not make any backup of your EFS folder, and your IMEI is messed up, this could be your solution to recover your lost IMEI.

in case of Galaxy Nexus (or X, or Nexus 3, or i9250) the IMEI is not stored on /efs, rather it is in /factory with lots of other important files.

root@maguro:/factory # ls -al
drwx------ root root 1969-12-31 21:00 lost+found
drwxrwx--- system radio 2014-01-24 15:30 wifi
drwxrwxr-x radio radio 2014-01-24 15:32 imei
-rwx------ radio radio 1048576 2014-01-24 16:09 .nv_core.bak
-rwx------ radio radio 32 2014-01-24 16:09 .nv_core.bak.md5
-rwx------ radio radio 2097152 2014-01-24 16:09 .nv_data.bak
-rwx------ radio radio 32 2014-01-24 16:09 .nv_data.bak.md5
drwxr-xr-x radio radio 2014-01-24 16:09 bluetooth
-rw------- radio radio 1 2014-01-24 16:09 .nv_state
-rwx------ radio radio 2097152 2014-01-24 16:10 nv_data.bin
-rw------- radio radio 381 2014-01-24 16:09 nv.log
-rwx------ radio radio 32 2014-01-24 16:10 nv_data.bin.md5


Jan 24 17:30:43 2014 is date when my IMEI was restored

it is very odd that ../wifi and ../imei are created first. and only after half hour later the other files. have no idea why.
if you cross reference the exact times of the process with the other log (see below) maybe few assumptions can be made.
consider time difference between then (maybe the to share different coordinates in the globe, cause one is 2 hours dettached from the other LOL).

contents of /factory/.nv.log

cat nv.log
Fri Jan 24 17:30:43 2014: MD5 is turned on.
Fri Jan 24 17:30:43 2014: nv_data.bin does not exist.
Fri Jan 24 17:30:46 2014: default NV restored.
Fri Jan 24 17:30:47 2014: default NV restored.
Fri Jan 24 18:09:25 2014: MD5 is turned off on 0
Fri Jan 24 18:09:27 2014: NV data back-up begin.
Fri Jan 24 18:09:27 2014: secondary NV built.
Fri Jan 24 18:09:27 2014: NV data back-uped.


conclusions:
at xx:30 ../wifi was created, MD5 was turned on, no NV was found, two new NV were created (perhaps nv_core and nv_data.bak) and then ../imei was created.
at xx:09 (39 mins later) ../bluetooth/.nv_state was created and set to 0 (whilst MD5 was turned off on 0), backups and secondary NV was created.

for further reference here are some details that may help:
** directories wifi and bluetooth only stores MAC ADDRESSes of those network adapters
** .nv_data.bak equals nv_data.bin, and so equivalent *.md5
** .nv_state equals 0, dunno why
** directory imei store a file called mps_code.dat that contents ZTO, due mine is brazilian edition

contents of /data/radio
root@maguro: # ls -al /data/radio
drwxrwxr-x radio radio 2014-01-24 20:37 log
-rwx------ radio radio 2097152 2014-01-24 22:14 nv_data.bin
-rwx------ radio radio 32 2014-01-24 22:14 nv_data.bin.md5

root@maguro: # cat /data/radio/log/nv.log
cat nv.log
Fri Jan 24 22:37:04 2014: nv data does not exist (GED)
Fri Jan 24 22:37:04 2014: nv data does not exist


/data/radio is always rewritten every boot, meaning there is no way to define based on log files what is its purpose in the process of repairing IMEI code. one can conclude that based on Jan 24 22:37:04 2014 file log, moment of latest boot up log.

the story behind this post
I have formatted my /factory contents thinking about privacy matters since i was about to sell my nexus, resulting in generic IMEI (004999010640000).
tried this and this method for recover. but none resulted ok.

/data/radio do create new nv_data* files every boot but it cannot check with an empty /factory, that's why there is no way to restore it other than with side hardware recalculating.

i had it to service repair. they did not used "the box" rather samsung's own equipments. someone was wondering on how IMEI MD5 was calculated and stored in nv_bin files. The fact is that IMEI is calculated with side hardware and inserted into /factory with chown radio.radio and chmod 700 to protect it. there is no script or blop inside Nexus' own sys files.

would like to thank all efforts the xda devs has granted on helping us, the desperated mobile brickers.
 
Last edited:

leo_hacker82

Senior Member
May 21, 2013
252
9
Men. If when i restore full firmware clean flash but no nvram either nv files are missing...what can i do...those important files doesnt restore alone in my phone anyway...what can i do...where can i get those files..
 

leo_hacker82

Senior Member
May 21, 2013
252
9
men, when i restored or make a clean flash with csc and pit file..i have efs but no nv_data or nv:ram file never appears on my phone..i have only emergency calls..i dont have warranty cuz knox is 0x1 what can i do..
 

rey691

New member
Jan 27, 2014
1
0
Not workin

not workin for me please helppppp im with no phone or almost a week dont know what to dooo
 

Sharcklol

Member
Jul 31, 2012
5
0
where is the EFS folder on the gt-i9300 International version? Is there anyway that I can download the folder or the files?
 

gastonw

Senior Member
Dec 19, 2012
5,266
1,758
What if i didnt backup the EFS folder? Is there anyway to recovery the EFS from reinstall the firmware or stuff?

90% you now have a mini sansung tab.

3% you can get it back by flashing your original ROM (device's original Country/Region at least)

7% you could flash another EFS partition and hope for a generic IMEI.

Sent from the little guy
 

Sharcklol

Member
Jul 31, 2012
5
0
90% you now have a mini sansung tab.

3% you can get it back by flashing your original ROM (device's original Country/Region at least)

7% you could flash another EFS partition and hope for a generic IMEI.

Sent from the little guy

I have another s3, can I copy the EFS folder to this one(with problem)?
 

gastonw

Senior Member
Dec 19, 2012
5,266
1,758

Sharcklol

Member
Jul 31, 2012
5
0
You guys can start forgetting about those S3, different partition layout hence, outta the question.

Search the forum (can't remember where it was, Q&A or General), there was a brazilian guy who posted his nv data file back in 2012.

I guess you are wrong, i fixed my phone doing what i said before, copying the efs folder of another s3 and then i did the 9 steps.
 

ocirne14

Member
Nov 10, 2012
9
1
If you did not make any backup of your EFS folder, and your IMEI is messed up, this could be your solution to recover your lost IMEI. NOTE THAT AT LEAST YOU MUST HAVE THE SHIPPED ORIGINAL EFS FOLDER ON YOUR PHONE ( even if you didn't make a backup of it yet and even it's messed up ) FOR THIS METHOD TO WORK

My history with my IMEI:

I flashed my phone with some ROMs, and I didn't backup my EFS folder before, then My SGS2 IMEI was changed to 004999010640000, and we know this is the fake IMEI that is assigned to the phone if the nv_data.bin file is messed up.
so I researched. searched all the forums and didn't find anything that could cure my phone's IMEI and set it to the original IMEI number. so I experimented and after some hours, I fixed my IMEI.
one thing that led me to the conclusion that " .nv_data " file is the thing that I need to fix the IMEI is that they share a very look alike name, and they have the same 2MB size.

PS: I restored my phone's firmware to it's original PDA, Phone and CSC, rooted it with CF-Root, and then done this procedures below

here is what I have done:

you must have:
-Root
-Root explorer for copying files to and from EFS folder
-Android SDK for the ADB tools or Terminal in your phone.


It is interesting to know that the IMEI is stored in ".nv_data" file in ORIGINAL SHIPPED EFS folder too, so you just have to do these:

1) make a copy of your EFS folder to your sdcard using root explorer and then make a backup of the folder to your computer [ to have another copy if you had to format sd card sometime ]

2) delete the EFS folder (BE SURE YOU HAVE BACKED IT UP IN A SAFE PLACE AS SAID IN STEP 1) from the root of your phone using root explorer.

3) reset the phone, after that, go to the root, and you can see that the EFS folder is still there, don't make any mistake, this EFS folder is new and generated by the android OS.

4) go to EFS folder using root explorer, and delete "nv_data.bin", "nv_data.bin.md5".

5) go to your backed up EFS folder on your sdcard, copy the "imei" folder to the EFS folder at the root of your phone, then again go to the backed up EFS folder at yout sdcard and copy the " .nv_data " file to your EFS folder at the root of your phone using root explorer, NOTE: the dot in first of nv_data is not a mistake, copy the ".nv_data" file.

6) make another copy of the ".nv_data" file in EFS folder in your phone, so you would have 2 copies of ".nv_data" in EFS folder

7) rename one of ".nv_data" files to "nv_data.bin" and another one to "nv_data.bin.bak"

8) at your PC open CMD at the ADB tool path, or run Terminal at your phone enter these commands:

adb shell ( use this command of you use ADB, if you're using terminal, skip this line )
su ( ALLOW THE MESSAGE CAME AT YOUR PHONE's DISPLAY BY SUPERUSER PROGRAM )
chown 1001:radio /efs/nv_data.bin

9) reset your phone.... after that you have your original IMEI. you can check your IMEI by dialing *#06#.


and DO IT ON YOUR OWN RISK.
and PLEASE MAKE A COPY OF THE ORIGINAL EFS FOLDER BEFORE DELETING IT. IT HAS IMPORTANT FILES IN IT.
and sorry for bad English.




I tried these steps but I cannot find ".nv_data" file, I only have .nv_data.bak, .nv_data.bak.md5, .nv_data.bin and .nv_data.bin.md5. Is it one of them or am I just missing the point? Sorry for being a noob, I just need help badly. :crying::crying::crying:
 

Top Liked Posts

  • There are no posts matching your filters.
  • 241
    If you did not make any backup of your EFS folder, and your IMEI is messed up, this could be your solution to recover your lost IMEI. NOTE THAT AT LEAST YOU MUST HAVE THE SHIPPED ORIGINAL EFS FOLDER ON YOUR PHONE ( even if you didn't make a backup of it yet and even it's messed up ) FOR THIS METHOD TO WORK

    My history with my IMEI:

    I flashed my phone with some ROMs, and I didn't backup my EFS folder before, then My SGS2 IMEI was changed to 004999010640000, and we know this is the fake IMEI that is assigned to the phone if the nv_data.bin file is messed up.
    so I researched. searched all the forums and didn't find anything that could cure my phone's IMEI and set it to the original IMEI number. so I experimented and after some hours, I fixed my IMEI.
    one thing that led me to the conclusion that " .nv_data " file is the thing that I need to fix the IMEI is that they share a very look alike name, and they have the same 2MB size.

    PS: I restored my phone's firmware to it's original PDA, Phone and CSC, rooted it with CF-Root, and then done this procedures below

    here is what I have done:

    you must have:
    -Root
    -Root explorer for copying files to and from EFS folder
    -Android SDK for the ADB tools or Terminal in your phone.


    It is interesting to know that the IMEI is stored in ".nv_data" file in ORIGINAL SHIPPED EFS folder too, so you just have to do these:

    1) make a copy of your EFS folder to your sdcard using root explorer and then make a backup of the folder to your computer [ to have another copy if you had to format sd card sometime ]

    2) delete the EFS folder (BE SURE YOU HAVE BACKED IT UP IN A SAFE PLACE AS SAID IN STEP 1) from the root of your phone using root explorer.

    3) reset the phone, after that, go to the root, and you can see that the EFS folder is still there, don't make any mistake, this EFS folder is new and generated by the android OS.

    4) go to EFS folder using root explorer, and delete "nv_data.bin", "nv_data.bin.md5".

    5) go to your backed up EFS folder on your sdcard, copy the "imei" folder to the EFS folder at the root of your phone, then again go to the backed up EFS folder at yout sdcard and copy the " .nv_data " file to your EFS folder at the root of your phone using root explorer, NOTE: the dot in first of nv_data is not a mistake, copy the ".nv_data" file.

    6) make another copy of the ".nv_data" file in EFS folder in your phone, so you would have 2 copies of ".nv_data" in EFS folder

    7) rename one of ".nv_data" files to "nv_data.bin" and another one to "nv_data.bin.bak"

    8) at your PC open CMD at the ADB tool path, or run Terminal at your phone enter these commands:

    adb shell ( use this command of you use ADB, if you're using terminal, skip this line )
    su ( ALLOW THE MESSAGE CAME AT YOUR PHONE's DISPLAY BY SUPERUSER PROGRAM )
    chown 1001:radio /efs/nv_data.bin

    9) reset your phone.... after that you have your original IMEI. you can check your IMEI by dialing *#06#.


    and DO IT ON YOUR OWN RISK.
    and PLEASE MAKE A COPY OF THE ORIGINAL EFS FOLDER BEFORE DELETING IT. IT HAS IMPORTANT FILES IN IT.
    and sorry for bad English.
    6
    The entire process has been coded into an apk avaible on the market by Helroz
    It's called SGSII_repair
    It's just saved my phone.
    4
    hello,
    Unfortunately I have lost my imei. Now I would like to save my S2 with the above instructions. but in step 4 I'm getting nowhere. root explorer can not delete the data set and no rw. In the the root folder it is possible to mount zu rw.

    what can that be?
    sorry for my english

    Hey mate,

    I just yesterday had the exact same problem - fortunately, I was able to fix it.

    Now, do you have any .bak files in your directory? The file that saved me was the .nvdata.bin.bak - so the systemmade backup of the original nvdata.

    As I could NOT delete the .bin and NEITHER get the rw rights (via rootexplorer, adb, anything), I went to formatting the whole efs part with kTool
    (market.android.com/details?id=net.hellcat.droiddev.ktool - can't link it because of restrictions of the board). The option for efs format is under the advanced options tab. Before you do that - make sure you get backups of your current efs folder on sdcard AND pc! Without having any .bak files - don't go this way, as things are different than for me, then!

    After I formatted the efs (whose filesystem was corrupt I wager) and rebooted, I got the generic efs and the 0049 IMEI. Now at that stage I was able to delete everything and change rights of everything via rootexplorer, so this is when you should start to follow the instructions in the OP again. Totally saved me - and I never had a backup of my efs before I encountered the problem.

    Hope that helps, mate!
    4
    I do not have the .nv_data file. onle *.bin or *.bak. Any suggestions or do I have to stick with the generic 00... IMEI? The whole procedure did not word for me, but thanks anyway.


    By the way I think you do not need adb for that. You can execute the chmod command in a Terminal editor on the phone.

    yes you can use terminal in your phone, but as for information for the other users, you don't need to enter " adb shell " command in step 8, because you are already connected to the phone's kernel.

    I think you deleted your original EFS folder that came preinstalled with your phone, because I had " .nv_data " file.

    anyway, use " nv_data.bin.bak " instead of " .nv_data " and see what happens.

    thanks for the update. ;)

    ---------- Post added at 07:55 PM ---------- Previous post was at 07:53 PM ----------

    Have copied the efs folder onto my PC.

    At least i now know i have a backup, i can mess about with permissions there and then if it ever comes down to it!

    thank you for your reply. but please don't play with EFS folder too much. the Android OS can't recover your IMEI if you lost it completely. I've been lucky with this method to restore my IMEI.

    thanks.
    4
    For the purpose of making a backup of the EFS folder, how about simply copying the whole folder into a safe place?

    There is an app called Nitrality (if my spelling is not wrong) which one of its various functions is to backup and restore the EFS folder. I've made a backup using this method and it seems that what the app actually did was simply to copy the whole folder into a different directory. If it's simple like that, it seems that Root Explorer or similar app would be enough for that purpose.

    Nevertheless, as there are numerous guides on this topic, all of which providing more complex methods, either using ADB or Terminal Emulator (i've made a backup using it as well, just in case, which resulted in the EFS being saved as tarball file), I have some doubts wheter simply copying the whole folder would be enough for a eventual restoration. Would it?

    Just copying your EFS folder to a safe place is enough, using any method, but copying EFS folder messes up wih its permissions, so if you want to restore your nv_data.bin file, you must set the owner of the nv_data.bin using "chown" command in ADB like described in my post.
    After all, I hope this method works for everyone, worked for me though.