[FIX] Empty IMEI, Unknown Baseband, No SIM, WiFi/Bluetooth unusable, Corrupted EFS

Did this fix work for you?

  • Yes

    Votes: 8 53.3%
  • No

    Votes: 7 46.7%

  • Total voters
    15
Search This thread

kgs1992

Senior Member
May 8, 2012
1,482
1,884
Bangalore
My EFS partition was corrupted after an EFS restore from TWRP (Check post #2 for link to explanation).
I was in panic mode when the super helpful folks over at #twrp sorted me out with this solution (thank you so much @jcadduono). Thought I would share it so it could possibly help someone else.
This has worked on my OnePlus 3, but it might even work on other devices.

Do this AT YOUR OWN RISK. I am not responsible for your device.

  • Boot into TWRP (Poweroff, then power on using Vol Down + Power Button)
  • Go to Advanced > Terminal
  • Type in the following commands:
    • Code:
      dd if=/dev/zero of=/dev/block/bootdevice/by-name/modemst1
    • Code:
      dd if=/dev/zero of=/dev/block/bootdevice/by-name/modemst2
  • Reboot

Alternatively, you could also do this from your computer over adb with the following commands:
Code:
adb shell 'dd if=/dev/zero of=/dev/block/bootdevice/by-name/modemst1'
Code:
adb shell 'dd if=/dev/zero of=/dev/block/bootdevice/by-name/modemst2'

Alternatively, you could try this [Though I haven't tested this myself]:
  • Make sure you have fast boot and drivers (for info look here)
  • Boot into fastboot (Poweroff, then power on using Vol Up + Power Button)
  • Type in the following commands into terminal:
    • Code:
      fastboot erase modemst1
    • Code:
      fastboot erase modemst2
  • Reboot

Good luck and I hope this helps!

PS: It is best to backup your EFS before something like this happens.
Take 5 minutes out of your day to do this. You can find a tool to do this here, or do it yourself by following the instructions here.
 
Last edited:

jcadduono

Recognized Developer
Jan 17, 2014
1,492
6,208
29
Thunder Bay
adduono.com
I'm just going to go ahead and link here for an explanation:
http://forum.xda-developers.com/showpost.php?p=68500121&postcount=64

BTW: Is this issue still present on OnePlus 3 official TWRP? If so we can recompile it, we *should* have all the bugs fixed in android-6.0 latest branch right now. Currently main development is happening on android-7.0 branch of omnirom/android_bootable_recovery (TWRP) but we've backported bug fixes to android-6.0 only and it's probably a good idea for developers to use that as a "stable" branch for now.
 

kgs1992

Senior Member
May 8, 2012
1,482
1,884
Bangalore
I'm just going to go ahead and link here for an explanation:
http://forum.xda-developers.com/showpost.php?p=68500121&postcount=64

BTW: Is this issue still present on OnePlus 3 official TWRP? If so we can recompile it, we *should* have all the bugs fixed in android-6.0 latest branch right now. Currently main development is happening on android-7.0 branch of omnirom/android_bootable_recovery (TWRP) but we've backported bug fixes to android-6.0 only and it's probably a good idea for developers to use that as a "stable" branch for now.

So, I'm not sure what version of TWRP I used to backup, but whatever it was, I only had a single efs backup (efs1.emmc.win). efs2.emmc.win was not present at all. I am guessing during restore, this is what must have caused the problem. I am not sure if TWRP should be checking for sub partitions before restore, but it definitely didn't throw any errors. Only if I had md5 check enabled did it complain that the md5 did not match '' (empty string), which is when I realized what had happened.
 

jcadduono

Recognized Developer
Jan 17, 2014
1,492
6,208
29
Thunder Bay
adduono.com
So, I'm not sure what version of TWRP I used to backup, but whatever it was, I only had a single efs backup (efs1.emmc.win). efs2.emmc.win was not present at all. I am guessing during restore, this is what must have caused the problem. I am not sure if TWRP should be checking for sub partitions before restore, but it definitely didn't throw any errors. Only if I had md5 check enabled did it complain that the md5 did not match '' (empty string), which is when I realized what had happened.
Yeah the adb backup patch went in and broke restore and backup of subpartitions, backup was fixed not much later so you must have had a twrp build from just after the adb backup patch (which broke stuff), it wasn't for a few weeks until the restore issue was noticed, where it restored 1st partition in the backup to all subpartitions of it. Those are all fixed now but there could still be builds out there with any or all of those issues. :(
Reason it wasn't so noticed was not many devices with multiple subpartitions attached to one partition and not many people backing up and restoring efs. (which is often subpartitioned in twrp)
 
N

northropgrummanrq180

Guest
This worked successfully on my Mi 5. So basically I restored a backup with TWRP 3.0.2-2 and it messed up my modem, lost IMEI etc.
I followed the steps in TWRP itself > Terminal and typed the codes. Rebooted and worked.

Thank you so much for putting up the guide. I though I'd be buying an iPhone 7+ or LGV20 but because this fixed my phone, you saved me a lot of money.
 

jl2222

Senior Member
Dec 29, 2010
327
61
Denver Colorado
Thank you for sharing this and everyone at TWRP!!!!!!! I thought my phone was deader than a door nail!!! Method 1 worked for me perfect. Has this bug been fixed yet in the latest official version of TWRP??
 

ener2k

Member
Apr 24, 2013
46
2
I've fixed my MI5, which didn't have a baseband anymore after I've accidentally restored the efs in TWRP, using this tutorial. Thanks so much!
 

Frank Ivan

Senior Member
Dec 11, 2016
71
15
My EFS partition was corrupted after an EFS restore from TWRP (Check post #2 for link to explanation).
I was in panic mode when the super helpful folks over at #twrp sorted me out with this solution (thank you so much @jcadduono). Thought I would share it so it could possibly help someone else.
This has worked on my OnePlus 3, but it might even work on other devices.

Do this AT YOUR OWN RISK. I am not responsible for your device.

  • Boot into TWRP (Poweroff, then power on using Vol Down + Power Button)
  • Go to Advanced > Terminal
  • Type in the following commands:
    • Code:
      dd if=/dev/zero of=/dev/block/bootdevice/by-name/modemst1
    • Code:
      dd if=/dev/zero of=/dev/block/bootdevice/by-name/modemst2
  • Reboot

Alternatively, you could also do this from your computer over adb with the following commands:
Code:
adb shell 'dd if=/dev/zero of=/dev/block/bootdevice/by-name/modemst1'
Code:
adb shell 'dd if=/dev/zero of=/dev/block/bootdevice/by-name/modemst2'

Alternatively, you could try this [Though I haven't tested this myself]:
  • Make sure you have fast boot and drivers (for info look here)
  • Boot into fastboot (Poweroff, then power on using Vol Up + Power Button)
  • Type in the following commands into terminal:
    • Code:
      fastboot erase modemst1
    • Code:
      fastboot erase modemst2
  • Reboot

Good luck and I hope this helps!

PS: It is best to backup your EFS before something like this happens.
Take 5 minutes out of your day to do this. You can find a tool to do this here, or do it yourself by following the instructions here.
"by-name" here means?
 

Tommysonic5

Member
Jun 25, 2013
10
0
I didn't have wi-fi unusable or anything on my OP3, but I was only getting signal for emergency calls before trying a series of things including this. This happened after flashing open beta 9 from an earlier community build. First let me just say in my case in TWRP I wiped then changed /data partition to f2fs and clean flashed the beta as usual along with superSU. Then started my phone and realized I was only able to make emergency calls.

So I tried playing in Settings > Sim & Network > SIM 1 & tried resetting network operators & finding automatically. That may have helped.. but I didn't see any improvement so I removed my sim, reinserted & restarted. It didn't seem to be fixed by then so I tried the 3 methods OP posted. Only#1 worked in my case, but data appears to be working normally now. Whether it was the last thing I tried or some combination, IDK.
Just wanted to write all this out in case anyone is still having issues after following OP's instructions.

Thanks!
 

kenboyles72

Senior Member
Dec 29, 2010
404
402
Used the dd commands in both adb shell and twrp terminal and get "dd: /dev/block/bootdevice/by-name/modemst1: No space left on device". Also tried the fastboo0t commands and got "FAILED (remote: Partition flashing is not allowed)" Any ideas?
 

masterlo3

Senior Member
May 3, 2014
626
184
Worked like a charm

Thank you so much! you just saved my new Mi5 prime which i messed up by trying to unlock more LTE bands. :D
 

morizhtc

Member
Mar 22, 2017
13
0
Used the dd commands in both adb shell and twrp terminal and get "dd: /dev/block/bootdevice/by-name/modemst1: No space left on device". Also tried the fastboo0t commands and got "FAILED (remote: Partition flashing is not allowed)" Any ideas?

am also having the same issue with my htc one e8, am getting remote: partition is not allowed. Please anyone with a solution about this should share
 

rahulkulhalli

Member
Jul 4, 2014
21
1
Great explanation! My phone was stuck in a soft-brick mode yesterday. Followed the mega unbrick guide and got it working again, albeit being reverted to OOS 3.1.2. The cellular network is fine (I can make and receive calls, and mobile data is working), although WiFi and Bluetooth don't work. I tried rebooting into fastboot and erasing the two
Code:
modemst
files but to no avail.

Any reason as to why this is happening?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 10
    My EFS partition was corrupted after an EFS restore from TWRP (Check post #2 for link to explanation).
    I was in panic mode when the super helpful folks over at #twrp sorted me out with this solution (thank you so much @jcadduono). Thought I would share it so it could possibly help someone else.
    This has worked on my OnePlus 3, but it might even work on other devices.

    Do this AT YOUR OWN RISK. I am not responsible for your device.

    • Boot into TWRP (Poweroff, then power on using Vol Down + Power Button)
    • Go to Advanced > Terminal
    • Type in the following commands:
      • Code:
        dd if=/dev/zero of=/dev/block/bootdevice/by-name/modemst1
      • Code:
        dd if=/dev/zero of=/dev/block/bootdevice/by-name/modemst2
    • Reboot

    Alternatively, you could also do this from your computer over adb with the following commands:
    Code:
    adb shell 'dd if=/dev/zero of=/dev/block/bootdevice/by-name/modemst1'
    Code:
    adb shell 'dd if=/dev/zero of=/dev/block/bootdevice/by-name/modemst2'

    Alternatively, you could try this [Though I haven't tested this myself]:
    • Make sure you have fast boot and drivers (for info look here)
    • Boot into fastboot (Poweroff, then power on using Vol Up + Power Button)
    • Type in the following commands into terminal:
      • Code:
        fastboot erase modemst1
      • Code:
        fastboot erase modemst2
    • Reboot

    Good luck and I hope this helps!

    PS: It is best to backup your EFS before something like this happens.
    Take 5 minutes out of your day to do this. You can find a tool to do this here, or do it yourself by following the instructions here.
    3
    I'm just going to go ahead and link here for an explanation:
    http://forum.xda-developers.com/showpost.php?p=68500121&postcount=64

    BTW: Is this issue still present on OnePlus 3 official TWRP? If so we can recompile it, we *should* have all the bugs fixed in android-6.0 latest branch right now. Currently main development is happening on android-7.0 branch of omnirom/android_bootable_recovery (TWRP) but we've backported bug fixes to android-6.0 only and it's probably a good idea for developers to use that as a "stable" branch for now.
    1
    3rd way worked for me. thx
    1
    Thx for the explanation!
    Nice thread btw, i believe this will save many hard ass out there, kek

    Sent from my A0001 using Tapatalk
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone