[Note 7 ROMs, Kernels, Recoveries, & Other Developm] dr.ketan:
What is EFS

This part of the device contains some important and some basic info related to our device identity like Bluetooth MAC address, wireless devices MAC addresses, product code (also in the nv_data.bin) and the very main IMEI address (nv_data.bin), programming parameters for the device such as your account information (phone number, etc), data provisioning parameters, and a whole bunch of other things. So you can guess it's will be different for each device and one can't use others. In latest samsung device this information store in other partition so requires to make backup of that partition too.

How it can corrupt :

- Any bad flashing, mishandling system modification can cause this.

- Also It can be corrupted by downgrading stock ROM. If you flash any old ROM on newer ROM it can corrupt EFS. Basically newer ROM believed to have new kernel that changes EFS data which older Modems can't read and results to fail in reading IMEI.

Impact on device/How I know I have corrupted EFS

When there is EFS partition is corrupted, device loses IMEI and due to this device can't gets connected to network. Baseband info also sometimes shows unknown.

-Check your IMEI in setting / by dialling *#06# if it is null OR if it starts with 0049** then IMEI is generic and corrupted. In Normal case IMEI which you can see in device setting or dialing *#06# is exactly same you can see on bill/box/sticker under battery compartment

-If you are unable to connect to network in spite of correct IMEI, chance are

A. Your device is Locked to specific Network OR

B. Your device is banned due to tempered IMEI

-If your AP,CP,CSC all are correct and even you are getting error (unknown CSC XXX) on kies update, it may be due to corrupt Product code in EFS. Read This for detail.

What care should i take

Before flashing anything, first thing you should do is to make EFS backup. Every person who have rooted device should make EFS backup earliest and place it to safer place on PC and /Cloud.

If you are on older ROM, make EFS backup on older ROM as well make another after upgrading ROM too.

If you have already updated to newer ROM, make backup on current ROM.

Exit "Permanent Safe Mode" This condition represent with loss of IMEI + yellow text box on homescreen with device info.here is Screenshot

Here is different method to remove it.

Method1 :

Open root explorer.

Navigate to /efs/FactoryApp/

Open "factorymode" file as Text and edit it:

Change this:

OFF

To:

ON

Open "keystr" file as Text and edit it:

OFF

To:

ON

Reboot device.

Method2:

Open Terminal emulator

Write the following:

su

Then click enter. It will ask for super user permission, give it permissions.

Write the following & click enter:

rm /efs/FactoryApp/keystr

Write the following & click enter:

rm /efs/FactoryApp/factorymode

Write the following & click enter:

echo -n ON >> /efs/FactoryApp/keystr

Write the following & click enter:

echo -n ON >> /efs/FactoryApp/factorymode

Write the following & click enter:

chown 1000.1000 /efs/FactoryApp/keystr

Write the following & click enter:

chown 1000.1000 /efs/FactoryApp/factorymode

Write the following & click enter:

chmod 0744 /efs/FactoryApp/keystr

Write the following & click enter:

chmod 0744 /efs/FactoryApp/factorymode

Reboot your device

Method3

Install attached safemode_exit apk as regular app. Open from drawer - Grant su permission - Reboot when asked.

e:failed to mount /efs(invalid argument) error with bootloop

This condition usually happens with using unsupported tool (usually from play store).

To recover this, needs to use adb shell

adb shell
mke2fs / dev/block/mmcblk0p[COLOR="Red"]x[/COLOR]
mount-w-t ext4 / dev/block/mmcblk0p[COLOR="red"]x[/COLOR] / efs

x means your device EFS partition number. Here this is for just visual representation. Block number/Name may be completely different on your device.

PS : It needs CWM and busybox installed.