[EFS][IMEI][ZIP]Nexus 4 IMEI/EFS Backup/Restore Flashable Zip

Search This thread

NABENDU1

Senior Member
May 31, 2012
357
666
MUMBAI
IMEI/EFS BACKUP

What is EFS/IMEI ?

Every Phone has a partition which contains data relating to your IMEI ,radio settings,data profiles etc.. This in particular is famous with Samsung devices which have the root /EFS folder and which is higly recommended to be backed up before flashing any Custom ROMs..However there is a common misconception that there is no EFS partition for the Nexus since there is no root /EFS Directory and everything is contained in dev/blocks ..

On the Nexus 4 the IMEI info is stored in the three blocks

m9kefs1 (/dev/block/mmcblk0p8)
m9kefs2 (/dev/block/mmcblk0p9)
m9kefs3 (/dev/block/mmcblk0p10)

These blocks contain all the IMEI info pertaining to your device.This data is highly Device specific that means each device has a different data in each block unlike the blocks for recovery,boot which are common for all . So EFS/IMEI of your device is Unique to your phone itself and hence it is necessary to backup your EFS.

WHY BACKUP EFS ?

1) Some points have been covered in the What section itself ( Unique to each device, important data)
2) Sometimes during a flash or even otherwise there is a bad block in your partition which corrupts a part of the EFS/IMEI partition . You are left with nothing but a dead weight you can use as a tablet without calling features or you will need to revert back to baseband version .27(This baseband seems magical since it still is able to read the corrupted data) and Android 4.2.2 .This makes it essential to backup your current partitions to flash the same if ever the same problem occurs with your device.

HOW TO BACKUP ?

FLASHABLE ZIP

Original Script from Nexus 5 thread courtesy @autoprime modified for the Nexus 4

*Download Nexus_4_Backup_EFS.zip to your SD Card from Links below!!
*
*Flash the same with TWRP/CWM no wipes needed-reboot
*
*This will create a flashable zip (efsbackupflashable.zip) in /sdcard/EFS_Backup/ ...
*
*If you can't find it under /sdcard/EFS_Backup/... try /data/media/EFS_Backup/ instead. (Thanks @pincher65 )
*
*Also the EFS_Backup will contain the raw images of the 3 blocks (m9kefs1.img,m9kefs2.img,m9kefs3.img)
*
*Note each of the 3 .imgs will be exactly of 780 kb each
*
*Save this folder to your PC/Email/Drive for safety purpose


DOWNLOAD LINKS FOR BACKUP

EXT4 Version ( If you dont know what F2FS is you are on ext4 )
Link https://drive.google.com/file/d/0ByrfJAT1lgDFNnI5TUxPX0dHOHc/edit?usp=sharing
Mirror https://mega.co.nz/#!d98hyaqS!VXiuQJv5KABx-q1qqezQXqNDYiQ8liejt3pyZVOl3co

F2FS Version (Only for devices with /system formatted as F2FS)
Link https://drive.google.com/file/d/0ByrfJAT1lgDFbGY0RDNOQ1R2OHM/edit?usp=sharing
Mirror https://mega.co.nz/#!dgc0AZDT!Jv0LrcA-zOxzTTMfbAL8rHI5EYU_f21jSSiC3cJRU2E


Restoring EFS

***NOTE*** DO NOT USE YOUR BACKUP ON ANY OTHER NEXUS 4***/NOTE***

To restore your original EFS just boot into recovery and flash the efsbackupflashable.zip in your /sdcard/EFS_Backup folder.

If flashable zip wasn't created or to manually restore efs img files run the following commands using adb shell while in recovery

If saved in /sdcard/EFS_Backup

Code:
dd if=/sdcard/EFS_Backup/m9kefs1.img of=/dev/block/mmcblk0p8
dd if=/sdcard/EFS_Backup/m9kefs2.img of=/dev/block/mmcblk0p9
dd if=/sdcard/EFS_Backup/m9kefs3.img of=/dev/block/mmcblk0p10

If saved in /data/media/EFS_Backup/

Code:
dd if=/data/media/EFS_Backup/m9kefs1.img of=/dev/block/mmcblk0p8
dd if=/data/media/EFS_Backup/m9kefs2.img of=/dev/block/mmcblk0p9
dd if=/data/media/EFS_Backup/m9kefs3.img of=/dev/block/mmcblk0p10

CREDITS

Code:
 [user=2684188]@autoprime[/user] : For his script and N5 thread 
[user=4851200]@Rohit02[/user]    : For testing the Zip on F2FS and his amazing WA Grp :p

HIT THE THANKS BUTTON IF YOU LIKE MY WORK
 
Last edited:

Rohit02

Senior Member
Sep 17, 2012
4,090
3,799
Pune
Thanks for this good and VITAL thread for all Nexus4 users. Many users are going to be helped by this.. :):good:
 
  • Like
Reactions: NABENDU1

perfoliate

Senior Member
Oct 3, 2010
309
173
This looks great, One thing I noticed though, downloading the F2FS version from Mega was that it was named the same as EXT4 version. Could you rename them to avoid confusion for users and prevent accidental flashing of the wrong format version. Also just to report the google drive links seem to just open up inside the folder and don't provide an option for downloading the zip as a package. Thanks a lot for your effort :good:
 

NABENDU1

Senior Member
May 31, 2012
357
666
MUMBAI
This looks great, One thing I noticed though, downloading the F2FS version from Mega was that it was named the same as EXT4 version. Could you rename them to avoid confusion for users and prevent accidental flashing of the wrong format version. Also just to report the google drive links seem to just open up inside the folder and don't provide an option for downloading the zip as a package. Thanks a lot for your effort :good:

Yup the names are the same for ext4 and f2fs but on the thread it specifically mentions the ext4 links separate than f2fs !! I think I'll change it later !! Also if you request desktop version in chrome youll be able to view the download tab !! Anyways will fix it though I dont like drive a lot
 

perfoliate

Senior Member
Oct 3, 2010
309
173
Yup the names are the same for ext4 and f2fs but on the thread it specifically mentions the ext4 links separate than f2fs !! I think I'll change it later !! Also if you request desktop version in chrome youll be able to view the download tab !! Anyways will fix it though I dont like drive a lot

Thanks. I realized they were separate links but some people like myself might download both. I tried requesting desktop version as well as trying on my PC. Hmm. Maybe I could try another browser, but mega worked just fine. Anyway thanks again for doing this :)
.

Sent from my Nexus 4 using Tapatalk
 
  • Like
Reactions: NABENDU1

NABENDU1

Senior Member
May 31, 2012
357
666
MUMBAI
Was surfing through the Nexus 5 Forums !! Saw more than 750 posts or 75 pages for the EFS Backup Thread out there !! Seems that guys owning the N4 dont seem interested in backing up their IMEI partitions !! Anyways ppl have a nyc day ahead !!

ps: too many typos im making today !!
 
Last edited:
  • Like
Reactions: Rohit02

theBeachBoy

Senior Member
Dec 3, 2012
79
9
If I use a backup on a different Nexus 4 (brioken screen, would like to put the IMEI of the broken phone on the new phone), would that work?

basically extract the file from the broken phone and load it on the intact phone?
 

rhostik

New member
Dec 5, 2014
4
0
Hi, I used CWM recovery. It flashed ok but I have no EFS_backup folder in either /sdcard or data/media. I searched the whole phone and no zip file was created.

Using Lollipop 5.0.1 if that's important...
 

Top Liked Posts

  • There are no posts matching your filters.
  • 28
    IMEI/EFS BACKUP

    What is EFS/IMEI ?

    Every Phone has a partition which contains data relating to your IMEI ,radio settings,data profiles etc.. This in particular is famous with Samsung devices which have the root /EFS folder and which is higly recommended to be backed up before flashing any Custom ROMs..However there is a common misconception that there is no EFS partition for the Nexus since there is no root /EFS Directory and everything is contained in dev/blocks ..

    On the Nexus 4 the IMEI info is stored in the three blocks

    m9kefs1 (/dev/block/mmcblk0p8)
    m9kefs2 (/dev/block/mmcblk0p9)
    m9kefs3 (/dev/block/mmcblk0p10)

    These blocks contain all the IMEI info pertaining to your device.This data is highly Device specific that means each device has a different data in each block unlike the blocks for recovery,boot which are common for all . So EFS/IMEI of your device is Unique to your phone itself and hence it is necessary to backup your EFS.

    WHY BACKUP EFS ?

    1) Some points have been covered in the What section itself ( Unique to each device, important data)
    2) Sometimes during a flash or even otherwise there is a bad block in your partition which corrupts a part of the EFS/IMEI partition . You are left with nothing but a dead weight you can use as a tablet without calling features or you will need to revert back to baseband version .27(This baseband seems magical since it still is able to read the corrupted data) and Android 4.2.2 .This makes it essential to backup your current partitions to flash the same if ever the same problem occurs with your device.

    HOW TO BACKUP ?

    FLASHABLE ZIP

    Original Script from Nexus 5 thread courtesy @autoprime modified for the Nexus 4

    *Download Nexus_4_Backup_EFS.zip to your SD Card from Links below!!
    *
    *Flash the same with TWRP/CWM no wipes needed-reboot
    *
    *This will create a flashable zip (efsbackupflashable.zip) in /sdcard/EFS_Backup/ ...
    *
    *If you can't find it under /sdcard/EFS_Backup/... try /data/media/EFS_Backup/ instead. (Thanks @pincher65 )
    *
    *Also the EFS_Backup will contain the raw images of the 3 blocks (m9kefs1.img,m9kefs2.img,m9kefs3.img)
    *
    *Note each of the 3 .imgs will be exactly of 780 kb each
    *
    *Save this folder to your PC/Email/Drive for safety purpose


    DOWNLOAD LINKS FOR BACKUP

    EXT4 Version ( If you dont know what F2FS is you are on ext4 )
    Link https://drive.google.com/file/d/0ByrfJAT1lgDFNnI5TUxPX0dHOHc/edit?usp=sharing
    Mirror https://mega.co.nz/#!d98hyaqS!VXiuQJv5KABx-q1qqezQXqNDYiQ8liejt3pyZVOl3co

    F2FS Version (Only for devices with /system formatted as F2FS)
    Link https://drive.google.com/file/d/0ByrfJAT1lgDFbGY0RDNOQ1R2OHM/edit?usp=sharing
    Mirror https://mega.co.nz/#!dgc0AZDT!Jv0LrcA-zOxzTTMfbAL8rHI5EYU_f21jSSiC3cJRU2E


    Restoring EFS

    ***NOTE*** DO NOT USE YOUR BACKUP ON ANY OTHER NEXUS 4***/NOTE***

    To restore your original EFS just boot into recovery and flash the efsbackupflashable.zip in your /sdcard/EFS_Backup folder.

    If flashable zip wasn't created or to manually restore efs img files run the following commands using adb shell while in recovery

    If saved in /sdcard/EFS_Backup

    Code:
    dd if=/sdcard/EFS_Backup/m9kefs1.img of=/dev/block/mmcblk0p8
    dd if=/sdcard/EFS_Backup/m9kefs2.img of=/dev/block/mmcblk0p9
    dd if=/sdcard/EFS_Backup/m9kefs3.img of=/dev/block/mmcblk0p10

    If saved in /data/media/EFS_Backup/

    Code:
    dd if=/data/media/EFS_Backup/m9kefs1.img of=/dev/block/mmcblk0p8
    dd if=/data/media/EFS_Backup/m9kefs2.img of=/dev/block/mmcblk0p9
    dd if=/data/media/EFS_Backup/m9kefs3.img of=/dev/block/mmcblk0p10

    CREDITS

    Code:
     [user=2684188]@autoprime[/user] : For his script and N5 thread 
    [user=4851200]@Rohit02[/user]    : For testing the Zip on F2FS and his amazing WA Grp :p

    HIT THE THANKS BUTTON IF YOU LIKE MY WORK
    2
    Was surfing through the Nexus 5 Forums !! Say more than 750 posts or 75 pages for the EFS Backup Thread out there !! Seems that guys owning a N4 dont seem intereswted in backing up their IMEI partitions !! Any ppl have a nyc day ahead !!

    Dont worry they will realize soon when their phone gets fu%%ed up. ;):D.

    We are safe. :good:
    1
    Thanks for this good and VITAL thread for all Nexus4 users. Many users are going to be helped by this.. :):good:
    1
    Yup the names are the same for ext4 and f2fs but on the thread it specifically mentions the ext4 links separate than f2fs !! I think I'll change it later !! Also if you request desktop version in chrome youll be able to view the download tab !! Anyways will fix it though I dont like drive a lot

    Thanks. I realized they were separate links but some people like myself might download both. I tried requesting desktop version as well as trying on my PC. Hmm. Maybe I could try another browser, but mega worked just fine. Anyway thanks again for doing this :)
    .

    Sent from my Nexus 4 using Tapatalk
    1
    Well sucks to be me because my phone was on a bootloop on android 5.1.1. I downgraded to 4.2.2 which allowed it to load, but I didn't know about the EFS/IMEI thing. Now it's showing up as Unknown. Would you possibly have a copy of the baseband version .27? Maybe when I flash that, my IMEI will show up.

    In any case, I do have my IMEI # elsewhere, just not on the phone... If anyone knows how to write the IMEI # onto the phone, I would forever be in your debt.
    No one here will be able to tell you how to write the imei. It is illegal in many countries and as such all talks of it are banned.