[Guide] EFS Backup and Restore

Modding is good as long as everything is fine. It will seem complicated the first few times, but after learning how to flash the first custom recovery, rom or kernel, it will be a walk; however, this does not mean that problems, even sometimes serious ones, cannot occur. In fact, a damaged rom is enough - perhaps for a download that went wrong - or an incompatible kernel or worse still a rom from another terminal to face unwanted problems.

Jump and go directly to the guide Samsung - LG - Xiaomi

Error: at best, the ROM is not installed and so far so good, nothing happened. Just download the ROM again and in any case make sure BEFORE the file MD5 checksum of the downloaded file is the same.

Soft brick: one of the most common problems is to soft brick which is relatively not a big problem, but more a nuisance of a possible loss of data. It is recognized because at startup, the phone remains fixed on the phone or rom logo: bootloop. All you need is a backup image - obviously done before - to restore and for this I send you to the guide of Nandroid Backup. If not, simply wipe data or flash the installed ROM file again

Hard brick: it is a more serious problem than the soft brick because there is the risk that the terminal does not turn on anymore. However, if you have any luck, if the terminal is recognized by the PC there is always a way to recover it and for many smartphones there are many guides on the web. Even for certain models there are guides to awaken it even if this no longer gives any sign of life. In the worst case it is necessary to resort to assistance and most likely the fault will not be recognized as a guarantee.

Corruption / efs: as far as I'm concerned it's the worst thing that can happen. If during the flash the partition that contains these files is touched, with consequent alteration or deletion, you risk having an unusable phone: without IMEI and therefore network, WiFi and bluetooth. In this partition we therefore find files only that identify every single phone.

It's a rare case but unfortunately it can happen at any moment, so let's see how to make a backup of these files. It is obvious that root permissions are needed, also because without them it is impossible for files to be deleted / corrupted.

 

Efs backup guide

The process changes from device to device and there are more ways to do it, especially with regards to devices Samsung. I will explain only two methods, which for me are the simplest and most immediate but at the same time safe, namely the one for recovery and the terminal one. The first one will probably only work on a certain number of phones, the second will work on most, but be careful because for each device the path to be followed will be different.

 

1. Backup efs from recovery

A custom recovery provides many more tools and options that facilitate the use and management of the terminal. In Philz recovery, for example, we find a very useful and quick option to create a backup on the fly, here's how:

  1. restart in recovery
  2. choose backup and restore
  3. choose custom backup and restore, Then custom backup job
  4. at this point select ONLY Backup efs and choose Start custom backup and restore

The backup will be saved in the folder clockworkmod / custom_backup / .efs_backup. It is recommended to save the backup in a safe place

Restoration has the same procedure with the difference that will have to be chosen restore at the backup place. Most likely, the process will only work on a Samsung device.

 

2. Backup efs from terminal

To backup from a terminal (or with ADB) you need to install one from the Play Store unless your Roma has one pre-installed (like the CM). Then start it and run the following commands:

2.1 Backup efs Samsung devices

Backup
on busybox tar zcvf /sdcard/efs-backup.tar.gz / efs
Restoration
on busybox tar zxvf / sdcard /BackupName.tar.gz -C /

where BackupName is the name of your backup. It is necessary busybox

2.1.1 Alternative Samsung devices

Backup

on internal memory

su dd if = / dev / block / mmcblk0p3 of = / storage / sdcard / efs.img bs = 4096

on external memory

su dd if = / dev / block / mmcblk0p3 of = / storage / extSdCard / efs.img bs = 4096
Restoration

from internal memory

su dd if = / storage / sdcard / efs.img of = / dev / block / mmcblk0p3 bs = 4096

from external memory

su dd if = / storage / extSdCard / efs.img of = / dev / block / mmcblk0p3 bs = 4096

 

2.2 (LG) Backup efs LG Optimus G

Backup
su
dd if=/dev/block/platform/msm_sdcc.1/by-name/m9kefs1 of=/sdcard/m9kefs1.img
dd if=/dev/block/platform/msm_sdcc.1/by-name/m9kefs2 of=/sdcard/m9kefs2.img
dd if=/dev/block/platform/msm_sdcc.1/by-name/m9kefs3 of=/sdcard/m9kefs3.img
Restoration
su
dd if=/sdcard/m9kefs1.img of=/dev/block/platform/msm_sdcc.1/by-name/m9kefs1
dd if=/sdcard/m9kefs2.img of=/dev/block/platform/msm_sdcc.1/by-name/m9kefs2
dd if=/sdcard/m9kefs3.img of=/dev/block/platform/msm_sdcc.1/by-name/m9kefs3

 

2.2.1 Backup efs LG G2, G3

Backup
su dd if = / dev / block / platform / msm_sdcc.1 / by-name / modemst1 of = / sdcard / modemst1.img dd if = / dev / block / platform / msm_sdcc.1 / by-name / modemst2 of = / sdcard / modemst2.img
Restoration
su dd if = / sdcard / modemst1.img of = / dev / block / platform / msm_sdcc.1 / by-name / modemst1 dd if = / sdcard / modemst2.img of = / dev / block / platform / msm_sdcc.1 / by-name / modemst2

 

Backup efs Xiaomi Mi2

Backup
su
dd if=/dev/block/platform/msm_sdcc.1/by-name/m9kefs1 of=/sdcard/m9kefs1.img
dd if=/dev/block/platform/msm_sdcc.1/by-name/m9kefs2 of=/sdcard/m9kefs2.img
dd if=/dev/block/platform/msm_sdcc.1/by-name/m9kefs3 of=/sdcard/m9kefs3.img
Restoration
su
dd if=/sdcard/m9kefs1.img of=/dev/block/platform/msm_sdcc.1/by-name/m9kefs1
dd if=/sdcard/m9kefs2.img of=/dev/block/platform/msm_sdcc.1/by-name/m9kefs2
dd if=/sdcard/m9kefs3.img of=/dev/block/platform/msm_sdcc.1/by-name/m9kefs3

 

Conclusions

The files that we go to 'backuppare' are the important files that identify the IMEI, the modem, the BT. The guide was written based on the devices that are most exposed to this risk, especially Samsung.
What is recommended is don't absolutely copy files via a file explorer, because the files would lose important data.

commands

The commands can also be run from a PC using ADB, executing adb shell before the commands shown above. The command su it is used to get root permissions. Finally dd it is used to write files in blocks and consequently if = file is the name of the file from which to take data e of = file is the file to write to.

Although the risk on other devices is low, it is possible to create an efs backup with the commands just explained, appropriately replacing the root and destination of the file. You can check the file location with a common file explorer. For any clarification, do not hesitate to ask!

Receive the latest posts by email

Enter the email and choose the inscriptions on the new page

InTheBit.it
Added devices
  • Compare Smartphone (0)
  • Compare Notebook (0)
Compare