[IMPORTANT] Backup your EFS IMMEDIATELY. [Backup and Restore Guides]

Search This thread

ndttung8487

Senior Member
May 14, 2013
371
116
Where people need me
It's of no use anyways. I was wrong. Only your device EFS will work with your device. There is surely some kind of verification and the nv_data.bin is specific to the device.

You right! but it's fine! I can live with 0049xx as very far from now! just wait to enjoy your fabulous rom!!
BTW, this is my main phone!! and wait for Nokia 105 for subphone!!:D!!
 

karlcaks

Member
Feb 3, 2013
46
8
Johor
That's strange. Maybe there is some kind of verification if the IMEI belongs to the device or not and that is why it is failing. I honestly don't know.



Are you on stock rom?

yes now im on DDLF2 now...I have tried many kinds of ways ... but the results failed ..
i hope this can fix my problem..but i dont have any backup efs fail...so what i need to do?..
thanks for u reply dhiru...

sorry for my poor english :(
 

chongns

Senior Member
Aug 1, 2011
917
426
Johor Bahru
there are a nv_data.bin.bak and nv_data.bin, both should be the same size. 2mb. compare the date. if the bak file is older, it should be your ori file.

Sent from my Galaxy Nexus using Tapatalk 4 Beta
 

xenyaliosx

Member
Jun 29, 2011
45
10
i just wanted to ask if it would be enough just to copy the backup/efs folder somewhere safe and save it? i know everything's written in the first page but since this is something really important i just had to ask. thanks in advance.

Sent from my GT-I9003 using xda app-developers app
 

chongns

Senior Member
Aug 1, 2011
917
426
Johor Bahru
i just wanted to ask if it would be enough just to copy the backup/efs folder somewhere safe and save it? i know everything's written in the first page but since this is something really important i just had to ask. thanks in advance.

Sent from my GT-I9003 using xda app-developers app

there are some folder permission and file permission staff need to take care. but it is better than nothing. however using the dd command as dhiru show is better cause it keeping all permission and group owner for whole folder, so when you restore it. it is set and go.

Sent from my Galaxy Nexus using Tapatalk 4 Beta

---------- Post added at 09:14 PM ---------- Previous post was at 09:10 PM ----------

i found that the nvdata.bin file will change in every reboot. and the hex code is scatter every time. but the nvdata.bin.bak is remain.

Sent from my Galaxy Nexus using Tapatalk 4 Beta
 
  • Like
Reactions: xenyaliosx

anigr88

Senior Member
May 26, 2011
286
25
chennai
a doubt to be clarified




2. Individual Files
This will just copy the files from your efs partition to your sdcard.

* Root your phone.
* Install Terminal Emulator use ADB from your Computer.
* Type the following commands

Code:
su
cp -a /efs/. /sdcard/i9003_efs/

* This will create a folder i9003_efs in your sd card containing your EFS partition files.
* Copy this folder to your system and save it in several places.

3. Automatic Backups with CyanogenMod

* Whenever you are flashing from Stock to CyanogenMod, the EFS is copied to a different partition. In this process, a backup of the efs is created in /sdcard/backup/efs.
* You could copy the efs backup files to your system and save them for later.

Note that EFS is unique for device and if you loose your EFS without having a backup, you couldn't restore it and you will have to visit the Samsung Service and get your motherboard replaced.




:confused:
I just wanted to ask that if that terminal emulator code given above works for other or not because i got an error of can't preserve ownership so after some search that they told to change the code to

Code:
su
cp -r /efs/. /sdcard/i9003_efs/

and it worked for me as i replaced -a with -r which allowed me to copy the individual files.


If its already discussed sorry for the duplicate post.:laugh:​
 

ndttung8487

Senior Member
May 14, 2013
371
116
Where people need me
there are some folder permission and file permission staff need to take care. but it is better than nothing. however using the dd command as dhiru show is better cause it keeping all permission and group owner for whole folder, so when you restore it. it is set and go.

Sent from my Galaxy Nexus using Tapatalk 4 Beta

---------- Post added at 09:14 PM ---------- Previous post was at 09:10 PM ----------

i found that the nvdata.bin file will change in every reboot. and the hex code is scatter every time. but the nvdata.bin.bak is remain.

Sent from my Galaxy Nexus using Tapatalk 4 Beta

So this can think as efs from other device can use on the problem one? Exept using speacial tools (Samsung tools with z3x box) is there any way we can restore using normal method? I mean transfer IMEI from device to device? Thank you
 

chongns

Senior Member
Aug 1, 2011
917
426
Johor Bahru
So this can think as efs from other device can use on the problem one? Exept using speacial tools (Samsung tools with z3x box) is there any way we can restore using normal method? I mean transfer IMEI from device to device? Thank you

Base on the Hardware, the first 13 digit is "hard seted", the 14th digit is the calculation result of the the first 13 digit.
so, in normal sense, it should work, however, do not know why it cant.
I been try to help 2 member to recovery, by it send me the nv_data.bin file, i set it to my phone, but it just changed and give me the generic imei.

so, if member have 2 SL and urge to transfer the imei from the bad phone to the good phone, you can try dd backup as stated at op, and flash with odin to the other phone. of cause, i take not responsibility to your act, just follow the step carefully.

to try make sure the below.

you are on samsung stock rom and partition system, not ext4 for both the phone.
do without sim card and sdcard inserted.

aside to @dhiru1602, what it the partition call bml3 ?

i been reading from Chinese forum for Galaxy 5 about the imei recovery, they backup bml3 and stl3.
 
Last edited:
  • Like
Reactions: nilebiker

ndttung8487

Senior Member
May 14, 2013
371
116
Where people need me
Base on the Hardware, the first 13 digit is "hard seted", the 14th digit is the calculation result of the the first 13 digit.
so, in normal sense, it should work, however, do not know why it cant.
I been try to help 2 member to recovery, by it send me the nv_data.bin file, i set it to my phone, but it just changed and give me the generic imei.

so, if member have 2 SL and urge to transfer the imei from the bad phone to the good phone, you can try dd backup as stated at op, and flash with odin to the other phone. of cause, i take not responsibility to your act, just follow the step carefully.

to try make sure the below.

you are on samsung stock rom and partition system, not ext4 for both the phone.
do without sim card and sdcard inserted.

aside to @dhiru1602, what it the partition call bml3 ?

As you can see i followed this topic from the begining but no luck! And IMEI is unique with each device only and may be re-write by some special tools, any other ways is useless to transfer and result of that is generic imei which i have to live with. Thanks alot for your help but I think this topic just for those who has backup and restore their own device's original IMEI.
 

rodero95

Senior Member
Jul 11, 2012
307
1,688
But, if the first 13 digits are hard set and the 14th is a calculation between all of then, isn't it possible to somehow read that hardware set digits or something?

Sent from my GT-I9003 using xda premium
 

latief.makhdoomi

Senior Member
Dec 13, 2012
235
113
~~~~~~~~~ WARNING ~~~~~~~~~
PLEASE BACKUP YOUR EFS BEFORE YOU ATTEMPT TO FLASH OR MODIFY YOUR PHONE. EFS CONTAINS YOUR DEVICE IMEI WHICH IS VERY IMPORTANT.​

You could use the following backup methods to backup your IMEI.

1. Archive Backup [Recommended]
This will create a compressed archive and copies it to your SD Card

* Root your phone.
* Install Terminal Emulator use ADB from your Computer.
* Type the following commands

Code:
su
busybox tar zcvf /sdcard/efs-backup.tar.gz /efs

* This will create a compressed archive efs-backup.tar.gz in your SD Card.
* Copy this archive to your system and save it in several places.

2. Individual Files
This will just copy the files from your efs partition to your sdcard.

* Root your phone.
* Install Terminal Emulator use ADB from your Computer.
* Type the following commands

Code:
su
cp -a /efs/. /sdcard/i9003_efs/

* This will create a folder i9003_efs in your sd card containing your EFS partition files.
* Copy this folder to your system and save it in several places.

3. Automatic Backups with CyanogenMod

* Whenever you are flashing from Stock to CyanogenMod, the EFS is copied to a different partition. In this process, a backup of the efs is created in /sdcard/backup/efs.
* You could copy the efs backup files to your system and save them for later.

Note that EFS is unique for device and if you loose your EFS without having a backup, you couldn't restore it and you will have to visit the Samsung Service and get your motherboard replaced.


A Little Background

IMEI is stored in the EFS partition of your device and it is unique for each and every device. IMEI is important and so is the EFS partition on your phone. Whenever you flash any custom rom, the efs partition is never touched and is always present on the device unlike the SYSTEM and KERNEL partition which vary with firmwares.

IMEI in a Stock rom is stored in the STL3 (/dev/block/stl3) partition and the filesystem is RFS. This is the primary and the most important partition and this data is shipped with the device and is unique for each and every phone.
Starting from Cyanogenmod 10 Alpha 4, the filesystem has been changed to facilitate bigger partitions. The RFS filesystem is no longer used since it is proprietary to Samsung. Instead, we are using YAFFS. For this reason, we wont be able to read the RFS partition which contains the EFS since the RFS support was removed from the kernel. To overcome this problem, we create a mirror partition for EFS and we copy the data from the original EFS partition to the newly created partition during when the ROM is being flashed. This creates 2 copies of the EFS in the device and also each time CyanogenMod is flashed, a backup of the EFS is created in the sdcard which could be very useful.

Hence, if you are having issues with lost IMEI on Cyanogenmod 10 or 10.1 releases, it would mean that maybe the mirror partition is improper but the original partition is still intact, which could be checked by returning back to stock. If you are still not having your IMEI on the Stock rom also, that is when you would be needing to restore using this guide.



Sent from my GT-I9003 using xda premium
 

ASMI1

Senior Member
Dec 23, 2010
333
121
27
hi dhiru1602, I heard something about "fake IMEI",how can I check if my IMEI still original (my efs still original)?
 

latief.makhdoomi

Senior Member
Dec 13, 2012
235
113
hi dhiru1602, I heard something about "fake IMEI",how can I check if my IMEI still original (my efs still original)?

you can dial *#06# it vl give u imei popup, pen it down,switch off ur phone take ur bat out and check is it same on the lable below ur bat..

Sent from my GT-I9003 using xda premium
 

Top Liked Posts

  • There are no posts matching your filters.
  • 62
    ~~~~~~~~~ WARNING ~~~~~~~~~
    PLEASE BACKUP YOUR EFS BEFORE YOU ATTEMPT TO FLASH OR MODIFY YOUR PHONE. EFS CONTAINS YOUR DEVICE IMEI WHICH IS VERY IMPORTANT.​

    You could use the following backup methods to backup your IMEI.

    1. Archive Backup [Recommended]
    This will create a compressed archive and copies it to your SD Card

    * Root your phone.
    * Install Terminal Emulator use ADB from your Computer.
    * Type the following commands

    Code:
    su
    busybox tar zcvf /sdcard/efs-backup.tar.gz /efs

    * This will create a compressed archive efs-backup.tar.gz in your SD Card.
    * Copy this archive to your system and save it in several places.

    2. Individual Files
    This will just copy the files from your efs partition to your sdcard.

    * Root your phone.
    * Install Terminal Emulator use ADB from your Computer.
    * Type the following commands

    Code:
    su
    cp -a /efs/. /sdcard/i9003_efs/

    * This will create a folder i9003_efs in your sd card containing your EFS partition files.
    * Copy this folder to your system and save it in several places.

    3. Automatic Backups with CyanogenMod

    * Whenever you are flashing from Stock to CyanogenMod, the EFS is copied to a different partition. In this process, a backup of the efs is created in /sdcard/backup/efs.
    * You could copy the efs backup files to your system and save them for later.

    Note that EFS is unique for device and if you loose your EFS without having a backup, you couldn't restore it and you will have to visit the Samsung Service and get your motherboard replaced.


    A Little Background

    IMEI is stored in the EFS partition of your device and it is unique for each and every device. IMEI is important and so is the EFS partition on your phone. Whenever you flash any custom rom, the efs partition is never touched and is always present on the device unlike the SYSTEM and KERNEL partition which vary with firmwares.

    IMEI in a Stock rom is stored in the STL3 (/dev/block/stl3) partition and the filesystem is RFS. This is the primary and the most important partition and this data is shipped with the device and is unique for each and every phone.
    Starting from Cyanogenmod 10 Alpha 4, the filesystem has been changed to facilitate bigger partitions. The RFS filesystem is no longer used since it is proprietary to Samsung. Instead, we are using YAFFS. For this reason, we wont be able to read the RFS partition which contains the EFS since the RFS support was removed from the kernel. To overcome this problem, we create a mirror partition for EFS and we copy the data from the original EFS partition to the newly created partition during when the ROM is being flashed. This creates 2 copies of the EFS in the device and also each time CyanogenMod is flashed, a backup of the EFS is created in the sdcard which could be very useful.

    Hence, if you are having issues with lost IMEI on Cyanogenmod 10 or 10.1 releases, it would mean that maybe the mirror partition is improper but the original partition is still intact, which could be checked by returning back to stock. If you are still not having your IMEI on the Stock rom also, that is when you would be needing to restore using this guide.
    28
    *** RESTORING YOUR EFS ***

    FOLLOW THIS GUIDE ONLY IF YOU ARE ON A STOCK ROM AND THE ABOUT PHONE DOESNT SHOW THE BASEBAND AS WELL AS THE IMEI NUMBER.

    IF YOU ARE ON ANY CUSTOM ROM, FIRST FLASH THE STOCK ROM AND CHECK TO SEE IF YOU HAVE YOUR IMEI BACK.

    PLEASE READ THE ENTIRE TOPIC BEFORE ATTEMPTING TO DO ANYTHING. IF YOU ARE HAVING ANY CONCERNS OR NEED TO ASK ANY QUESTIONS, FEEL FREE TO MAKE A POST IN THIS TOPIC AND I WILL DEFINITELY REPLY. PLEASE DON'T HURRY AND SCREW UP THINGS EVEN BAD. MESSING AROUND WITH SUCH THINGS COULD PROVE COSTLY SINCE THE ONLY ALTERNATIVE REPAIR IS BY GETTING THE MOTHERBOARD CHANGED BY SAMSUNG.

    FOR THIS GUIDE, YOU WILL BE REQUIRED TO HAVE AN EFS BACKUP WITH YOU. YOU CANNOT RECOVER YOUR EFS WITHOUT IT (Atleast for now). NEVER SHARE YOUR EFS BACKUPS WITH OTHER MEBERS, SINCE THE NETWORK CARRIER MAY BLACKLIST YOUR IMEI IF THERE ARE MORE THAN ONE DEVICE BEING USED WITH THE SAME IMEI ON THE SAME CARRIER.

    What is Required
    * Any Stock Rooted ROM with CWM Recovery [DDFL2 Recommended]
    * Odin or Hemidall
    * Odin EFS Template for Galaxy SL I9003 [I9003_EFS_ODIN_BLANK_TEMPLATE.tar]
    * CWM EFS Restore Script [I9003_EFS_CWM_RESTORE.zip]
    * Backup of EFS
    * External SD Card
    * Some Brains.


    Check the Extent of Damage / Create Backups
    * If you are having issues with IMEI, first flash back to the Stock ROM
    * Once on a Stock ROM, Check the contents of /efs with a File Manager and see if there are any files.
    * If there are no files, you could directly perform the restore using the next step.
    * If there are some files and you are having a fake IMEI, it would be better to backup the current EFS just in case.
    ** From the ADB Shell, type
    Code:
    su
    dd if=/dev/block/stl3 of=/sdcard/efs.rfs
    This will create a efs.rfs raw backup for your device, which could be used later on whenever you need it. You could flash the efs.rfs file from Odin. Keep it somewhere safely.


    Recovery Procedure if you have Archive Backup or the Individual Files.

    * Flash the Stock ROM and make sure that you are able to boot into the recovery and everything works fine. [ I am not going to cover flashing instructions since they are everywhere in the forum]
    * Create a folder in your External SD Card named "efsbackup" and copy all the files and folders from the EFS backup that you have directly inside the folder. If you are having a tar.gz archive, extract all of the files into the folder directly.
    * Power down the device and press Volume Up + Home + Power Combination to get into the Recovery Mode.
    * Select Install ZIP from SDCard and then select the I9003_EFS_CWM_RESTORE.zip from the SDCard. Wait for few seconds to complete the restore.
    * Once done, boot the phone and check to see if you are getting your Baseband, Network Signal and IMEI.
    * If you still are not able to get your IMEI, make sure that you are using the proper backup. Try another backup if you have it.

    Recovery Procedure if you have RAW Partition Image

    * Copy the Partition Image to SD Card and name it efsbackup.rfs
    * Connect the phone to ADB or use Terminal Emulator for the following commands
    Code:
    su
    dd if=/sdcard/efsbackup.rfs of=/dev/block/stl3
    This will restore the partition to your backup and you should be having a working IMEI now.

    Formatting your EFS Partition
    DO THIS ONLY IF YOU ARE HAVING ISSUES WITH MOUNTING /efs WHILE FLASHING NEW ROM OR IF YOU HAVE USED EFS CLEAR IN ODIN OR IF YOU EFS GET CLEARED EVERY BOOT.

    * Download the I9003_EFS_ODIN_BLANK_TEMPLATE.tar file from the attachment.
    * Power off the phone and boot into the Download mode by using the Volume Down + Home + Power Combination.
    * Connect your phone to the PC, Start up Odin and select the I9003_EFS_ODIN_BLANK_TEMPLATE.tar in PDA and press Start.
    * Once done, your EFS will be blank and you could use the 1st Method to restore your EFS backup.

    Odin_Template.jpg
    4
    Experiment again to restore imei.

    Code:
    [COLOR="Red"]DO NOT PLAY WITH IT IF YOU DO NOT KNOW OR YOU HAVE NO ABILITY TO RESTORE IT BACK[/COLOR]

    Code:
    IF YOU NOTHING TO LOSE AFTER YOU SCREW IT UP, BE MY GUEST
    :fingers-crossed:

    now, i screw up my imei partition, below is how I do it.

    Two partition i screwing.

    1. bml3
    2. stl3

    i actually did not know what is indside the bml3 partItion (or can we call it partition).
    so i try to peek into it.

    i dd it out, and use Hex editor to read it, i found that it content the nv_data.bin and others file same in the stl3 which is our efs folder.
    so, before that i dd backup it and also the stl3 by below command

    su
    dd if=/dev/block/bml3 of=/sdcard/bml3.bin

    it was about 10mb of size

    su
    dd if=/dev/block/stl3 of=/sdcard/stl3.img

    it was about 6mb of size

    than, i delete every thing inside the efs folder by
    rm -r *
    rm -r .*

    the 1st rm -r is to remover all visible file and folders
    the 2nd rm -r is to remover all the hiddern file and folders

    after that i reboot.

    after the reboot, the phone did not ask for the sim card pin code. it direct go to the home screen,
    it give generic imei

    than i dd back my bml3.bin file

    Code:
    dd if=/sdcard/bml3.bin of=/dev/block/bml3

    it went through, than i reboot again.
    after reboot, i found i have no signal, no base band, no imei, but have wifi mac address.
    in th efs folder i only have a folder smc-storage

    than, in adb shell i key the commnd

    Code:
     df
    it show a list of mounted partition.


    Code:
    [email protected]:~$ adb shell
    # df
    Filesystem           1K-blocks      Used Available Use% Mounted on
    tmpfs                   249140        32    249108   0% /dev
    tmpfs                   249140         0    249140   0% /mnt/asec
    tmpfs                   249140         0    249140   0% /mnt/obb
    /dev/block/stl9         329920    309916     20004  94% /system
    [COLOR="Red"]/dev/block/stl3           6064      6064         0 100% /efs[/COLOR]
    /dev/block/mmcblk0p3   1963888    157648   1806240   8% /data
    /dev/block/stl10         74008      3552     70456   5% /dbdata
    df: /mnt/.lfs: Function not implemented
    /dev/block/stl11         30792        12     30780   0% /cache
    /dev/block/vold/179:1  1595136    436064   1159072  27% /mnt/sdcard
    /dev/block/vold/179:17 15553280   2057696  13495584  13% /mnt/sdcard/external_sd
    /dev/block/vold/179:17 15553280   2057696  13495584  13% /mnt/secure/asec
    /dev/block/dm-0           5200      3212      1988  62% /mnt/asec/com.quoord.tapatalkxda.activity-1

    i found the red line is gone.
    so, i trying do dd it back form my backup in adb shell

    Code:
    dd if=/sdcard/stl3.rfs of=/dev/block/stl3

    but it give error

    so i check again the parttions list by

    Code:
    cat /proc/partitions

    it give you list below

    Code:
    # cat /proc/partitions
    major minor  #blocks  name
    
       7        0       5229 loop0
     139        0     513024 tfsr0/c
     139        1        256 tfsr1
     139        2        256 tfsr2
     139        3      10240 tfsr3
     139        4       1280 tfsr4
     139        5       1280 tfsr5
     139        6       7680 tfsr6
     139        7       8192 tfsr7
     139        8       8192 tfsr8
     139        9     341504 tfsr9
     139       10      79872 tfsr10
     139       11      35840 tfsr11
     139       12        512 tfsr12
     139       13      17920 tfsr13
     179        0    3866624 mmcblk0
     179        1    1595360 mmcblk0p1
     179        2     305088 mmcblk0p2
     179        3    1966016 mmcblk0p3
     137        0     513024 bml0/c
     137        1        256 bml1
     137        2        256 bml2
     137        3      10240 bml3
     137        4       1280 bml4
     137        5       1280 bml5
     137        6       7680 bml6
     137        7       8192 bml7
     137        8       8192 bml8
     137        9     341504 bml9
     137       10      79872 bml10
     137       11      35840 bml11
     137       12        512 bml12
     137       13      17920 bml13
    [COLOR="Red"] 138        3       6400 stl3[/COLOR]
     138        6       3840 stl6
     138        9     331776 stl9
     138       10      75264 stl10
     138       11      32000 stl11
     179       16   15558144 mmcblk1
     179       17   15557120 mmcblk1p1
     254        0       5229 dm-0
    #

    again the red line of stl3 is gone too.

    so, i can conclude is

    1. bml3 screw up
    2. stl3 will screw up too

    so if you lost imei or efs parttion, and you have tried to dd the backup and flash with odin also no success. than you have to flash the bml3 backup.



    i restore my imei like below.

    1. dd the bml3.bin back into it by
    Code:
    dd if=/sdcard/bml3.bin of=/dev/block/bml3

    2. flash my stl3.rfs using heimdall-frontend, (suppose odin also work, but never tried)

    * put in the pit file without repartition check (incase something is screwed, the phone forgotten the partition location);)
    * add in the EFS flash and choose the stl3.rfs (odin should put in the PDA)

    OK, i restore it successfully

    from my experiment, i hope can give some light to member who trying hard to restoring back their i lost mei. :fingers-crossed:
    4
    I have the fake imei. I try many method but still 0049xxx. Any solutions? Thank you

    Yeah. You could try this method but you need a backup first.

    Sent from my GT-I9300 using xda premium
    4
    Can I use backup IMEI from the same SL i9003 device to mine? as it have huge problem with hardware but still have correct IMEI and all informations? Thank you.

    Yes. But be advised that 2 phones with same IMEI could cause legal problems. IMEI spoofing is illegal in several countries.

    You could use the EFS backup (nv_data.bin) from any I9003, I9000 or Nexus S devices.
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone