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

[Tools][How-To][Guides] Backup & Restore EFS + Get out from Permanent Safe mode

Search This thread

tamirda

Inactive Recognized Developer
Jul 12, 2010
4,637
18,806
www.tdroms.com
Note to forum managers: Please make it a Sticky Thread, It should help to all users and there is no use for this tutorial if it is in page 3

Hello XDA Users,

I think some people here know who I am, so I will jump on the "Introduction of myself" for now.

Recently, I have faced many questions & problem of fake IMEI, of damaged EFS folder. So I made a little experiment on my device(GN2).

First, I backuped my EFS folder in 2 types - one is .img and the second is tar.gz.

Then, I deleted my EFS folder using ES Root Explorer. Which made my device to be on somethine called "Permanent Safe Mode" - You can not get out untill you fix your EFS folder and change some values.
This is permanent safe mode:

43gy.png


After I did my "research" I have managed to make several methods to backup & restore EFS, which should make your life easier and better.


First of all, Disclaimer:


I'm not responsible for any damage caused by using these methods, all methods tested by me, so it should work on your device too.
This is for I9500 Only!!!!!!!



Let's continue.

What you must have:

  • Latest base with latest modem and latest kernel - very important since in the latest versions samsung prevented the option to install old modems/kernels, so if you install old kernell/modem it can show you wrong IMEI.
  • Rooted device with the latest Super User
  • Latest busybox
  • CWM / PhilZ Recovery
  • Terminal Emulator
  • Root explorer - Can be ES File Explorer with working root option or just a root explorer from the market
  • A working EFS backup(In order to restore it...)
  • Time & Patient.



Important Notes:

  • When installing XWUBMG5, several people suffered from Fake IMEI. This is because the new firmware messed up your EFS folder, which means that you can not restore EFS backup until you are on older version, recommended is XXUBMG9(right to 05/08/2013)
  • Some custom roms include modem installation in their rom installer. Due to modem flashing in recovery, some devices might get Fake IMEI. My recommendation is before even starting to use this guide, please try to install the latest modem via odin from this thread:
    http://forum.xda-developers.com/showthread.php?t=2192025
  • You will find at least one method that works on your device, so don't give up after one method.
  • Note II & S4 has the same EFS partition (mmcblk0p3), All methods were checked by me on my Note II and fully work. So it should work on S4 too. At least 90% of them :)
  • Read all guide and pay attention to all small details.

Backup methods

Method 1 - .img backup

First method, is an automatic backup/restore software.

Special thanks to A.S._id for his software.
Original thread:
http://forum.xda-developers.com/showthread.php?t=2430177&nocache=1&styleid=19

The software:
SAMSUNG_I9500_EFS_BACKUP_RESTORE_AUTOMATIC


Instructions:

! Need for backup Root access, debugging USB and busybox
1. Extract from the zip and run. Bat file
2. Is okay to your PC and follow the menu


Automatically create a text file of all the parameters of the device at the time of the copy
Automatic backup of efs:
* Odin flash file. Tar.md5,
* raw.img
* Tar.gz archive
Automatic naming of files and backup archive version of the firmware
Restore to choose from archives and backup images
Automatic start of Odin and the transition to the flashing mode when selecting Odin Restore


DOWNLOAD

Thanks to:
shoma_81, tester99,
For help and assist in the creation of tool


p.s. * Deposit assured recovery - to have the device firmware version corresponding to the backup copy


Method 2 - .img backup


Method number 2 will create you efs.img backup on your internal sd. After that you can copy it to your computer.

What you have to do is this:
  1. Open terminal emulator
  2. Write the following:
    Code:
    su
    Then click enter. It will ask for super user permission, give it permissions.
  3. Then write:
    Code:
    dd if=/dev/block/mmcblk0p3 of=/sdcard/efs.img bs=4096
    Then click enter.
  4. When it finishes, check if you have efs.img on your phone memory. If so, copy it to comupter, if not, you did something wrong try again.


Method 3 - .tar.gz backup

This method will compress your efs folder into tar.gz file. This method is the same as choosing backup EFS folder in my rom(PhoeniX ROM)/Omega/Wanam/etc.

A tar.gz backup should look like this(On some devices there might be more files, but this picture was taken from Note II N7100 backup and it fully works):
q2zs.png


What you have to do is this:
  1. Download this and copy it to your device:
    http://d-h.st/f4I
  2. Reboot into recovery
  3. Flash the zip
  4. Reboot your device.
  5. Connect your device to your pc, and copy the backup in "efs_backup" folder.


Restore methods

Now the fun begins :D

You will have to restore your backup when you have one or more of the folowing problem:
  • Fake IMEI (usually 004999010640000) or "null" IMEI
  • Blinking SIM card icon on the top tray… ETC
  • Unable to unlock your SIM card using your PIN
  • Fake Serial Number (usually 0000000) or "null" Serial
  • Unable to register to the network (usually comes with Fake IMEI & Fake Serial so check them.)

Attention please,
If you are 100% that your EFS folder is damaged and you have a working EFS backup with the right IMEI number, my recommendation is this:

  1. With root explorer, go to your efs folder and delete all files inside
  2. Long press on power button will turn off your device.
  3. Then turn on the device, you will be in "Permanent Safe Mode".
  4. Continue to one of the following methods.



Method 1 - restore .img backup

First method, is an automatic backup/restore software.


Special thanks to A.S._id for his software.
Original thread:
http://forum.xda-developers.com/showthread.php?t=2430177&nocache=1&styleid=19

The software:
SAMSUNG_I9500_EFS_BACKUP_RESTORE_AUTOMATIC


Instructions:

! Need for backup Root access, debugging USB and busybox
1. Extract from the zip and run. Bat file
2. Is okay to your PC and follow the menu


Automatically create a text file of all the parameters of the device at the time of the copy
Automatic backup of efs:
* Odin flash file. Tar.md5,
* raw.img
* Tar.gz archive
Automatic naming of files and backup archive version of the firmware
Restore to choose from archives and backup images
Automatic start of Odin and the transition to the flashing mode when selecting Odin Restore


DOWNLOAD

Thanks to:
shoma_81, tester99,
For help and assist in the creation of tool


p.s. * Deposit assured recovery - to have the device firmware version corresponding to the backup copy



Method 2 - Restore .img backup


Method number 2 will restore your efs.img backup from your internal sd.

What you have to do is this:
  1. Put your efs.img on your phone memory(not external sd card!) in the main memory, not inside folder.
  2. Open terminal emulator
  3. Write the following:
    Code:
    su
    Then click enter. It will ask for super user permission, give it permissions.
  4. Then write:
    Code:
    dd if=/sdcard/efs.img of=/dev/block/mmcblk0p3 bs=4096
    Then click enter.
  5. Now, reboot your device. If you still don't have IMEI/You are still in Safe Mod, reboot again.
    In the second reboot, the bootanimation might stuck and the device will reboot automatically again. Don't worry, it is ok because it installs your efs.img.



Method 3 - restore .tar.gz backup



This method will restore .tar.gz backup.
A tar.gz backup should look like this(On some devices there might be more files, but this picture was taken from Note II N7100 backup and it fully works):
q2zs.png


If you have like this, continue to the guide:
  1. Create on your Phone Memory(Not Extrenal sd!!) a folder called "efsbackup"(without quotes)
  2. Copy all files & folders from the EFS backup into "efsbackup" folder(The files are like in the picture)
  3. Download this script & copy it to your device:
    http://d-h.st/XcL
  4. Reboot into recovery
  5. Go to mount section and click on(Very important!):
  6. Now install the script you have downloaded.
  7. After it finishes, reboot.
  8. Now everything should be fixed, of course if your backup is 100% ok.
    If it doesn't work, try method 4.




Method 4 - restore .tar.gz backup


This method will restore .tar.gz backup.
A tar.gz backup should look like this(On some devices there might be more files, but this picture was taked from Note II N7100 backup and it fully works):
q2zs.png


If you have like this, continue to the guide:
  1. Create on your Phone Memory(Not Extrenal sd!!) a folder called "efsbackup"(without quotes)
  2. Copy all files & folders from the EFS backup into "efsbackup" folder(The files are like in the picture)
  3. Using root explorer, go to "efsbackup folder, select all files & folders there, and click Copy.
  4. Still in root explorer, go to "efs" folder of your device(It is located where all main folders like data, system, etc.).
  5. In "efs" folder, click paste. It will ask you if you want to replace your files, select replace to all files(So all your files from "efsbackup" folder will be in "efs" folder)
  6. Now open terminal emulator
  7. Write the following:
    Code:
    su
    Then click enter. It will ask for super user permission, give it permissions.
  8. Now write:
    Code:
    busybox chown 1001:1001 /efs/nv_data.bin
    Then click enter.
  9. Now write:
    Code:
    busybox chmod 06755 /efs/nv_data.bin
    Then click enter.
  10. Reboot device. Now everything should work.




Exit "Permanent Safe Mode"

When you in "Permanent Safe Mode" situation, it means that your EFS folder is broken.
If you succeeded in restoring your IMEI and you still stuck in this Safe Mode, use this guide:

Method 1

  1. Open root explorer.
  2. Navigate to /efs/FactoryApp/
  3. Open "factorymode" file as Text and edit it:
    Change this:
    Code:
    OFF

    To:
    Code:
    ON
  4. Open "keystr" file as Text and edit it:
    Change this:
    Code:
    OFF

    To:
    Code:
    ON
  5. Reboot device.


Method 2

  1. Open Terminal emulator
  2. Write the following:
    Code:
    su
    Then click enter. It will ask for super user permission, give it permissions.
  3. Write the following & click enter:
    Code:
    rm /efs/FactoryApp/keystr
  4. Write the following & click enter:
    Code:
    rm /efs/FactoryApp/factorymode
  5. Write the following & click enter:
    Code:
    echo -n ON >> /efs/FactoryApp/keystr
  6. Write the following & click enter:
    Code:
    echo -n ON >> /efs/FactoryApp/factorymode
  7. Write the following & click enter:
    Code:
    chown 1000.1000 /efs/FactoryApp/keystr
  8. Write the following & click enter:
    Code:
    chown 1000.1000 /efs/FactoryApp/factorymode
  9. Write the following & click enter:
    Code:
    chmod 0744 /efs/FactoryApp/keystr
  10. Write the following & click enter:
    Code:
    chmod 0744 /efs/FactoryApp/factorymode
  11. Reboot your device



This is all I can do for you friends, Worked alot on these methods to give you the best information.
Each method was tested by me and fully works.


If this helped you please press the "Thanks" button.
If you like & appreciate my work please consider a donation!






Credits:
  • shnizlon
  • Candanga
  • A.S._id
  • dhiru1602
  • UtkarshGupta
  • P.M If you think that I forgot you

XDA:DevDB Information
Backup & Restore EFS + Get out from Permanent Safe mode I9500, a Tool/Utility for the Samsung Galaxy S 4

Contributors
tamirda

Version Information
Status: Stable

Created 2013-09-05
Last Updated 2013-09-05
 
Last edited:

tamirda

Inactive Recognized Developer
Jul 12, 2010
4,637
18,806
www.tdroms.com
Awesome my friend 5 stars hit, I will link you in my post.

I hope people read in detail and take precautions

Hugs

Sent from my GT-I9500

Thank you my friend,
In my note II I did like 20 backups before I deleted my EFS folder around 20 times ahah.
People should be aware that samsung is trying to mess up our devices.
 

galza

Senior Member
Sep 29, 2011
989
139
kabri
great topic and guide tamir.5 stars from me :thumbup: will help me a lot if i get stuck with any prob like before arghhhh

Sent from my GT-N7000 using Tapatalk 2
 
  • Like
Reactions: tamirda

tamirda

Inactive Recognized Developer
Jul 12, 2010
4,637
18,806
www.tdroms.com
great topic and guide tamir.5 stars from me :thumbup: will help me a lot if i get stuck with any prob like before arghhhh

Sent from my GT-N7000 using Tapatalk 2


I am happy to help you any time :)




Excellent my friend tamirda! :good:
regards!
5 stars! and sticky please!


Thank you friend!




Thank you Tarmida, This is the best userful topic ever for my S4 :good:. This will saving many lives of XDA member :good:

Thank you friend, and yes this can be very useful for alot of users.

Sent from my GT-N7100 using xda app-developers app
 
  • Like
Reactions: bafknight

AL_IRAQI

Recognized Contributor / Themer
May 18, 2012
5,959
11,286
Baghdad
Redmi K20 Pro
@tamirda
Hi I'm using crash rom 5.5
I made full wipe and flash MG5
By odin and now I have fake imei
a4yjaqem.jpg


I restore crash rom 5.5 backup from cwm and the problem still exsist :(
I don't make EFS backup before
How to fix it ?

Sent From my i9500 With Crash Rom

--------------------------------
ادعوا لي بالتوفيق في امتحاناتي
wish me good luck for my exams
 

tamirda

Inactive Recognized Developer
Jul 12, 2010
4,637
18,806
www.tdroms.com
@tamirda
Hi I'm using crash rom 5.5
I made full wipe and flash MG5
By odin and now I have fake imei
a4yjaqem.jpg


I restore crash rom 5.5 backup from cwm and the problem still exsist :(
I don't make EFS backup before
How to fix it ?

Sent From my i9500 With Crash Rom

--------------------------------
ادعوا لي بالتوفيق في امتحاناتي
wish me good luck for my exams

Hello,
It seems that crash backuped your Fake IMEI.
Something that I thing it might help, helped for some other, download latest modem from here:
http://forum.xda-developers.com/showthread.php?t=2192025
install it as a Phone in Odin.
it is importand to mark phone, and flash via odin.
Then try..
If you don't have any other backup, I think you might have to use your warranty.
 
  • Like
Reactions: AL_IRAQI

AL_IRAQI

Recognized Contributor / Themer
May 18, 2012
5,959
11,286
Baghdad
Redmi K20 Pro
When I backup the rom I forget my phone in flight mode maybe this the reason why I lost my imei ?
And my baseband now is
I9500DDUBMF8

+Edit
I found these in my internal storage
penenema.jpg

The First One From Crash Rom 5.0
And The Second From Stock MG5 Where I have fake imei
Sent From my i9500 With Crash Rom

--------------------------------
ادعوا لي بالتوفيق في امتحاناتي
wish me good luck for my exams
 
Last edited:

tamirda

Inactive Recognized Developer
Jul 12, 2010
4,637
18,806
www.tdroms.com
When I backup the rom I forget my phone in flight mode maybe this the reason why I lost my imei ?
And my baseband now is
I9500DDUBMF8


Sent From my i9500 With Crash Rom

--------------------------------
ادعوا لي بالتوفيق في امتحاناتي
wish me good luck for my exams

I don't think there is connection between these two.
Downlaod this:
http://d-h.st/esG
Open odin, Select Phone, select the modem's tar, connect phoen and flash.
After that check if you have IMEI.
If not, Try to install stock XXUBMG9 or XXUBMG5 - If you had MG5 before, it seems that you can not downgrade your phone, so try to install MG5.
If after MG5 there is still no IMEI,
Flash again as Phone via odin this modem:
http://d-h.st/Xxk

If still there is no IMEI, try to restore your current EFS backup.(Make sure you have Root and busybox and all I asked in the main thread)
If after that no IMEI,
Restore to stock and use warranty( make a story that you woke up one morning and you couldn't conect to your network, and you tried to mnake factory reset and still it didn't help)

Good luck
 

AL_IRAQI

Recognized Contributor / Themer
May 18, 2012
5,959
11,286
Baghdad
Redmi K20 Pro
I don't think there is connection between these two.
Downlaod this:
http://d-h.st/esG
Open odin, Select Phone, select the modem's tar, connect phoen and flash.
After that check if you have IMEI.
If not, Try to install stock XXUBMG9 or XXUBMG5 - If you had MG5 before, it seems that you can not downgrade your phone, so try to install MG5.
If after MG5 there is still no IMEI,
Flash again as Phone via odin this modem:
http://d-h.st/Xxk

If still there is no IMEI, try to restore your current EFS backup.(Make sure you have Root and busybox and all I asked in the main thread)
If after that no IMEI,
Restore to stock and use warranty( make a story that you woke up one morning and you couldn't conect to your network, and you tried to mnake factory reset and still it didn't help)

Good luck

Thanks I'll Try These Method
If not working I'll use my warranty

EDIT
I directly flash I9500_UBUBMG9_MODEM
And know it's work fine with me
syqaqazu.jpg

I Should Try it before ask sorry for that
this is the first time I have this problem

Thank you very much :)

Sent From my i9500 With Crash Rom
 
Last edited:

tamirda

Inactive Recognized Developer
Jul 12, 2010
4,637
18,806
www.tdroms.com
Thanks I'll Try These Method
If not working I'll use my warranty

EDIT
I directly flash I9500_UBUBMG9_MODEM
And know it's work fine with me
syqaqazu.jpg

I Should Try it before ask sorry for that
this is the first time I have this problem

Thank you very much :)

Sent From my i9500 With Crash Rom

Hi mate,
First of all,
I am more than happy that I helped you.
Second, this is ok to ask questions, that is why I am here.

Now backup at leat 5 times your EFS :) .img & tar.gz.

Enjoy!
 
  • Like
Reactions: AL_IRAQI

AL_IRAQI

Recognized Contributor / Themer
May 18, 2012
5,959
11,286
Baghdad
Redmi K20 Pro
Hi mate,
First of all,
I am more than happy that I helped you.
Second, this is ok to ask questions, that is why I am here.

Now backup at leat 5 times your EFS :) .img & tar.gz.

Enjoy!
I backup 3 times with every method :)
Thanks :)


Sent From my i9500 With Crash Rom

--------------------------------
ادعوا لي بالتوفيق في امتحاناتي
wish me good luck for my exams
 

pdash79

Senior Member
Mar 25, 2010
131
12
Awesome guide.

Burned up whole weekend over the issue and now fixed my issue following the guide.
Cannot thank you enough man!

Regards,
Pdash
 

daogiahieu

Senior Member
Jun 4, 2013
634
145
I read your post, all most the method use terminal emulator, so what is that ?, and can you give me link of that ?
thanks you very much :)
 

manu44

Senior Member
Nov 9, 2011
534
121
INDIA
Thanxs @tamirda

I could see everyday a new post related to messed up EFS folder.
It would surely help people out

Anyhow i had already backed up mine using the EFS professional Software. Is it enough or should i backup using your methods also?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 96
    Note to forum managers: Please make it a Sticky Thread, It should help to all users and there is no use for this tutorial if it is in page 3

    Hello XDA Users,

    I think some people here know who I am, so I will jump on the "Introduction of myself" for now.

    Recently, I have faced many questions & problem of fake IMEI, of damaged EFS folder. So I made a little experiment on my device(GN2).

    First, I backuped my EFS folder in 2 types - one is .img and the second is tar.gz.

    Then, I deleted my EFS folder using ES Root Explorer. Which made my device to be on somethine called "Permanent Safe Mode" - You can not get out untill you fix your EFS folder and change some values.
    This is permanent safe mode:

    43gy.png


    After I did my "research" I have managed to make several methods to backup & restore EFS, which should make your life easier and better.


    First of all, Disclaimer:


    I'm not responsible for any damage caused by using these methods, all methods tested by me, so it should work on your device too.
    This is for I9500 Only!!!!!!!



    Let's continue.

    What you must have:

    • Latest base with latest modem and latest kernel - very important since in the latest versions samsung prevented the option to install old modems/kernels, so if you install old kernell/modem it can show you wrong IMEI.
    • Rooted device with the latest Super User
    • Latest busybox
    • CWM / PhilZ Recovery
    • Terminal Emulator
    • Root explorer - Can be ES File Explorer with working root option or just a root explorer from the market
    • A working EFS backup(In order to restore it...)
    • Time & Patient.



    Important Notes:

    • When installing XWUBMG5, several people suffered from Fake IMEI. This is because the new firmware messed up your EFS folder, which means that you can not restore EFS backup until you are on older version, recommended is XXUBMG9(right to 05/08/2013)
    • Some custom roms include modem installation in their rom installer. Due to modem flashing in recovery, some devices might get Fake IMEI. My recommendation is before even starting to use this guide, please try to install the latest modem via odin from this thread:
      http://forum.xda-developers.com/showthread.php?t=2192025
    • You will find at least one method that works on your device, so don't give up after one method.
    • Note II & S4 has the same EFS partition (mmcblk0p3), All methods were checked by me on my Note II and fully work. So it should work on S4 too. At least 90% of them :)
    • Read all guide and pay attention to all small details.

    Backup methods

    Method 1 - .img backup

    First method, is an automatic backup/restore software.

    Special thanks to A.S._id for his software.
    Original thread:
    http://forum.xda-developers.com/showthread.php?t=2430177&nocache=1&styleid=19

    The software:
    SAMSUNG_I9500_EFS_BACKUP_RESTORE_AUTOMATIC


    Instructions:

    ! Need for backup Root access, debugging USB and busybox
    1. Extract from the zip and run. Bat file
    2. Is okay to your PC and follow the menu


    Automatically create a text file of all the parameters of the device at the time of the copy
    Automatic backup of efs:
    * Odin flash file. Tar.md5,
    * raw.img
    * Tar.gz archive
    Automatic naming of files and backup archive version of the firmware
    Restore to choose from archives and backup images
    Automatic start of Odin and the transition to the flashing mode when selecting Odin Restore


    DOWNLOAD

    Thanks to:
    shoma_81, tester99,
    For help and assist in the creation of tool


    p.s. * Deposit assured recovery - to have the device firmware version corresponding to the backup copy


    Method 2 - .img backup


    Method number 2 will create you efs.img backup on your internal sd. After that you can copy it to your computer.

    What you have to do is this:
    1. Open terminal emulator
    2. Write the following:
      Code:
      su
      Then click enter. It will ask for super user permission, give it permissions.
    3. Then write:
      Code:
      dd if=/dev/block/mmcblk0p3 of=/sdcard/efs.img bs=4096
      Then click enter.
    4. When it finishes, check if you have efs.img on your phone memory. If so, copy it to comupter, if not, you did something wrong try again.


    Method 3 - .tar.gz backup

    This method will compress your efs folder into tar.gz file. This method is the same as choosing backup EFS folder in my rom(PhoeniX ROM)/Omega/Wanam/etc.

    A tar.gz backup should look like this(On some devices there might be more files, but this picture was taken from Note II N7100 backup and it fully works):
    q2zs.png


    What you have to do is this:
    1. Download this and copy it to your device:
      http://d-h.st/f4I
    2. Reboot into recovery
    3. Flash the zip
    4. Reboot your device.
    5. Connect your device to your pc, and copy the backup in "efs_backup" folder.


    Restore methods

    Now the fun begins :D

    You will have to restore your backup when you have one or more of the folowing problem:
    • Fake IMEI (usually 004999010640000) or "null" IMEI
    • Blinking SIM card icon on the top tray… ETC
    • Unable to unlock your SIM card using your PIN
    • Fake Serial Number (usually 0000000) or "null" Serial
    • Unable to register to the network (usually comes with Fake IMEI & Fake Serial so check them.)

    Attention please,
    If you are 100% that your EFS folder is damaged and you have a working EFS backup with the right IMEI number, my recommendation is this:

    1. With root explorer, go to your efs folder and delete all files inside
    2. Long press on power button will turn off your device.
    3. Then turn on the device, you will be in "Permanent Safe Mode".
    4. Continue to one of the following methods.



    Method 1 - restore .img backup

    First method, is an automatic backup/restore software.


    Special thanks to A.S._id for his software.
    Original thread:
    http://forum.xda-developers.com/showthread.php?t=2430177&nocache=1&styleid=19

    The software:
    SAMSUNG_I9500_EFS_BACKUP_RESTORE_AUTOMATIC


    Instructions:

    ! Need for backup Root access, debugging USB and busybox
    1. Extract from the zip and run. Bat file
    2. Is okay to your PC and follow the menu


    Automatically create a text file of all the parameters of the device at the time of the copy
    Automatic backup of efs:
    * Odin flash file. Tar.md5,
    * raw.img
    * Tar.gz archive
    Automatic naming of files and backup archive version of the firmware
    Restore to choose from archives and backup images
    Automatic start of Odin and the transition to the flashing mode when selecting Odin Restore


    DOWNLOAD

    Thanks to:
    shoma_81, tester99,
    For help and assist in the creation of tool


    p.s. * Deposit assured recovery - to have the device firmware version corresponding to the backup copy



    Method 2 - Restore .img backup


    Method number 2 will restore your efs.img backup from your internal sd.

    What you have to do is this:
    1. Put your efs.img on your phone memory(not external sd card!) in the main memory, not inside folder.
    2. Open terminal emulator
    3. Write the following:
      Code:
      su
      Then click enter. It will ask for super user permission, give it permissions.
    4. Then write:
      Code:
      dd if=/sdcard/efs.img of=/dev/block/mmcblk0p3 bs=4096
      Then click enter.
    5. Now, reboot your device. If you still don't have IMEI/You are still in Safe Mod, reboot again.
      In the second reboot, the bootanimation might stuck and the device will reboot automatically again. Don't worry, it is ok because it installs your efs.img.



    Method 3 - restore .tar.gz backup



    This method will restore .tar.gz backup.
    A tar.gz backup should look like this(On some devices there might be more files, but this picture was taken from Note II N7100 backup and it fully works):
    q2zs.png


    If you have like this, continue to the guide:
    1. Create on your Phone Memory(Not Extrenal sd!!) a folder called "efsbackup"(without quotes)
    2. Copy all files & folders from the EFS backup into "efsbackup" folder(The files are like in the picture)
    3. Download this script & copy it to your device:
      http://d-h.st/XcL
    4. Reboot into recovery
    5. Go to mount section and click on(Very important!):
    6. Now install the script you have downloaded.
    7. After it finishes, reboot.
    8. Now everything should be fixed, of course if your backup is 100% ok.
      If it doesn't work, try method 4.




    Method 4 - restore .tar.gz backup


    This method will restore .tar.gz backup.
    A tar.gz backup should look like this(On some devices there might be more files, but this picture was taked from Note II N7100 backup and it fully works):
    q2zs.png


    If you have like this, continue to the guide:
    1. Create on your Phone Memory(Not Extrenal sd!!) a folder called "efsbackup"(without quotes)
    2. Copy all files & folders from the EFS backup into "efsbackup" folder(The files are like in the picture)
    3. Using root explorer, go to "efsbackup folder, select all files & folders there, and click Copy.
    4. Still in root explorer, go to "efs" folder of your device(It is located where all main folders like data, system, etc.).
    5. In "efs" folder, click paste. It will ask you if you want to replace your files, select replace to all files(So all your files from "efsbackup" folder will be in "efs" folder)
    6. Now open terminal emulator
    7. Write the following:
      Code:
      su
      Then click enter. It will ask for super user permission, give it permissions.
    8. Now write:
      Code:
      busybox chown 1001:1001 /efs/nv_data.bin
      Then click enter.
    9. Now write:
      Code:
      busybox chmod 06755 /efs/nv_data.bin
      Then click enter.
    10. Reboot device. Now everything should work.




    Exit "Permanent Safe Mode"

    When you in "Permanent Safe Mode" situation, it means that your EFS folder is broken.
    If you succeeded in restoring your IMEI and you still stuck in this Safe Mode, use this guide:

    Method 1

    1. Open root explorer.
    2. Navigate to /efs/FactoryApp/
    3. Open "factorymode" file as Text and edit it:
      Change this:
      Code:
      OFF

      To:
      Code:
      ON
    4. Open "keystr" file as Text and edit it:
      Change this:
      Code:
      OFF

      To:
      Code:
      ON
    5. Reboot device.


    Method 2

    1. Open Terminal emulator
    2. Write the following:
      Code:
      su
      Then click enter. It will ask for super user permission, give it permissions.
    3. Write the following & click enter:
      Code:
      rm /efs/FactoryApp/keystr
    4. Write the following & click enter:
      Code:
      rm /efs/FactoryApp/factorymode
    5. Write the following & click enter:
      Code:
      echo -n ON >> /efs/FactoryApp/keystr
    6. Write the following & click enter:
      Code:
      echo -n ON >> /efs/FactoryApp/factorymode
    7. Write the following & click enter:
      Code:
      chown 1000.1000 /efs/FactoryApp/keystr
    8. Write the following & click enter:
      Code:
      chown 1000.1000 /efs/FactoryApp/factorymode
    9. Write the following & click enter:
      Code:
      chmod 0744 /efs/FactoryApp/keystr
    10. Write the following & click enter:
      Code:
      chmod 0744 /efs/FactoryApp/factorymode
    11. Reboot your device



    This is all I can do for you friends, Worked alot on these methods to give you the best information.
    Each method was tested by me and fully works.


    If this helped you please press the "Thanks" button.
    If you like & appreciate my work please consider a donation!






    Credits:
    • shnizlon
    • Candanga
    • A.S._id
    • dhiru1602
    • UtkarshGupta
    • P.M If you think that I forgot you

    XDA:DevDB Information
    Backup & Restore EFS + Get out from Permanent Safe mode I9500, a Tool/Utility for the Samsung Galaxy S 4

    Contributors
    tamirda

    Version Information
    Status: Stable

    Created 2013-09-05
    Last Updated 2013-09-05
    4
    Awesome my friend 5 stars hit, I will link you in my post.

    I hope people read in detail and take precautions

    Hugs

    Sent from my GT-I9500

    Thank you my friend,
    In my note II I did like 20 backups before I deleted my EFS folder around 20 times ahah.
    People should be aware that samsung is trying to mess up our devices.
    4
    When I backup the rom I forget my phone in flight mode maybe this the reason why I lost my imei ?
    And my baseband now is
    I9500DDUBMF8


    Sent From my i9500 With Crash Rom

    --------------------------------
    ادعوا لي بالتوفيق في امتحاناتي
    wish me good luck for my exams

    I don't think there is connection between these two.
    Downlaod this:
    http://d-h.st/esG
    Open odin, Select Phone, select the modem's tar, connect phoen and flash.
    After that check if you have IMEI.
    If not, Try to install stock XXUBMG9 or XXUBMG5 - If you had MG5 before, it seems that you can not downgrade your phone, so try to install MG5.
    If after MG5 there is still no IMEI,
    Flash again as Phone via odin this modem:
    http://d-h.st/Xxk

    If still there is no IMEI, try to restore your current EFS backup.(Make sure you have Root and busybox and all I asked in the main thread)
    If after that no IMEI,
    Restore to stock and use warranty( make a story that you woke up one morning and you couldn't conect to your network, and you tried to mnake factory reset and still it didn't help)

    Good luck
    3
    Awesome my friend 5 stars hit, I will link you in my post.

    I hope people read in detail and take precautions

    Hugs

    Sent from my GT-I9500
    2
    Excellent my friend tamirda! :good:
    regards!
    5 stars! and sticky please!