Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,809,814 Members 43,875 Now Online
XDA Developers Android and Mobile Development Forum

[REF] IMEI / EFS - Know this stuff (i9300) - including "no network"

Tip us?
 
rootSU
Old
(Last edited by rootSU; 21st November 2013 at 09:16 AM.)
#1  
rootSU's Avatar
Senior Member - OP
Thanks Meter 11,410
Posts: 22,446
Join Date: Aug 2010
Location: Oxenhope, West Yorkshire, UK
Default [REF] IMEI / EFS - Know this stuff (i9300) - including "no network"

Note from the Author -

I am moving on to the N5 now and ditching my S3. I will continue to maintain this thread, however - please do PM me if you think that something needs to be changed or updated in this thread as I doubt I will be answering questions within the thread as much. Please don't PM support questions to me. Only PM updates that need to be made in the thread.

It's been a blast!

Regards
Dan

Please read this thread. Do not dismiss the "send for repair" option. Please do not create further threads asking for help because "nothing worked". I have included everything we know to be a working fix. If nothing here fixed your issue, send it for repair. Don't create yet another pointless thread like the 10 others a day we have to read...

IMEI
A unique identification number programmed onto your phone. It is required in order to be correctly identified on a mobile network. Without one, you cannot make calls, send SMS or use mobile data. Important stuff.


/efs
A partition on your internal memory containing important data including the IMEI. If the data in this partition gets corrupt, you will lose your IMEI


0049*** or 0000 IMEI
A generic IMEI, meaning your real IMEI is not readable, presumably because it is corrupt but there are other reasons too.



This thread aims to give you as much basic information as possible in an attempt to prevent the 10 - 20 threads we're getting per day about this issue.



I have a 0049 or 0000 IMEI. Why?


This means your phone cannot read your IMEI. There are 2 main reasons for this.

1) /efs is corrupt.

Whenever you flash a ROM, be that a custom ROM via a custom recovery or an official ROM via Odin, you risk corrupting your /efs partition and losing your IMEI.

There are 3 main steps to take to try to resolve this
  1. Restore your EFS from a backup - A logical first step
  2. No backup? Reflash the latest stock ROM using Odin*
  3. Send the device for repair**

*Ultima rom users (prior to v15), first reflash the rom, choosing a non-stock kernel during the aroma install wizard first. Boefla is a good choice to test.

** a couple with "cannot mount /efs" errors have fixed their device by flashing ics. If you know you haven't got a VTU00M eMMC firmware 0xf1 - go for it. However for those of you who don't know, this would be extremely dangerous. You could get SDS so I do not recommend this action. If you are foolish enough to try it, flash 4.1.2 immediately afterwards.


2) /efs partition format changed

A quick note before going forward... when looking at a ROM build number, the last 3 characters mean Year, Month, Revision. Let's take XXEMG4 for example. M = 2013, G = July, 4 = revision 4. See "Other" section at the end of this post for more info

From July 2013 (XXEMG4) onwards, official Samsung ROMs change the format of your EFS Directory/Partition. Let's say these ROMs change from EFS v1 to EFS v2. Only basebands from July 2013 (MG2) onwards can read EFS v2.

Quick info rules:
  • EFS v2 Basebands can read EFS v2 and EFS v1
  • EFS v1 basebands CANNOT read EFS v2, ONLY EFS v1

This means if you have flashed an official ROM (or custom ROM based on official) From July 2013 (MG* or newer), you are now in a situation whereby only an EFS v2 baseband (MG* or newer) can read the IMEI in /EFS.


If you have ever flashed XXEMG* (or newer) ROM, to keep your IMEI working, you must:
  1. Stay with the EFS v2 basebands (MG* or newer). You may flash other ROMs but must return to the MG* (or newer) baseband
  2. Restore your EFS backup (taken before XXEMG* or newer ROM install) to use older (EFS v1) basebands. EFS backup must be an EFSv1 backup to use an EFS v1 baseband
  3. If the above don't work, consider sending for repair...


*Ultima rom users (prior to v15), first reflash the rom, choosing a non-stock kernel during the aroma install wizard first. Boefla is a good choice to test.

Please note, it is flashing the ROM that alters EFS format, not the basebands themselves. You can flash the MG* or newer basebands safely on their own and return to an older baseband without issue.

You can download an EFS v2 baseband (CWM) flashable package HERE - updated to MJ3 by @maatsby
  • Aroma installer, choose between MG2, MG4, MH1 and MJ3 basebands
  • Basebands alone do not alter efs format
  • Backs up EFS in an uncompressed format (Use Root Explorer to restore)
  • Does NOT include RIL, works on AOSP and Sammy

For discussion of the efs format issue, see this thread.

How do I backup and restore /efs?

There are a few methods to backup /efs, but they all require customisation of your phone. Either root access, or a custom recovery. I appreciate that many of you do not wish to root your phones and just want to flash official ROMs via Odin... Well here are your choices:
  1. Only use OTA or KIES to update (Official Method)
  2. Root using CF auto root / Framaroot - backup efs and THEN flash via ODIN
  3. Flash a custom recovery via Odin, backup efs and THEN flash a ROm via Odin
  4. Risk it. Don't backup efs. Simply flash via Odin and hope for the best


...and here are the options for backing up / restoring efs (this list is not exhaustive)

It's worth noting that some custom ROMs will give the option to backup efs, but you can never have too many backups!

.tar and .tar.gz backups can be extracted on /sdcard and then manually used to replace the files in /efs using a root explorer or adb as a last resort. Some people have reported more success deleting the /efs folder contents before hand. This is risky though, so only those of you who can backup the /efs with Philz recovery before trying this - should try it. Why Philz recovery backup the already broken EFS? well you can restore it if the phone doesn't boot and at least you are no worse off than before attempting this method. Messing woith EFS can cause your phone to not boot up so be CAREFUL!!!

Please see below for step-by-step instructions to restore a folder dump* of EFS using adb. Do so at your own risk!!!

This is useful if you cannot boot.

*An example of a folder dump would be an efs backup created using my mg baseband pack linked earlier in this thread.

 

Pre requisite is having adb "installed" on yoru windows PC. Download THIS file and follow the instructions in the readme.

1) Boot into recovery, connect usb and go to "mounts and storage". Toggle the "mount efs" and "mount data" options to mount these partitions. Tip, when mounted, the option then becomes "unmount x"

2) Open "cmd" in Windows and type "adb shell" to get to your adb prompt.

3) If you don't know where your efs folder dump is, you'll need to look for it using the list command. I know mine is on internal SD but I forget the name of it... (if you already have this on a computer, skip to step 4...

Code:
ls /data/media/0
lists all directories on my internal sd card. I now see it's called MG_EFS

Code:
exit
adb pull /data/media/p/MG_EFS c:\users\rootsu\desktop\MG_EFS
Now your folder dump is on your windows desktop.

It should look like this:



Please note at this stage, my MG_EFS contained dated folders each with backups. I took the content of one of these dated folders and dropped them directly inMF_EFS

4) type "adb shell" again to get into adb and check your efs contents is visible

Code:
ls -lh /efs
This will list your efs contents and permissisons:

Code:
-rw-rw-r--    1 radio    radio        152 Jan  1  2012 00000000.authtokcont
drwxr-xr-x    2 system   system      4.0K Aug 10 17:37 FactoryApp
drwxrwxr-x    2 radio    system      4.0K Aug 10 17:37 bluetooth
drwxrwxr-x    3 drm      system      4.0K Aug 10 17:37 drm
-rw-rw-rw-    1 system   system         6 Aug 13  2012 gyro_cal_data
-rw-r--r--    1 radio    radio       1.1K Jan  1  2012 h2k.dat
drwxrwxr-x    2 radio    system      4.0K Aug 10 17:37 imei
drwx------    2 root     root        4.0K Jan  1  1970 lost+found
-rw-------    1 radio    radio       7.6K Sep 10 06:45 nv.log
-rwx------    1 radio    radio       2.0M Sep 10 12:59 nv_data.bin
-rwx------    1 radio    radio         32 Sep 10 12:59 nv_data.bin.md5
drwxrwxr-x    2 radio    system      4.0K Aug 10 17:37 wifi
-rw-r--r--    1 radio    radio        220 Jan  1  2012 wv.keys
5) Once confirmed you get a list similar to above (as opposed to nothing) take a screenshot of the files and remove the efs contents...

Code:
rm -Rf /efs/*
and use the list command again to confirm nothing is returned when looking in the efs parrtition

Code:
ls -lh /efs
6) Push your folder dump back to place and ls to check it worked

Code:
exit
adb push c:\users\rootsu\desktop\MG_EFS /efs/
adb shell
ls -lh /efs
7) You will probably notice that the permissions differ to those in your screenshot. If so, paste the below block command to grant the permissions back into the /efs

Code:
chmod 664 /efs/00000000.authtokcont
chmod 755 /efs/FactoryApp
chmod 775 /efs/bluetooth
chmod 775 /efs/drm
chmod 666 /efs/gyro_cal_data
chmod 644 /efs/h2k.dat
chmod 775 /efs/imei
chmod 700 /efs/lost+found
chmod 600 /efs/nv.log
chmod 700 /efs/nv_data.bin
chmod 700 /efs/nv_data.bin.md5
chmod 775 /efs/wifi
chmod 644 /efs/wv.keys
8) Exit and reboot

Code:
exit
adb reboot
There you have it, folder dump restored. If you're wondering if I did this myself before writing this guide, the answer is YES. I happily guinea pigged my device for you

Here is the full command list I used.

 
adb shell
ls /data/media/0
exit
adb pull /data/media/0/MG_EFS c:\users\rootsu\Desktop\MG_EFS
adb shell
ls -lh /efs
rm -Rf /efs/*
ls /efs
exit
adb push c:\users\rootsu\desktop\MG_EFS /efs/
adb shell
ls -lh /efs
chmod 664 /efs/00000000.authtokcont
chmod 755 /efs/FactoryApp
chmod 775 /efs/bluetooth
chmod 775 /efs/drm
chmod 666 /efs/gyro_cal_data
chmod 644 /efs/h2k.dat
chmod 775 /efs/imei
chmod 700 /efs/lost+found
chmod 600 /efs/nv.log
chmod 700 /efs/nv_data.bin
chmod 700 /efs/nv_data.bin.md5
chmod 775 /efs/wifi
chmod 644 /efs/wv.keys
ls -lh /efs
exit
adb reboot



I heard I can manually modify my IMEI, transplanted from another device?

Modifying an IMEI is illegal in many countries. Even if this was possible, discussion here would be against the rules. Your IMEI must not be modified. Either restore a backup or send for repair.


I'm stuck in factorymode, is this related?

Yes, factorymode is caused by corrupt efs. It is possible to fix it with root and a terminal emulator.

Firstly try these commands (case sensitive)

Code:
su
echo -n ON >> /efs/FactoryApp/factorymode
If they fail, use the more detailed commands:

Code:
su
rm /efs/FactoryApp/keystr
rm /efs/FactoryApp/factorymode
echo -n ON >> /efs/FactoryApp/keystr
echo -n ON >> /efs/FactoryApp/factorymode
chown 1000.1000 /efs/FactoryApp/keystr
chown 1000.1000 /efs/FactoryApp/factorymode
chmod 0744 /efs/FactoryApp/keystr
chmod 0744 /efs/FactoryApp/factorymode
reboot
This should hopefully return you to user mode. If not, the last thing you can try, which reportedly works is to delete /efs/FactoryApp/ folder, then factory reset from recovery. This *should* regenerate the folder. Your factory mode will still need "echo -n ON >> /efs/FactoryApp/factorymode" doing though, which can be done as described above or opening the file in a text editor and changing the content of the file to "ON"

Failing that, flash stock and send for repair.

See here for more info on factory mode

How does "Ariza patch" fit in to this?

Ariza patch does not fix IMEI issues. It fixes "00000" Serial number issues, which has similar symptoms. This patch does not work on EFS v2 ROMs. If you use it, you may irreparably break your phone.

Also it would seem, Phones that had this patch ON EFS v1 ROMS will break their IMEI if they upgrade to EFS v2 ROMS.

As yet, there is nothing proved to resolve this issue fully. Search the Ariza thread for posts by zuluman for potential fixes. This Page is hopefully the most useful or one of the patched modems posted

It would probably be best to get the serial number professionally restored either under warranty or by sla mobile repair shop. The Ariza patch was always only fixing something that should have been fixed under warranty anyway.... now we are seeing this issue - cut your losses

Send for repair

A couple of notes on this. Firstly, "Send for repair" does not necessarily mean you must return it to Samsung / Your carrier. It is simply a phrase. Many EFS issues can be resolved by taking it to a mobile repair shop.. In the UK, There's one on almost every street in a town / city centre, and they will charge about 20 to get it repaired. Around $25 USD / EUR. If you are out of warranty or are in a rush for the repair, this is a good option and yes, people are known to have been successful with this...

Secondly, a more personal note. If I suggest "send for repair" as a solution for you, it is not because I am unwilling to get involved in troubleshooting or helping (although this is all already covered in this post) - It is because I truly believe this is the best or only option for you. Mostly I will only recommend it if it is the only option. Seeing me say this a lot in this thread is because we need people to accept that there can only be a finite amount of approaches to fixing the issue. In some cases, I will recommend it if it is the BEST option. An example of that would be the ariza patch situation. The Change in EFS format broke all those serial number 000000 phones that were fixed with the ariza patch. It was my opinion before MG4 that serial number 000000 should have been the resolution to this issue. It still is. At the moment, there are not many options for broken ariza patched phones. My opinion is this is the order of best solutions.

1) Repair
2) Wait for ariza update
3) Try Zuluman patch.

I have said this a lot but it needed to go here too..


Other

How to work out when your baseband / ROM was released.

1) Take the last 3 characters from the name.
2) Compare the first of these characters against the below to get the year

L=2012
M=2013


3) Compare the second of these characters against the below to get the month

A=January
B=February
C= March
D=April
E=May
F=June
G=July
H=August
J=September
K=October
L=November
k=December


4) take the last of the 3 characters and compare against the below to get the revision number

1=Revision 1
2=Revision 2
3=Revision 3
4=Revision 4
5=Revision 5
6=Revision 6
7=Revision 7
8=Revision 8
9=Revision 9
A=Revision 10
B=Revision 11
C=Revision 12
D=Revision 13
E=Revision 14
F=Revision 15

etc

example:

MG4 = 2013 - July - Revision 4

This is a work in progress. None of this is my work, I am just compiling it into a single thread, so thanks to everyone answering questions in Q&A. If there is anything missing that you think should be added, please say so.
Want to root/unroot? All important guides and info threads are contained within the "Sticky Roll-up" thread in General. Click the link below to get there!

**Sticky Roll-up: All Guides snd Info Threads linked here**



Philz Touch Recovery with passkey secure lock

I do NOT reply to support queries over PM.
The Following 171 Users Say Thank You to rootSU For This Useful Post: [ Click to Expand ]
 
sidh10
Old
#2  
Senior Member
Thanks Meter 20
Posts: 162
Join Date: Oct 2010
Location: Kolkata
I used the app kTool to backup my efs. Won't that work?
Device : Galaxy S3 International I9300
ROM : Omega v17 AOKP
Device:Nexus 5
ROM:Stock, unrooted.
The Following User Says Thank You to sidh10 For This Useful Post: [ Click to Expand ]
 
slaphead20
Old
#3  
slaphead20's Avatar
Senior Member
Thanks Meter 4,755
Posts: 11,297
Join Date: Feb 2011
Location: Out there somewhere

 
DONATE TO ME
Nice one :thumbup::thumbup:
All donations to me will go to THE PICKERING CENTRE...my local cancer drop in centre, a registered charity no.1112623
http://www.pickeringcancercentre.org.uk/index.html
The Following User Says Thank You to slaphead20 For This Useful Post: [ Click to Expand ]
 
delsus
Old
(Last edited by E.Cadro; 5th August 2013 at 09:28 PM.)
#4  
delsus's Avatar
Senior Member
Thanks Meter 861
Posts: 4,543
Join Date: Oct 2011
 
Quote:
Originally Posted by rootSU View Post
*note - efs | backup your efs | backup your efs | backup your efs | backup your efs | backup your efs | backup your


IMEI
A unique identification number programmed onto your phone. It is required in order to be correctly identified on a mobile network. Without one, you cannot make calls, send SMS or use mobile data. Important stuff.


/efs
A partition on your internal memory containing important data including the IMEI. If the data in this partition gets corrupt, you will loose your IMEI


0049*** IMEI
A generic IMEI, meaning your real IMEI is not readable, presumably because it is corrupt but there are other reasons too.



This thread aims to give you as much basic information as possible in an attempt to prevent the 10 - 20 threads we're getting per day about this issue.



I have a 0049 IMEI. Why?


This means your phone cannot read your IMEI. There are 2 main reasons for this.

1) /efs is corrupt.

Whenever you flash a ROM, be that a custom ROM via a custom recovery or an official ROM via Odin, you risk corrupting your /efs partition and losing your IMEI.

There are 4 main steps to take to try to resolve this
  1. Restore your EFS from a backup - A logical first step
  2. No backup? Reflash a stock ROM using Odin
  3. Send the device for repair.

2) /efs partition format changed

The latest UK (BTU) 4.1.2 release (XXEMG4) which comes with the baseband of the same name, actually changes the format of efs.

If you have flashed XXEMG4 at any point, you are now in a situation whereby only the MG4 baseband can read the IMEI in /efs. The new efs format is not backwards compatible with older basebands. Probably, all new basebands will be compatible so in time this issue should diminish I expect.

If you have ever flashed XXEMG4, to keep your IMEI working, you must:
  1. Stay with the baseband MG4. You may flash other ROMs but must return to the MG4 baseband.
  2. Restore your efs backup (taken before MG4) to use older basebands.

For discussion of this issue, see this thread.

How do I backup and restore /efs?

There are a few methods to backup /efs, but they all require customisation of your phone. Either root access, or a custom recovery. I appreciate that many of you do not wish to root your phones and just want to flash official ROMs via Odin... Well here are your choices:
  1. Only use OTA or KIES to update (Official Method)
  2. Root using CF auto root / Framaroot - backup efs and THEN flash via ODIN
  3. Flash a custom recovery via Odin, backup efs and THEN flash a ROm via Odin
  4. Risk it. Don't backup efs. Simply flash via Odin and hope for the best


...and here are the options for backing up / restoring efs (this list is not exhaustive)

I heard I can manually modify my IMEI, transplanted from another device?

Modifying an IMEI is illegal in many countries. Even if this was possible, discussion here would be against the rules. Your IMEI must not be modified. Either restore a backup or send for repair.


I'm stuck in factorymode, is this related?

Yes, factorymode is caused by corrupt efs. It is possible to fix it with root and a terminal emulator.

Firstly try these commands (case sensitive)

Code:
su
echo -n ON >> /efs/FactoryApp/factorymode
If they fail, use the more detailed commands:

Code:
su
rm /efs/FactoryApp/keystr
rm /efs/FactoryApp/factorymode
echo -n ON >> /efs/FactoryApp/keystr
echo -n ON >> /efs/FactoryApp/factorymode
chown 1000.1000 /efs/FactoryApp/keystr
chown 1000.1000 /efs/FactoryApp/factorymode
chmod 0744 /efs/FactoryApp/keystr
chmod 0744 /efs/FactoryApp/factorymode
reboot
This should hopefully return you to user mode. If not, restoring to stock and / or restoring an efs backup may be the next things you try before sending for repair.

See here for more info on factory mode

Other

This is a work in progress. None of this is my work, I am just compiling it into a single thread, so thanks to everyone answering questions in Q&A. If there is anything missing that you think should be added, please say so.
Nice information here again, I would add that some custom roms allow you to backup your efs

Sent from my GT-I9300 using Tapatalk 4 Beta just to annoy Gus
Device: Xperia Z2

ROM: Stock

Kernel: Stock
The Following 2 Users Say Thank You to delsus For This Useful Post: [ Click to Expand ]
 
rootSU
Old
#5  
rootSU's Avatar
Senior Member - OP
Thanks Meter 11,410
Posts: 22,446
Join Date: Aug 2010
Location: Oxenhope, West Yorkshire, UK
Quote:
Originally Posted by sidh10 View Post
I used the app kTool to backup my efs. Won't that work?
As I said the list is not yet exhaustive
Want to root/unroot? All important guides and info threads are contained within the "Sticky Roll-up" thread in General. Click the link below to get there!

**Sticky Roll-up: All Guides snd Info Threads linked here**



Philz Touch Recovery with passkey secure lock

I do NOT reply to support queries over PM.
The Following 2 Users Say Thank You to rootSU For This Useful Post: [ Click to Expand ]
 
poults
Old
#6  
Senior Member
Thanks Meter 24
Posts: 100
Join Date: Mar 2011
With kernels like siyah they create 2 efs files on the Internal SD card, is it enough to copy these to drop box or something and restore only if they are ever needed?

Sent from my GT-I9300 using xda app-developers app
Dropbox- 2 GB online storage Free, sync files between different devices, 500 mb extra each for free with this link :

http://db.tt/AesulpFr
 
rootSU
Old
#7  
rootSU's Avatar
Senior Member - OP
Thanks Meter 11,410
Posts: 22,446
Join Date: Aug 2010
Location: Oxenhope, West Yorkshire, UK
Should be enough although I personally keep 3 separate backups

Sent from my GT-I9300 using Tapatalk 4
Want to root/unroot? All important guides and info threads are contained within the "Sticky Roll-up" thread in General. Click the link below to get there!

**Sticky Roll-up: All Guides snd Info Threads linked here**



Philz Touch Recovery with passkey secure lock

I do NOT reply to support queries over PM.
The Following 2 Users Say Thank You to rootSU For This Useful Post: [ Click to Expand ]
 
qtwrk
Old
#8  
qtwrk's Avatar
Senior Member
Thanks Meter 810
Posts: 2,496
Join Date: Sep 2011
Location: Barcelona
I was wondering.

I had a Galaxy Nexus, and Galaxy S III

What if I restore their backup efs into my current Galaxy S III

Will my second 9300's IMEI changed into old i9300 or i9250? Or just mess it up?

Sent from my GT-I9300 using xda premium
if my words are useful or helpful to you , i will appreciate it you click thanks button
GT-i9023 Nexus S
GT-i9250 Galaxy Nexus
GT-i9300 Galaxy S III
GT-s5830 Galaxy Ace
GT-i9300 Galaxy S III
GT-i9506 Galaxy S IV 4G+
GT-i9505 Galaxy S IV (current)
The Following User Says Thank You to qtwrk For This Useful Post: [ Click to Expand ]
 
rootSU
Old
#9  
rootSU's Avatar
Senior Member - OP
Thanks Meter 11,410
Posts: 22,446
Join Date: Aug 2010
Location: Oxenhope, West Yorkshire, UK
Doubtful. You cannot use someone else's efs backup to restore your own.

Sent from my GT-I9300 using Tapatalk 4
Want to root/unroot? All important guides and info threads are contained within the "Sticky Roll-up" thread in General. Click the link below to get there!

**Sticky Roll-up: All Guides snd Info Threads linked here**



Philz Touch Recovery with passkey secure lock

I do NOT reply to support queries over PM.
The Following 2 Users Say Thank You to rootSU For This Useful Post: [ Click to Expand ]
 
Quimicax
Old
#10  
Quimicax's Avatar
Senior Member
Thanks Meter 17
Posts: 121
Join Date: Nov 2012
Location: SantoDomingo
What happen in case my imei is correct and no have network connection? No registre network in case of arizapatch?

Sent from my GT-I9300 using xda app-developers app
Phone:
Samsung Galaxy I9300
Rom: Temasek v113 Android 4.4.4 (Temasek)
Kernel: Stock
Recovery:TWRP 2.7.1.0

Tablet
Asus TF300T 10"
Rom: Slimkat 4.4.3 Build 5.8 (ne0zone75)
Kernel: Stock
Recovery:TWRP 2.7.1.0

Tablet
Kindle Amazon HD 7"
Rom: CM 4.4.4 (M8) {Overclock & F2FS} (Maromi)
Kernel: Stock
Recovery: TWRP 2.7.1.0

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes