How to back up imei/efs?

Search This thread

serophia

Senior Member
Feb 8, 2013
328
97
California
Does anyone know how to back them up? I came from a Samsung device and do not see the efs folder, I'm assuming it is stored elsewhere?

Sent from my XT1034 using xda app-developers app
 
D

Darth

Guest
That's only a Samsung thing.

Sent from my Moto X cellular telephone...
 

serophia

Senior Member
Feb 8, 2013
328
97
California
Yea but for us its somewhere in a PDS folder I went to it but don't know which file to back up

Sent from my XT1034 using xda app-developers app
 
D

Darth

Guest
Backing it up was a safeguard for Samsung devices. Its not practiced on other phones...if it exists...which I don't think it does. And if it does....it is meaningless on non Samsung phones. Backing it up that is.

Google it. :)

Sent from my Moto X cellular telephone...
 

lost101

Inactive Recognized Contributor
May 30, 2008
7,417
9,305
A number of people appear to have already managed to loose their IMEI, so it might be worth finding a way to back it up.

If serophia is correct, and imei is stored in the 'pds' partition - it could be backed up using adb:
adb shell
su
dd if=/dev/block/platform/msm_sdcc.1/by-name/pds of=/sdcard/pds.img​

To restore:
dd if=pds.img of=/dev/block/platform/msm_sdcc.1/by-name/pds​

The pds.img could also be turned into a cwm flashable zip:
ui_print("Restoring IMEI ...");
package_extract_file("pds.img", "/dev/block/mmcblk0p26");
ui_print("Finished!"); ui_print();​

Maybe someone could make a tool to simply the process further?

Further information:
In addition to the EFS partition, there are several partitions on our n9005 devices that do not exist in official odin roms.

This means that they must be unique to your phone, and they might be as important to back up as the EFS folder to prevent IMEI loss or other problems (like those bootloops many people get when flashing kernels, which appear to be tied to corrupted modemst1 partitions).

These partitions are: modemst1, modemst2, fsg, fsc, backup, dbi, ddr, pad

Full list of partitions on Moto G:

DDR -> /dev/block/mmcblk0p3
aboot -> /dev/block/mmcblk0p4
abootBackup -> /dev/block/mmcblk0p11
boot -> /dev/block/mmcblk0p31
cache -> /dev/block/mmcblk0p33
cid -> /dev/block/mmcblk0p25
clogo -> /dev/block/mmcblk0p28
dhob -> /dev/block/mmcblk0p20
fsc -> /dev/block/mmcblk0p22
fsg -> /dev/block/mmcblk0p21
hob -> /dev/block/mmcblk0p19
kpan -> /dev/block/mmcblk0p35
logo -> /dev/block/mmcblk0p27
logs -> /dev/block/mmcblk0p9
misc -> /dev/block/mmcblk0p30
modem -> /dev/block/mmcblk0p1
modemst1 -> /dev/block/mmcblk0p17
modemst2 -> /dev/block/mmcblk0p18
padA -> /dev/block/mmcblk0p10
padB -> /dev/block/mmcblk0p16
pds -> /dev/block/mmcblk0p26
persist -> /dev/block/mmcblk0p29
recovery -> /dev/block/mmcblk0p32
rpm -> /dev/block/mmcblk0p5
rpmBackup -> /dev/block/mmcblk0p12
sbl1 -> /dev/block/mmcblk0p2
sdi -> /dev/block/mmcblk0p7
sdiBackup -> /dev/block/mmcblk0p14
sp -> /dev/block/mmcblk0p24
ssd -> /dev/block/mmcblk0p23
system -> /dev/block/mmcblk0p34
tz -> /dev/block/mmcblk0p6
tzBackup -> /dev/block/mmcblk0p13
userdata -> /dev/block/mmcblk0p36
utags -> /dev/block/mmcblk0p8
utagsBackup -> /dev/block/mmcblk0p15
 

lost101

Inactive Recognized Contributor
May 30, 2008
7,417
9,305
@serophia, @lost101

I understand Nexus 5 stores IMEI in modemst1 and/or modemst2.
Isn´t this our case too?
Where did you get the info about pds from?

Both modemst1 and modemst2 can be safely wiped without losing IMEI. When restoring Stock Firmware the following commands are included:
fastboot erase modemst1
fastboot erase modemst2​

That is not to say IMEI is not stored there temporarily; but it must exist another more permanent location. AFAIK, 'pds' is not touched by any normal fastboot firmware flashing process making it a good candidate.

EDIT: Searching XDA for "pds partition imei" turns up mainly Motorola devices. It appears to be the permanent location of a few unique device indendifiers:
Well it's kinda obvious, you need to flash a retail /pds partition. The thing is, you wont get it, cuz it has sensitive data like IMEI, MAC address, serial number, etc.​
[source]
 
Last edited:

RestlessScreams

Senior Member
Oct 17, 2012
275
79
And how could I edit the pds.img to find/restore my imei?
Because if I'm in fastboot and type getvar imei it's there, but in dialer it says "0".
Any help/solutions?
Maybe with a HEX editor?
 

drfr

Senior Member
Jul 6, 2011
1,129
633
Púchov, Slovakia
And how could I edit the pds.img to find/restore my imei?
Because if I'm in fastboot and type getvar imei it's there, but in dialer it says "0".
Any help/solutions?
Maybe with a HEX editor?

You can´t edit it, I tried to look with hex editor. That´s why it is good idea to back it up before something bad happens, sorry.

---------- Post added at 04:38 PM ---------- Previous post was at 04:32 PM ----------

fastboot erase modemst1
fastboot erase modemst2​

Yeah, that´s what I realized too.
Even if it´s there just temporarily, it´s there and it won´t do any harm to back them up besides the pds partition.
Edit: btw just noticed that the pds size is exactly a sum of modemst1 + 2 sizes. I know that that doesn´t prove anything but...
Another thing - I´ve read somewhere from a user who compared hashes of his multiple modemst backups and they differed. Apparently there are some other non-constant infos stored there besides IMEI, that´s why it is erased during fastboot flash.
 
Last edited:

RestlessScreams

Senior Member
Oct 17, 2012
275
79
You can´t edit it, I tried to look with hex editor. That´s why it is good idea to back it up before something bad happens, sorry.

---------- Post added at 04:38 PM ---------- Previous post was at 04:32 PM ----------



Yeah, that´s what I realized too.
Even if it´s there just temporarily, it´s there and it won´t do any harm to back them up besides the pds partition.
Edit: btw just noticed that the pds size is exactly a sum of modemst1 + 2 sizes. I know that that doesn´t prove anything but...
Another thing - I´ve read somewhere from a user who compared hashes of his multiple modemst backups and they differed. Apparently there are some other non-constant infos stored there besides IMEI, that´s why it is erased during fastboot flash.

So I'm prett fuc*d ?:cyclops:
 

lost101

Inactive Recognized Contributor
May 30, 2008
7,417
9,305
Here is a detailed guide for entering a new IMEI number on Droid Razor, access via BP Tools Mode:
[HOW TO][FIX] Recover your IMEI
http://xdaforums.com/showthread.php?t=1960918
EDIT: In that thread someone suggests flashing the Stock Firmware Image without a SIM inserted, boot phone and skip all, proceed to home screen, shutdown, insert SIM and boot.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    A number of people appear to have already managed to loose their IMEI, so it might be worth finding a way to back it up.

    If serophia is correct, and imei is stored in the 'pds' partition - it could be backed up using adb:
    adb shell
    su
    dd if=/dev/block/platform/msm_sdcc.1/by-name/pds of=/sdcard/pds.img​

    To restore:
    dd if=pds.img of=/dev/block/platform/msm_sdcc.1/by-name/pds​

    The pds.img could also be turned into a cwm flashable zip:
    ui_print("Restoring IMEI ...");
    package_extract_file("pds.img", "/dev/block/mmcblk0p26");
    ui_print("Finished!"); ui_print();​

    Maybe someone could make a tool to simply the process further?

    Further information:
    In addition to the EFS partition, there are several partitions on our n9005 devices that do not exist in official odin roms.

    This means that they must be unique to your phone, and they might be as important to back up as the EFS folder to prevent IMEI loss or other problems (like those bootloops many people get when flashing kernels, which appear to be tied to corrupted modemst1 partitions).

    These partitions are: modemst1, modemst2, fsg, fsc, backup, dbi, ddr, pad

    Full list of partitions on Moto G:

    DDR -> /dev/block/mmcblk0p3
    aboot -> /dev/block/mmcblk0p4
    abootBackup -> /dev/block/mmcblk0p11
    boot -> /dev/block/mmcblk0p31
    cache -> /dev/block/mmcblk0p33
    cid -> /dev/block/mmcblk0p25
    clogo -> /dev/block/mmcblk0p28
    dhob -> /dev/block/mmcblk0p20
    fsc -> /dev/block/mmcblk0p22
    fsg -> /dev/block/mmcblk0p21
    hob -> /dev/block/mmcblk0p19
    kpan -> /dev/block/mmcblk0p35
    logo -> /dev/block/mmcblk0p27
    logs -> /dev/block/mmcblk0p9
    misc -> /dev/block/mmcblk0p30
    modem -> /dev/block/mmcblk0p1
    modemst1 -> /dev/block/mmcblk0p17
    modemst2 -> /dev/block/mmcblk0p18
    padA -> /dev/block/mmcblk0p10
    padB -> /dev/block/mmcblk0p16
    pds -> /dev/block/mmcblk0p26
    persist -> /dev/block/mmcblk0p29
    recovery -> /dev/block/mmcblk0p32
    rpm -> /dev/block/mmcblk0p5
    rpmBackup -> /dev/block/mmcblk0p12
    sbl1 -> /dev/block/mmcblk0p2
    sdi -> /dev/block/mmcblk0p7
    sdiBackup -> /dev/block/mmcblk0p14
    sp -> /dev/block/mmcblk0p24
    ssd -> /dev/block/mmcblk0p23
    system -> /dev/block/mmcblk0p34
    tz -> /dev/block/mmcblk0p6
    tzBackup -> /dev/block/mmcblk0p13
    userdata -> /dev/block/mmcblk0p36
    utags -> /dev/block/mmcblk0p8
    utagsBackup -> /dev/block/mmcblk0p15