• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[GUIDE] Recover your IMEI in 9 steps.

Search This thread
Oct 18, 2009
27
250
Tehran
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.
 
Last edited:

maddada

Senior Member
Aug 2, 2011
172
70
Dubai - United Arab Emirates
Thank you very much for taking the time to write this helpful thread, but can you please tell us how your IMEI was changed to a fake one in the first place so that we don't have to go through all this?
 

kcaz

Senior Member
Oct 3, 2010
96
21
Had you already made a copy of your EFS folder before your IMEI was changed?
 

angelomaldito

Senior Member
May 26, 2011
299
70
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 copying 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 whether simply copying the whole folder would be enough for a eventual restoration. Would it?
 
Last edited:
  • Like
Reactions: bsvinod
Oct 18, 2009
27
250
Tehran
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.
 

superleeds27

Senior Member
Jun 21, 2010
5,442
716
Hull
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!
 

Schindler33

Senior Member
Oct 19, 2010
220
52
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.
 
Last edited:
Oct 18, 2009
27
250
Tehran
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.
 
Last edited by a moderator:

Schindler33

Senior Member
Oct 19, 2010
220
52
Do you know if there are providers that block your
IMEI? I do not have any problems with my carrier now but I will soon go to the states, and I don't know wether my phone will get blocked there.

Sent from my GT-I9100 using XDA App
 
  • Like
Reactions: rafeba

superleeds27

Senior Member
Jun 21, 2010
5,442
716
Hull
Im not messing with it at all. Basically just copied it onto my SD card and then onot my PC. That way i know i deffo have a backup if anything was to happen
 
Oct 18, 2009
27
250
Tehran
Do you know if there are providers that block your
IMEI? I do not have any problems with my carrier now but I will soon go to the states, and I don't know wether my phone will get blocked there.

Sent from my GT-I9100 using XDA App


I don't know any providers. but as a guess, I think some providers MAY block an irregular IMEI because of their security policy. but it's just a guess.
 

s_d123

Member
Aug 16, 2011
7
0
Help

My SGS 4G IMEI is corrupted showing some random symbols. Now I have taken backup of my EFS folder:(. EFS>root>afs>setings has .nv_state and nv_data.bin.
In IMEI folder there are only two files bt.txt and mps_code.dat.
Can it be repaired back to original IMEI? I don't have back up of my original EFS folder.
 
Oct 18, 2009
27
250
Tehran
I don't understand how you were able to apply the steps you describe to your case if you didn't have a backup of your original efs folder...

I didn't had a backup of my original EFS folder BEFORE IMEI CHANGE.

after my IMEI has been changed to the fake one, then I backed up my EFS folder and do the steps in the first post.

---------- Post added at 05:22 PM ---------- Previous post was at 05:13 PM ----------

My SGS 4G IMEI is corrupted showing some random symbols. Now I have taken backup of my EFS folder:(. EFS>root>afs>setings has .nv_state and nv_data.bin.
In IMEI folder there are only two files bt.txt and mps_code.dat.
Can it be repaired back to original IMEI? I don't have back up of my original EFS folder.

the Content of your IMEI folder is correct, we don't have any business with the IMEI folder's content.

but look at your EFS folder contents, find the file named " .nv_data " (no post-fix), then do the steps in the first post.

but NOTE: my SGS 2 is a GSM model, not the 4G model, so I cannot guarantee that this method works with your phone too as it did for me.

thank you
 

HorusEyE

Senior Member
Sep 8, 2010
176
8
Coimbra
Hi...

I don't understand very well what you mean by

NOTE THAT AT LEAST YOU MUST HAVE THE SHIPPED ORIGINAL EFS FOLDER ON YOUR PHONE


Do you mean that we should have the efs folder with the sud-folder and files structure as it was when the IMEI was not corrupted???

I.E.

/efs (dir)
nv_data.bin (file)
.imei (hidden file)
.nv_data.bak (hidden file)
.nv_data.bak.md5 (hidden file)
nv_data.bin.md5 (file)
nv_state (file)

/.android (hidden folder)

/imei (folder)
bt.txt (file)
mps_code.dat (file)
nvmac.info (file)


Another issue i'm facing is the fact that I can't do a chown radio:radio because i get the error that user/group radio does not exist...

And would this work for SGS I?
 
Last edited:

jcrompton

Senior Member
Nov 30, 2004
4,256
751
61
Hurricane, WV
Google Pixel 5
Like others I am confused.

I flashed a ROM night before last.
I ended up with a phone that wouldn't work and the fake IMEI number.
By some chance I was able to get my phone working again with HC-kTool by restoring a efs.tar file -- I have a number of efsxxxx.tar.gz files in a folder called EFS_BACKUP on my sdcard (I don't how it got there but there are various dates of these files).

Now my phone works with data on the ATT network but my IMEI number is still the fake one.

SOOOO -- if I DON"T have an original backup of my EFS folder (or at least one I'm sure of) HOW do I restore my origianl IMEI ???
 

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.