How to Fix Empty IMEI, Corrupted EFS, No SIM, Unknown Baseband and WiFi/Bluetooth issues after restoring a TWRP Backup

Avatar

While flashing things with TWRP is fun and games, it can sometimes also lead to serious issues on your device. If proper care is not taken or if the installed TWRP recovery on your device has bugs/issues, then restoring a backup from it may corrupt your device, resulting in lost information and features.

Below is a list of issues that could occur when a TWRP restore goes wrong:

  • No IMEI number
  • Corrupted EFS
  • No SIM, card not detected
  • Unknown Baseband
  • Issues with WiFi and Bluetooth

The major cause behind all these issues after restoring a TWRP backup is the EFS partition. The EFS partition sometimes fails to restore correctly and hence corrupts all other partitions as well.

Developer jcadduono has explained the issue in detail, so we’ll just go ahead quote him below:

The EFS restoration issue was due to a missing file name set bug during the backup restoration process.

This caused all subpartitions associated with a backup-enabled partition to have the first item (ex. the main/non-subpartition) restored to all subpartitions as well.

See for example the partition entries in Angler’s recovery.fstab:

Code:
/efs1            emmc              /dev/block/platform/soc.0/f9824900.sdhci/by-name/modemst1  flags=backup=1;display=EFS
/efs2            emmc              /dev/block/platform/soc.0/f9824900.sdhci/by-name/modemst2  flags=backup=1;subpartitionof=/efs1

While creating the backup of EFS, you will end up with:
efs1.emmc.win (modemst1 partition raw data)
efs2.emmc.win (modemst2 partition raw data)

When restoring this EFS backup, what happened was the file name was not updated for restore, and you ended up with:
Restoring EFS…
Restoring efs1.emmc.win to modemst1
Restoring efs1.emmc.win to modemst2

It should have been:
Restoring EFS…
Restoring efs1.emmc.win to modemst1
Restoring efs2.emmc.win to modemst2

Losing your device’s IMEI and cellular functionality is pretty scary. But fret not! Fixing the issue is fairly simple. You just have to erase/reset the modemst1 partition and things will be good again.

You can fix the issue from TWRP recovery, over ADB from Android or via Bootloader mode using Fastboot commands. Below are detailed instructions for both:

How to Fix EFS from TWRP recovery

  1. Boot into TWRP recovery.
  2. From TWRP’s main screen, select Advanced » then Terminal.
  3. Type the following commands in terminal (one by one):
    dd if=/dev/zero of=/dev/block/bootdevice/by-name/modemst1
    dd if=/dev/zero of=/dev/block/bootdevice/by-name/modemst2
  4. Reboot device.

How to Fix EFS over ADB

  1. Setup ADB and Fastboot on your PC.
  2. Enable Developer options & USB debugging on your Android device.
  3. Connect your device to the PC and open a command window on the PC.
  4. Issue the following commands one by one:
    adb shell 'dd if=/dev/zero of=/dev/block/bootdevice/by-name/modemst1'
    adb shell 'dd if=/dev/zero of=/dev/block/bootdevice/by-name/modemst2'
    adb reboot

How to Fix EFS from Bootloader Mode using Fastboot commands

  1. Setup ADB and Fastboot on your PC.
  2. Enable Developer options & USB debugging on your Android device.
  3. Connect your device to the PC and open a command window on the PC.
  4. Issue the following commands one by one:
    adb reboot bootloader
    fastboot erase modemst1
    fastboot erase modemst2
    fastboot reboot

That’s all. Hope the fixes shared above helps you resolve the issues.

53 comments
  1. I was trying to follow these steps to regain baseband…..but when I do it succeeds in fixing base band but wipes IMEI…..hence still cannot gete network…..if I restore the backup I have it brings back IMEI but restores the non functinoal baseband……any suggestions?

  2. I was trying to follow these steps to regain baseband…..but when I do it succeeds in fixing base band but wipes IMEI…..hence still cannot gete network…..if I restore the backup I have it brings back IMEI but restores the non functinoal baseband……any suggestions?

  3. I was trying to follow these steps to regain baseband…..but when I do it succeeds in fixing base band but wipes IMEI…..hence still cannot gete network…..if I restore the backup I have it brings back IMEI but restores the non functinoal baseband……any suggestions?

  4. I was trying to follow these steps to regain baseband…..but when I do it succeeds in fixing base band but wipes IMEI…..hence still cannot gete network…..if I restore the backup I have it brings back IMEI but restores the non functinoal baseband……any suggestions?

  5. Oh my god!!! You, original poster, is a life saver!!!!! Thanks a million. My IMEI actually got corrupted somehow while I’m restoring a backup from TWRP.

  6. Oh my god!!! You, original poster, is a life saver!!!!! Thanks a million. My IMEI actually got corrupted somehow while I’m restoring a backup from TWRP.

  7. Oh my god!!! You, original poster, is a life saver!!!!! Thanks a million. My IMEI actually got corrupted somehow while I’m restoring a backup from TWRP.

  8. hi, for me it says :
    can’t open ‘/dev/block/bootdevice/by-name/modemst1’: No such file or directory
    (and for modemst2 the same …)

    any idea ?

  9. hi, for me it says :
    can’t open ‘/dev/block/bootdevice/by-name/modemst1’: No such file or directory
    (and for modemst2 the same …)

    any idea ?

  10. I managed to find out the partitions by using a program that backups the EFS partitions and ran the commands accordingly :
    dd if=/dev/zero of=/dev/block/mmcblk0p13
    dd if=/dev/zero of=/dev/block/mmcblk0p14

    but still haven’t succeeded into making the phone work 🙁

    My actual problem :
    I have Galaxy S5 with a CM 13 backup that works ok …
    But since then I have switched to Ressurection Remix and restoring any RR backup brings up the problem with EFS

  11. I managed to find out the partitions by using a program that backups the EFS partitions and ran the commands accordingly :
    dd if=/dev/zero of=/dev/block/mmcblk0p13
    dd if=/dev/zero of=/dev/block/mmcblk0p14

    but still haven’t succeeded into making the phone work 🙁

    My actual problem :
    I have Galaxy S5 with a CM 13 backup that works ok …
    But since then I have switched to Ressurection Remix and restoring any RR backup brings up the problem with EFS

  12. hi, for me it says :
    can’t open ‘/dev/block/bootdevice/by-name/modemst1’: No such file or directory
    (and for modemst2 the same …)

    any idea ?

  13. hi, for me it says :
    can’t open ‘/dev/block/bootdevice/by-name/modemst1’: No such file or directory
    (and for modemst2 the same …)

    any idea ?

  14. I managed to find out the partitions by using a program that backups the EFS partitions and ran the commands accordingly :
    dd if=/dev/zero of=/dev/block/mmcblk0p13
    dd if=/dev/zero of=/dev/block/mmcblk0p14

    but still haven’t succeeded into making the phone work 🙁

    My actual problem :
    I have Galaxy S5 with a CM 13 backup that works ok …
    But since then I have switched to Ressurection Remix and restoring any RR backup brings up the problem with EFS

  15. I managed to find out the partitions by using a program that backups the EFS partitions and ran the commands accordingly :
    dd if=/dev/zero of=/dev/block/mmcblk0p13
    dd if=/dev/zero of=/dev/block/mmcblk0p14

    but still haven’t succeeded into making the phone work 🙁

    My actual problem :
    I have Galaxy S5 with a CM 13 backup that works ok …
    But since then I have switched to Ressurection Remix and restoring any RR backup brings up the problem with EFS

  16. Thanx but i am facing a little challenge when i tried to fix EFS via TWRP RECOVERY..
    After running the first command “dd if=/dev/zero of=/dev/block/bootdevice/by-name/modemst1”
    my samsung s6 is saying
    dd: writing ‘/dev/zero of=/dev/block/bootdevice/by-name/modemst1’ : No space left on device

    1. I have also tried to fix the “not registered on network” issue using EFS backup mobile app but when i tried to do the efs backup its saying “sorry we can not detect any EFS/IMEI partition on your device”

  17. Thanx but i am facing a little challenge when i tried to fix EFS via TWRP RECOVERY..
    After running the first command “dd if=/dev/zero of=/dev/block/bootdevice/by-name/modemst1”
    my samsung s6 is saying
    dd: writing ‘/dev/zero of=/dev/block/bootdevice/by-name/modemst1’ : No space left on device

  18. Thanx but i am facing a little challenge when i tried to fix EFS via TWRP RECOVERY..
    After running the first command “dd if=/dev/zero of=/dev/block/bootdevice/by-name/modemst1”
    my samsung s6 is saying
    dd: writing ‘/dev/zero of=/dev/block/bootdevice/by-name/modemst1’ : No space left on device

      1. I have also tried to fix the “not registered on network” issue using EFS backup mobile app but when i tried to do the efs backup its saying “sorry we can not detect any EFS/IMEI partition on your device”

  19. pleaaaaaaaaseeeeee someone help meeeeeeeeeeee……….if i do the twrp thing it says no space left on device, i did the adb thing and rebooted and still nothing then i did the fastboot thing and it says permission DENIED!?!?!?!????!?

  20. pleaaaaaaaaseeeeee someone help meeeeeeeeeeee……….if i do the twrp thing it says no space left on device, i did the adb thing and rebooted and still nothing then i did the fastboot thing and it says permission DENIED!?!?!?!????!?

  21. pleaaaaaaaaseeeeee someone help meeeeeeeeeeee……….if i do the twrp thing it says no space left on device, i did the adb thing and rebooted and still nothing then i did the fastboot thing and it says permission DENIED!?!?!?!????!?

  22. please help me , i lost modem bands from Europe , now showing only USA Bands LTE 2.4 .7 But i need 1 3 7 20 Doogee Y6

  23. I experienced this trouble on my xperia x compact, now it does not read dim card, and randomly reboots. Tried to erase everything (userdata, boot, cache, recovery, system) with fastboot and reinstall TWRP plus omnirom, but does not work.

  24. I experienced this trouble on my xperia x compact, now it does not read dim card, and randomly reboots. Tried to erase everything (userdata, boot, cache, recovery, system) with fastboot and reinstall TWRP plus omnirom, but does not work.

  25. Fix EFS from TWRP recovery! works! the IMEI number is back, thanks for advice, but some network-pin is needed after reboot

  26. LG V20 H990DS – After installing TRWP lost baseband. Reflashed, tried different ROMS and factory updates. On going for last 6 months.
    After doing the TRWP method above, baseband returned.
    NB: after running command, I also got No space left on device, this is not a problem because all the command does is write ZERO’s to modemst1 & modemst2
    Software version changed from H990ds10b_00_OPEN_TW_DS to H990ds10b-GLOBAL-COM.
    Under phone status – IMEI is ‘0’ – not a problem as I can enter the IMEI from the sticker on back of the cover.
    Now having fully working LG V20, rooted and with XPOSED installed.

    Phone is based in New Zealand, was running default OPEN_TW_DS firmware before I rooted.

    Thank You. Thank You. Thank You

  27. Fix EFS from TWRP recovery! works! the IMEI number is back, thanks for advice, but some network-pin is needed after reboot

  28. I experienced this trouble on my xperia x compact, now it does not read dim card, and randomly reboots. Tried to erase everything (userdata, boot, cache, recovery, system) with fastboot and reinstall TWRP plus omnirom, but does not work.

  29. please help me , i lost modem bands from Europe , now showing only USA Bands LTE 2.4 .7 But i need 1 3 7 20 Doogee Y6

  30. I’m unable to dial out after making the below changes on How to Fix EFS from TWRP recovery

    dd if=/dev/zero of=/dev/block/bootdevice/by-name/modemst1
    dd if=/dev/zero of=/dev/block/bootdevice/by-name/modemst2

    Is there a way to reverse this?

Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post

Samsung October patch released for Galaxy A8, Galaxy J7 Prime and Core Prime

Next Post
lg v20 update

LG V20 Android 9 Pie update and more: Pie rolling out for V20 in Korea

Related Posts