FORUMS

[GUIDE] EFS Partitions: What They Are And How To Get It Back If Lost

419 posts
Thanks Meter: 150
 
By PlayingPoise, Senior Member on 4th February 2016, 03:04 AM
Post Reply Email Thread
Hello. My name is Poise, and I'm a victim of EFS Corruption.

I know, laugh it up.

Anyways, you're either here because you don't know what the EFS is and you wanna know, you ruined your EFS and you're looking for redemption, or you just wanna see me ramble. Whichever the case, I figured I'd write this so nobody else has to deal with the looming fear of your 300 dollar phone with infamously-bad customer support becoming a worthless, barely functioning phone, if not a big 300 dollar brick.
Before I go on, I wanna mention that this guide applies for most if not all phones, not necessarily just the OPO. So if anyone is losing their mind over a corrupted or lost EFS partition, this should get them on the right track to at least understanding the problem.

BACKGROUND: AKA "WHAT IS THE EFS AND WHY DO I EVEN CARE"

EFS stands for Encrypted File System. Imagine the EFS as a big folder containing all of the important stuff that makes the "phone" part of your phone (i.e. what lets you communicate from one person with a phone to another) tick. It contains your IMEI, lots of files revolving around your SIM card and Wifi/Bluetooth (this includes your MAC address for all the radios of your phone), and lots of other things that should never ever under any circumstance be deleted or touched. It's sensitive, it's devastatingly important, and it's a huge pain. If you lose your EFS folder, you lose pretty much any chance of your phone being able to use data, Wifi, Bluetooth, and (in my case) your phone will just not wanna respond and reboot quite a lot.

CHAPTER 1: AKA "THAT SOUNDS LIKE GARBAGE HOW CAN I FIX THIS"

So, like all nice and important things that we have on Android, we can back this folder up, assuming you're rooted and with a custom recovery (though quite frankly if you're not rooted/installing ROMs I have zero idea how you'd corrupt your EFS). I'd recommend doing it through a nandroid backup (TWRP usually has the option to backup EFS, if not there's an unofficial version for bacon that can), but there are other apps that do the job quite nicely. Backing up your EFS is just as essential as backing up your previous ROM; in fact, backing up your EFS is MILES MORE ESSENTIAL because you can just flash a ROM over a corrupted system to get it working. There is no "flashable EFS"; if it were that easy, it wouldn't be so sensitive, and I wouldn't be writing this guide.

CHAPTER 2: AKA "I'M SUPER CAREFUL BRO I'LL NEVER MESS UP MY EFS PARTITION, WHY BOTHER"

Do it anyways.

I installed a ROM, realized my gapps package was screwed up, restored a CM13 backup, and realized my SIM card wasn't being detected. My phone would lag like hell, and after a while it'd just crash and reboot. I had no IMEI, I had no SIM card detection. I knew exactly what it meant. It wasn't fun to restore it.

If ROM installations were perfect, we wouldn't really have to backup anything. But, sometimes a hiccup will occur, something will touch something else that it shouldn't, and chaos ensues. So, if you don't wanna take 4 hours out of your day to hope to Christ that you didn't royally ruin your phone and the restoring method worked, just back it up. It's like, 3MB and it'll save so much frustration. Honestly.

CHAPTER 3: AKA "YEAH ABOUT THAT MY EFS IS ALREADY CORRUPTED, PLS HELP"

Congrats, you did it! Don't feel too bad, it happens to the best of us.

Fixing an EFS on the Oneplus One is pretty easy, but really time consuming and riveting because it might not 100% of the time work. You'll need the following:
  1. Some sort of ADB/fastboot program. I use Minimal ADB and Fastboot, which rarely has any problems, but you can use whatever as long as it'll talk to your device.
  2. Your near-dead Oneplus One.
  3. A few hours of your time.
  4. Some sort of backup of your data, you'll be factory resetting.
  5. OxygenOS. Preferrably, a package that can be flashed in TWRP. I won't find that for you.
  6. An unlocked bootloader. I cannot stress how important this is. If you don't know what this is, do some research before trying to fix your ruined EFS. Again, how you'd have even ruined it with a locked bootloader is beyond me...
  7. TWRP 2.8.6.0. Yes, it has to be this version; this is the only one that can install firmware correctly. The unofficial modified 2.8.7.0 might be able to, but I'm not about to try it.
  8. Competence and good reading skills. Do everything exactly as I wrote it.
  9. Some knowledge on how flashing a ROM works.
  10. A modified persist.img file that we'll be flashing. You can find it in this thread. Download the Never Settle package and take out the persist.img file; we don't care about the rest. Whether this is mandatory or not, I don't know, but I used it and it worked fine so I'll include it. If anyone tries this without the persist file and it works, let me know. Thanks a ton to markbensze for making this, he saved my skin.

Now for how it's done:
  1. To start, we gotta put your phone into fastboot mode. Do this by holding the power button and the up volume button as you're turning your phone on. You'll know it worked when the phone very dimly says "Fastboot Mode".
  2. Plug your phone into your computer. Let it do any driver stuff it has to, then open your ADB/Fastboot program. Type "fastboot devices", if you see a bunch of letters/numbers with the word "fastboot" a few spaces away, you're set.
  3. Seriously, if your bootloader isn't unlocked, you gotta do that. This will wipe EVERTHING from your phone, including any backups. I won't cover that mess, there's trillions of guides for that.
  4. Type the following commands:
    • Code:
      fastboot erase modemst1
      fastboot erase modemst2
      fastboot erase persist
  5. This erases a bunch of partitions that have to do with the EFS. They all regenerate themselves, but as an added precaution we're gonna flash that persist.img you got from the thread in the "what you need" list. In order to do this, enter the following command:
    • Code:
      fastboot flash persist [location to your persist.img on your computer]
  6. If all goes well, you'll get a handy success message and you can get out of fastboot mode by holding down the power button until it turns off.
  7. Now, reboot to recovery; do this by holding the power button and holding the down volume button as you turn your phone on, until you see the TWRP splash screen.
  8. How you do this next step is up to you; you can use the built-in MTP to transfer the Oxygen OS file over from your computer to your phone, or you can use ADB sideload. If you don't know how sideload works, just transfer it over.
  9. Factory reset as you would installing a normal ROM, and flash Oxygen OS through the install menu/sideload/however you wanna. Let it fully install.
  10. Reboot. Let it boot, pray to the EFS gods that they'll give you their blessing, and check if your SIM card gets detected.

If it did, congradulations! Your EFS is working. Now, go make a backup while you can.
The Following 14 Users Say Thank You to PlayingPoise For This Useful Post: [ View ] Gift PlayingPoise Ad-Free
7th January 2017, 09:59 PM |#2  
Gawd's Avatar
Senior Member
Thanks Meter: 1,832
 
Donate to Me
More
Very glad that you made a guide about it. I didn't f*** up my phone though, but I truly got the importance of backing up the EFS. Also, got to know about it a bit more.

Thanks!
9th January 2017, 04:33 AM |#3  
FL4NKENSTEIN's Avatar
Member
Flag Ruston, La
Thanks Meter: 20
 
Donate to Me
More
I have a feeling this is going to come in handy with my project OPO... good stuff man thanks
10th January 2017, 02:35 PM |#4  
FL4NKENSTEIN's Avatar
Member
Flag Ruston, La
Thanks Meter: 20
 
Donate to Me
More
It worked. After I did this I kept getting boot Loops what was progress on this phone. I did the factory reset in recovery. Let it bootloop some more. Went back to recovery and fixed selinux permissions. Boot Loops again, went back to recovery wipe the dalvik. now it freaking works.
20th February 2017, 06:23 AM |#5  
Member
Thanks Meter: 2
 
More
First off, great guide.

But after following this, despite having my IMEI shown previously, my baseband and my imei are now gone. I was told to use this guide to try and fix my data connection problems as it seemed something was wrong with my EFS partition, but it seems following this has left me worse off.

Any suggestions to what else I could do?
20th February 2017, 07:24 PM |#6  
Member
Thanks Meter: 2
 
More
Is there a stock oxygen OS file kicking around somewhere? I tried searching for them, but most are modified by other people. One of them hardbricked my phone (the ported Oneplus X oxygen os), so I'd rather not further experiment with other modified ones. I used another OxygenOs file, but despite booting, it didn't fix the baseband or IMEI problem.

I tried doing this but using stock CM13.1.2 instead of OxygenOS, but it didn't fix the problem either. So any other suggestions?

Edit: Nvm, found the official from the OnePlus website, I'm an idiot, going to try doing this with Oxygen to see what happens.
25th July 2018, 03:52 AM |#7  
FAILED (remote: Partition flashing is not allowed)
OnePlus 3t with TWRP BlueSpark 3.2.1 recovery.

I am open to flash Roms with TWRP with no problem but I am not able to flash persist.zip (TWRP version) it says it flash but folder doesn't appear and your instructions via fast boot I get the following error.

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash persist c:\android\persist.zip
target reported max download size of 435159040 bytes
sending 'persist' (344 KB)...
OKAY [ 0.036s]
writing 'persist'...
FAILED (remote: Partition flashing is not allowed) <------ Problem here or or is my partition on my phone messed up?
finished. total time: 0.057s

I any suggestions for fixing my WiFi/Bluetooth problem?
25th July 2018, 09:11 PM |#8  
Fastboot commands not working, ADB way of doing it?
Quote:
Originally Posted by PlayingPoise

Hello. My name is Poise, and I'm a victim of EFS Corruption.

I know, laugh it up.

Anyways, you're either here because you don't know what the EFS is and you wanna know, you ruined your EFS and you're looking for redemption, or you just wanna see me ramble. Whichever the case, I figured I'd write this so nobody else has to deal with the looming fear of your 300 dollar phone with infamously-bad customer support becoming a worthless, barely functioning phone, if not a big 300 dollar brick.
Before I go on, I wanna mention that this guide applies for most if not all phones, not necessarily just the OPO. So if anyone is losing their mind over a corrupted or lost EFS partition, this should get them on the right track to at least understanding the problem.

BACKGROUND: AKA "WHAT IS THE EFS AND WHY DO I EVEN CARE"

EFS stands for Encrypted File System. Imagine the EFS as a big folder containing all of the important stuff that makes the "phone" part of your phone (i.e. what lets you communicate from one person with a phone to another) tick. It contains your IMEI, lots of files revolving around your SIM card and Wifi/Bluetooth (this includes your MAC address for all the radios of your phone), and lots of other things that should never ever under any circumstance be deleted or touched. It's sensitive, it's devastatingly important, and it's a huge pain. If you lose your EFS folder, you lose pretty much any chance of your phone being able to use data, Wifi, Bluetooth, and (in my case) your phone will just not wanna respond and reboot quite a lot.

CHAPTER 1: AKA "THAT SOUNDS LIKE GARBAGE HOW CAN I FIX THIS"

So, like all nice and important things that we have on Android, we can back this folder up, assuming you're rooted and with a custom recovery (though quite frankly if you're not rooted/installing ROMs I have zero idea how you'd corrupt your EFS). I'd recommend doing it through a nandroid backup (TWRP usually has the option to backup EFS, if not there's an unofficial version for bacon that can), but there are other apps that do the job quite nicely. Backing up your EFS is just as essential as backing up your previous ROM; in fact, backing up your EFS is MILES MORE ESSENTIAL because you can just flash a ROM over a corrupted system to get it working. There is no "flashable EFS"; if it were that easy, it wouldn't be so sensitive, and I wouldn't be writing this guide.

CHAPTER 2: AKA "I'M SUPER CAREFUL BRO I'LL NEVER MESS UP MY EFS PARTITION, WHY BOTHER"

Do it anyways.

I installed a ROM, realized my gapps package was screwed up, restored a CM13 backup, and realized my SIM card wasn't being detected. My phone would lag like hell, and after a while it'd just crash and reboot. I had no IMEI, I had no SIM card detection. I knew exactly what it meant. It wasn't fun to restore it.

If ROM installations were perfect, we wouldn't really have to backup anything. But, sometimes a hiccup will occur, something will touch something else that it shouldn't, and chaos ensues. So, if you don't wanna take 4 hours out of your day to hope to Christ that you didn't royally ruin your phone and the restoring method worked, just back it up. It's like, 3MB and it'll save so much frustration. Honestly.

CHAPTER 3: AKA "YEAH ABOUT THAT MY EFS IS ALREADY CORRUPTED, PLS HELP"

Congrats, you did it! Don't feel too bad, it happens to the best of us.

Fixing an EFS on the Oneplus One is pretty easy, but really time consuming and riveting because it might not 100% of the time work. You'll need the following:

  1. Some sort of ADB/fastboot program. I use Minimal ADB and Fastboot, which rarely has any problems, but you can use whatever as long as it'll talk to your device.
  2. Your near-dead Oneplus One.
  3. A few hours of your time.
  4. Some sort of backup of your data, you'll be factory resetting.
  5. OxygenOS. Preferrably, a package that can be flashed in TWRP. I won't find that for you.
  6. An unlocked bootloader. I cannot stress how important this is. If you don't know what this is, do some research before trying to fix your ruined EFS. Again, how you'd have even ruined it with a locked bootloader is beyond me...
  7. TWRP 2.8.6.0. Yes, it has to be this version; this is the only one that can install firmware correctly. The unofficial modified 2.8.7.0 might be able to, but I'm not about to try it.
  8. Competence and good reading skills. Do everything exactly as I wrote it.
  9. Some knowledge on how flashing a ROM works.
  10. A modified persist.img file that we'll be flashing. You can find it in this thread. Download the Never Settle package and take out the persist.img file; we don't care about the rest. Whether this is mandatory or not, I don't know, but I used it and it worked fine so I'll include it. If anyone tries this without the persist file and it works, let me know. Thanks a ton to markbensze for making this, he saved my skin.

Now for how it's done:
  1. To start, we gotta put your phone into fastboot mode. Do this by holding the power button and the up volume button as you're turning your phone on. You'll know it worked when the phone very dimly says "Fastboot Mode".
  2. Plug your phone into your computer. Let it do any driver stuff it has to, then open your ADB/Fastboot program. Type "fastboot devices", if you see a bunch of letters/numbers with the word "fastboot" a few spaces away, you're set.
  3. Seriously, if your bootloader isn't unlocked, you gotta do that. This will wipe EVERTHING from your phone, including any backups. I won't cover that mess, there's trillions of guides for that.
  4. Type the following commands:
    • Code:
      fastboot erase modemst1
      fastboot erase modemst2
      fastboot erase persist
  5. This erases a bunch of partitions that have to do with the EFS. They all regenerate themselves, but as an added precaution we're gonna flash that persist.img you got from the thread in the "what you need" list. In order to do this, enter the following command:
    • Code:
      fastboot flash persist [location to your persist.img on your computer]
  6. If all goes well, you'll get a handy success message and you can get out of fastboot mode by holding down the power button until it turns off.
  7. Now, reboot to recovery; do this by holding the power button and holding the down volume button as you turn your phone on, until you see the TWRP splash screen.
  8. How you do this next step is up to you; you can use the built-in MTP to transfer the Oxygen OS file over from your computer to your phone, or you can use ADB sideload. If you don't know how sideload works, just transfer it over.
  9. Factory reset as you would installing a normal ROM, and flash Oxygen OS through the install menu/sideload/however you wanna. Let it fully install.
  10. Reboot. Let it boot, pray to the EFS gods that they'll give you their blessing, and check if your SIM card gets detected.

If it did, congradulations! Your EFS is working. Now, go make a backup while you can.

Is there a way to replicate your 3 fastboot commands, using ADB? My bootloader is unlocked and running the latest TWRP recovery 3.2.2

My results via fastboot
"
fastboot erase modemst1
erasing 'modemst1'...
FAILED (remote: Partition flashing is not allowed)
finished. total time: 0.024s
"
23rd June 2019, 09:39 PM |#9  
Member
Flag Istanbul
Thanks Meter: 4
 
Donate to Me
More
I have a Samsung Galaxy Note 2 phone with a broken logic board. I need to replace, but I may need to change the IMEI of the replacement board with my old phone's IMEI if I buy the replacement board from China.
Does the IMEI number pass to the other phone if I restore my Twrp backup which contains all partitions (more specifically the EFS partition), over this motherboard? Does it solve my problem.
13th February 2020, 02:06 PM |#10  
hankbizzo5's Avatar
Senior Member
Flag Ct,Eastern
Thanks Meter: 195
 
Donate to Me
More
Any chance to get an upload of the file needed??
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes