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

Search This thread

danarama

Senior Member
Aug 22, 2010
31,277
18,811
Oxenhope, West Yorkshire, UK
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:

EFS.png


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.
 
Last edited:

delsus

Senior Member
Oct 23, 2011
4,668
877
Huawei MediaPad T5
Google Pixel 5
*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
 
Last edited by a moderator:
  • Like
Reactions: difyel and danarama

poults

Senior Member
Mar 4, 2011
119
27
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
 

delsus

Senior Member
Oct 23, 2011
4,668
877
Huawei MediaPad T5
Google Pixel 5
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

You could potentially brick your device as is the case when flashing anything from another device onto your own, it would definitely cause problems with registering on your network.

If your network finds out as well you could also have a friendly visit from the police for cloning an IMEI. (it doesn't matter if you own the other device you are trying to change the ID of the device which is illegal.

Sent from my GT-I9300 using Tapatalk 4 Beta just to annoy Gus
 

kangerX

Senior Member
Nov 5, 2011
1,496
152
@rootSU and others ,
guys i'm in trouble , i lost my imei and the classic "No service" error is haunting me,
i do have the back up efsbackup.tar.gz and efsdev-mmcblk0p3.img.gz in sdcard but how do i restore (the easiest way ? btw i have no idea by what action these backups are created , they were just there when i looked) plus, do i need to get back to stock before restore ? currently on a 4.2.2 rom . Thank you
 

danarama

Senior Member
Aug 22, 2010
31,277
18,811
Oxenhope, West Yorkshire, UK
@rootSU and others ,
guys i'm in trouble , i lost my imei and the classic "No service" error is haunting me,
i do have the back up efsbackup.tar.gz and efsdev-mmcblk0p3.img.gz in sdcard but how do i restore (the easiest way ? btw i have no idea by what action these backups are created , they were just there when i looked) plus, do i need to get back to stock before restore ? currently on a 4.2.2 rom . Thank you

I've linked 3 apps in post 1. One of those should help

Sent from my GT-I9300 using Tapatalk 4
 
  • Like
Reactions: kzkan and kangerX

Top Liked Posts

  • There are no posts matching your filters.
  • 198
    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:

    EFS.png


    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.
    5
    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
    3
    I had the same problem ..flashed a stock rom via odin ..same problem ..root it again ..flashed xemg4 modem and worked like a charm . It also worked with xemg5 modem, both can be found using search tool . This happens after flashing stock or custom rom based on xemg4 .

    There is no MG5 modem. The MG5 rom comes with the MG2 modem. Both the MG2 and MG4 modems are linked in post 1 of this thread.
    3
    Good luck. Please let me know what happens / how you get on


    Just a quick update. After calling Samsung, then calling Orange, then calling Samsung again, Samsung sent me Pre-paid package to send my phone back to them. I am currently waiting for the return of my life as I use my phone for everything. Lesson people: BACK UP YOUR EFS please!!! I'll let you know what happens next as soon as I can.

    :(
    3
    I used the app kTool to backup my efs. Won't that work?

    As I said the list is not yet exhaustive ;)