Related
I have now seen a number of cases of the EFS partition getting wiped / corrupted on the SGS II, leaving users with an effectively useless phone.
With this in mind, i've written a little init.d script for my ROM which backs up the EFS partition on boot if a backup does not already exist. A non intrusive safety net for users if you will.
The script just needs a suitable boot image that runs init.d, although it could easily be tacked onto the end of install-recovery.sh if that's not the case.
I'd love to encourage all developers to use this script for users' sake!
You can download the script here - http://cl.ly/2j0p0R3F07052m2T2u0e - but it's very simple, here's the code...
Code:
#!/system/bin/sh
# EFS auto backup script for Samsung Galaxy S II
# By @paulobrien - http://s2.MoDaCo.com
mount /dev/block/mmcblk0p11 /sdcard
if [ ! -f /sdcard/efs.autobackup.img ];
then
dd if=/dev/block/mmcblk0p1 of=/sdcard/efs.autobackup.img
fi
umount /sdcard
Note the manual mount / umount of sdcard is necessary because this happens late in the boot process.
Cheers!
P
Hats of to you Paul.Although I have already made a backup of my EFS folder,such a script would save MANY people from A LOT of trouble.
tolis626 said:
Hats of to you Paul.Although I have already made a backup of my EFS folder,such a script would save MANY people from A LOT of trouble.
Click to expand...
Click to collapse
i havent...never did. i think i wiped about a hundred times now and flashed and reflashed...is it possible to recover the efs folder?
haasgo said:
i havent...never did. i think i wiped about a hundred times now and flashed and reflashed...is it possible to recover the efs folder?
Click to expand...
Click to collapse
If your phone is working, it means your EFS partition is still there...
You can back it up using the many tutorials out there in the forum...
Sent from my GT-I9100 using XDA Premium App
Problem is that the users who read how to backup EFS folder fall in to two category s those that read up first and would have backed up EFS and those that only pick the manual up after something is broke .
This script would be a saver for many of the second group and big thanks to Paul and i hope devs do run with it .
jje
I would like to adapt your script for Nexus S.
Once i got the img file of efs partition, how do can a make a script for restoring thet img file to efs partition?
Or what to do with that img file?
EDIT: @ paul - One more question - how do I mount /sdcard on Nexus S through the script? mount command in the Terminal Emulator shows my /dev/blocks/vold/179:3 as mount point, but if I use that mount point in the script it won't mount the /sdcard. Any idea?
EDIT2: I got it working with this command:
mount /dev/block/platform/s3c-sdhci.0/by-name/media /sdcard
and I got the efs.autobackup.img on my sdcard.
How do I restore the efs.autobackup.img to efs partition?
Thanks Paul this is a very useful utility hope it gets sticky
May i ask what conditions these people are falling foul of getting the EFS wiped? Is it rouge roms/cwm zips, wiping to much in recovery, Odin flashing?
Curious so i may steer clear, have a backup but staying away is half the battle
paulobrien said:
You can download the script here - http://cl.ly/2j0p0R3F07052m2T2u0e - but it's very simple, here's the code...
Code:
#!/system/bin/sh
# EFS auto backup script for Samsung Galaxy S II
# By @paulobrien - http://s2.MoDaCo.com
mount /dev/block/mmcblk0p11 /sdcard
if [ ! -f /sdcard/efs.autobackup.img ];
then
dd if=/dev/block/mmcblk0p1 of=/sdcard/efs.autobackup.img
fi
umount /sdcard
Click to expand...
Click to collapse
Hi Paul, I have modified your script so that it makes a tar file, tar file keeps the permissions for the efs partition and its easier to restore. Here it is:
Code:
#!/system/bin/sh
# EFS auto backup script for Samsung Galaxy S II
# By @paulobrien - http://s2.MoDaCo.com
mount /dev/block/mmcblk0p11 /sdcard
if [ ! -f /sdcard/efs_autobackup/efs-backup.tar.gz ];
then
mkdir /mnt/sdcard/efs_autobackup
busybox tar zcvf /sdcard/efs_autobackup/efs-backup.tar.gz /efs
fi
umount /sdcard
mynamesteve said:
Thanks Paul this is a very useful utility hope it gets sticky
May i ask what conditions these people are falling foul of getting the EFS wiped? Is it rouge roms/cwm zips, wiping to much in recovery, Odin flashing?
Curious so i may steer clear, have a backup but staying away is half the battle
Click to expand...
Click to collapse
Some hit "wipe EFS" in ODIN.
It's possible to mess up a zip badly enough to wipe EFS
A normal wipe shouldn't do it, but a bad CWM build could in theory do it...
A dodgy "virus" could do it, if it were targetting rooted phones, or had a root exploit.
That's why I keep an EFS backup on my PC and off-site
brainmaster said:
Hi Paul, I have modified your script so that it makes a tar file, tar file keeps the permissions for the efs partition and its easier to restore.
Click to expand...
Click to collapse
Nope dd is much better, but safer to have both, but dd should be used with bs=4096k option.
how to restore the efs folder?
how to restore the efs folder?
Please, need to restore EFS, not sure what happened but tried installing Cognition R3 and lost my EFS, I do however have a prior efs.autobackup. Please help.
OK guys, I'm having a annoying problem and need helps.
My tab is P7500 64GB. I had been on AOKP build 38 for quite a long time without any big problem. I tried to flash build 40 recently and my tab was totally messed up. It FC every 30 sec and I decided to return back to HC 3.2 stock.
I went to Team Overcome site and download restock pack, including this "android_fastboot_emmc_full_p4_16G_32G.pit" and flash with stock md5 in Odin. Problem happened here!!! As mentioned on Team Overcome site, just ignore the error appear after Odin finished and continue to the ROM.
1st, after first boot, there is a screen asking for password. I found solution is to go to CWM and wipe data & cache. Everything was ok, except it keep saying "can't mount /efs", and the ROM is crazily sluggish. After that, no matter how I tried different ROMs, from HC to ICS, the ROM is still lag like hell.
Only temporary solution I found is to manually set permission /efs folder to rw-rw-rw after every boot to get the ROM back to it speed.
------------------
OK, in short, I'm deeply f*cked. Just realized that my tab can not realize sim card at all.
Please look at 2nd post and help for backup of /efs.
------------------
Then, f*ck all the sh*t. Just downloaded SGII_Repair from market, fix from it. 2 steps & sh*t gone away. More than happy.
Please close thread
Found this on other device forum
FIXED....
here's how.
as you may see in the post i stopped in the step of trying to format \efs partation.
but instead.
I went to my friend phone and make this command
Code:
dd if=/dev/block/mmcblk0p1 of=/sdcard/ilostit.dd
this backup the mmcblk0p1 which is \efs to a file.
then move it to my phone \sdcard
and did this commands.
Code:
umount /efs "unmount /efs
dd if=/sdcard/ilostit.dd of=/dev/block/mmcblk0p1 "relfash mmcblk0p1 with the backup.
reboot
this reflash mmcblk0p1 block with the backup,
then copy my \efs backup to \efs.
and no more IO error..
and violaa...
my IMIE is back and the Signal is OK.
Click to expand...
Click to collapse
Which means, some one please back up your P7500 /efs folder and upload here so that I can revive mine. Thanks a lot!
I need this too! My efs is also gone
Sent from my GT-P6800 using xda premium
camapghe said:
Found this on other device forum
Which means, some one please back up your P7500 /efs folder and upload here so that I can revive mine. Thanks a lot!
Click to expand...
Click to collapse
This can't be done...unfortunately efs contains the imei, so if someone gives their /efs backup to you, you will end up with the same imei. Imo it is highly unlikely that someone is willing to give you his/her imei.
Check this out:
forum.xda-developers.com/showthread.php?t=1264021
It may help you!
Sent from my amazing 10.1 galaxy tab
Thansk Panos_dm, but I stuck at this step:
5) go to your backed up EFS folder on your sdcard, copy the "imei" folder to the EFS folder at the root of your phone, then again go to the backed up EFS folder at yout sdcard and copy the " .nv_data " file to your EFS folder at the root of your phone using root explorer, NOTE: the dot in first of nv_data is not a mistake, copy the ".nv_data" file.
No .nv_data file at all! Can you share?
I'm sorry but as I stated earlier I can't risk the contents of my /efs folder. Maybe you could flash a stock rom, go to Samsung and claim that it stopped working...maybe they'll buy it!
Sent from my amazing 10.1 galaxy tab
Ok, may be I'm not that screwed as I thought. I used EFS Pro latest version and some how fixed the efs problem. My tab realized sim card, base band appeared and everything seems fine. However, just TEMPORARY.
Every time I reboot, /efs folder screw again until I fix it by EFS Pro. Any permanent solution guys?
I got an EFS.tar backup
I got Odin
I got Heimdall
I got YP-G1 stock.tar.md5
I just don't know how put it all together.
Back on GB roms, I would just wipe everything via CWM, use Odin to flash stock, and then wipe once again.
But this is ICS. Surely it's different, right?
I wrote out instructions in either the LinICS or the Nebula thread (I can't remember it was several weeks ago), also the files are in the Restore to stock thread from Zaclimon. you gonna have some issues in that your efs backup is an efs.tar instead of an efs.rfs
Oh!
I also have a cwm recovery image of stock, if that matters at all
Doesn't seem like a quick restore job either though
theplasmastorm said:
Oh!
I also have a cwm recovery image of stock, if that matters at all
Doesn't seem like a quick restore job either though
Click to expand...
Click to collapse
IT DOESN'T, when you go to LinICS or any of the CM9 ROMs your player is converted from RFS partitions to MTD ones and you HAVE TO use HEIMDALL with a PIT file to reparttion the player back to RFS as you flash the stock ROM.
Totally lost on what to do. I don't know where to begin or anything. I need someone to hold my hand step by step like a baby.
I've read the recovery thread and did some searches around the place, but I don't really understand a thing. I have a US YP-G1
Alright after some fiddling around I got back to stock but the usual blank efs issues are there. I still don't understand how to restore my efs.tar. Could someone help me please?
I also can't mount efs and have no idea what to do with the blankefs.img in the recovery thread
Okay after some more fiddling around I was able to restore my EFS. The efs bugs are still there though so I'm suspecting that the automatic backup that CM9 did is utterly useless and I lost my efs forever. Well I guess I'm going back to linaro <_<
theplasmastorm said:
Okay after some more fiddling around I was able to restore my EFS. The efs bugs are still there though so I'm suspecting that the automatic backup that CM9 did is utterly useless and I lost my efs forever. Well I guess I'm going back to linaro <_<
Click to expand...
Click to collapse
Did you have content on your efs.tar?
Yes my efs.tar has stuff in it
What I did was...
wipe data
restore stock via heimdall. add in blankefs.img in the efs spot.
flashed terra via odin
went to cwm recovery. got on adb shell
cd /efs
ls -l. nothing was in it except what blankefs did
tar -x -f /sdcard/efs.tar
ls -l. tar successfully extracted
got off adb shell and restarted the player
the efs issues still presist
so then i got on adb shell again and checked the efs folder and everything was still there
So I don't know
theplasmastorm said:
Yes my efs.tar has stuff in it
What I did was...
wipe data
restore stock via heimdall. add in blankefs.img in the efs spot.
flashed terra via odin
went to cwm recovery. got on adb shell
cd /efs
ls -l. nothing was in it except what blankefs did
tar -x -f /sdcard/efs.tar
ls -l. tar successfully extracted
got off adb shell and restarted the player
the efs issues still presist
so then i got on adb shell again and checked the efs folder and everything was still there
So I don't know
Click to expand...
Click to collapse
one thing that works, atleast the method I used to solve it, once you've copied the contents back into the EFS folder on the player, then flash the Dream Ultra ROM from CWM, then after booting the ROM up shutdown and wipe data/factory reset, then use Odin to flash the stock GB.tar through odin.
Roms at these links.
http://forum.xda-developers.com/showthread.php?t=1719685&highlight=dream+ultra
http://forum.xda-developers.com/showthread.php?t=1512331&highlight=stock+rooted+4+0
Oh snap that worked. Aroma installer to the rescue.
theplasmastorm said:
Oh snap that worked. Aroma installer to the rescue.
Click to expand...
Click to collapse
Now make a a proper EFS.rfs backup using the method described here http://forum.xda-developers.com/showthread.php?t=1632376&highlight=efs+backup that way next time you need to revert back from an ICS ROM you can flash the efs.rfs to the efs section instead of the blankefs.img and not have to go through this again.
FYI the method listed can be done on the player using terminal emulator just go into it and type su to gain superuser then type the the part for making an efs backup and your done, then copy that file to your PC.
Well when I first flashed linaro there was no mention of efs backup or anything in the topic post and that is why I got in the predicament in the first place.
And then when I watched your vid on how to flash it there was no mention of efs backup either.
Well all that is in the past. I know better now.
I already made a backup as soon as I got back to stock
theplasmastorm said:
Well when I first flashed linaro there was no mention of efs backup or anything in the topic post and that is why I got in the predicament in the first place.
And then when I watched your vid on how to flash it there was no mention of efs backup either.
Well all that is in the past. I know better now.
I already made a backup as soon as I got back to stock
Click to expand...
Click to collapse
Sorry, it was in my older videos that I did, forgot to mention it in that one, guess I'm not the only one to goof up if it's not in the OP either.
theplasmastorm said:
Yes my efs.tar has stuff in it
What I did was...
wipe data
restore stock via heimdall. add in blankefs.img in the efs spot.
flashed terra via odin
went to cwm recovery. got on adb shell
cd /efs
ls -l. nothing was in it except what blankefs did
tar -x -f /sdcard/efs.tar
ls -l. tar successfully extracted
got off adb shell and restarted the player
the efs issues still presist
so then i got on adb shell again and checked the efs folder and everything was still there
So I don't know
Click to expand...
Click to collapse
Whenever I try to do these steps before flashing dream ultra rom it tells me "tar not found" I have a efs.tar on my sd card for certain.
Dear Friends,
Need help please. I have installed another custom rom that was not meant for I9300 and now the EFS is corrupted. I tried installing orignal rom using ODIN but geting boot loop and the phone is not booting. On going into recovery i can see an error efs/ corupted or something like that. I have the backup of my EFS folder in tar.gz format however dont know how to install the same and recover my phone as not able to boot to android.
Please help me if someone can work it out. My phone has just 3 days of warranty left and it does not shows rooted anywhere except the count of installation is about 32 and rom says official and kernel says custom.
Please if someone can help me restore my phone back in working condition i shall always remain thankfull.
Regards,
Mush
mush2004 said:
Dear Friends,
Need help please. I have installed another custom rom that was not meant for I9300 and now the EFS is corrupted. I tried installing orignal rom using ODIN but geting boot loop and the phone is not booting. On going into recovery i can see an error efs/ corupted or something like that. I have the backup of my EFS folder in tar.gz format however dont know how to install the same and recover my phone as not able to boot to android.
Please help me if someone can work it out. My phone has just 3 days of warranty left and it does not shows rooted anywhere except the count of installation is about 32 and rom says official and kernel says custom.
Please if someone can help me restore my phone back in working condition i shall always remain thankfull.
Regards,
Mush
Click to expand...
Click to collapse
It is essential that you have a backup of the EFS partition and a way to place it back - the first two ways that I would think about are:
a) use a good recovery - like Philz recovery, that has commands to restore EFS
b) if the format of the backup is not exactly right you might be able to boot in recovery and use ADB commands.
xclub_101 said:
It is essential that you have a backup of the EFS partition and a way to place it back - the first two ways that I would think about are:
a) use a good recovery - like Philz recovery, that has commands to restore EFS
b) if the format of the backup is not exactly right you might be able to boot in recovery and use ADB commands.
Click to expand...
Click to collapse
Code:
su
umount /efs
dd if=/sdcard/efs.img of=/dev/block/mmcblk0p1 bs=4096
reboot
Ver3go said:
Code:
su
umount /efs
dd if=/sdcard/efs.img of=/dev/block/mmcblk0p1 bs=4096
reboot
Click to expand...
Click to collapse
I am new to adb commands. Will phylz recovery help me enter the commands? if yes then i shall be replying with the sd card efs tar file name. Will then you be able to guide me with the commands based on the tar file?
Thanks all of you in advance.
Mush
mush2004 said:
I am new to adb commands. Will phylz recovery help me enter the commands? if yes then i shall be replying with the sd card efs tar file name. Will then you be able to guide me with the commands based on the tar file?
Thanks all of you in advance.
Mush
Click to expand...
Click to collapse
No for ADB you boot into recovery, connect your computer via USB and run the ADB commands from either Linux Terminal or Windows Command Prompt.
The tool here:
http://forum.xda-developers.com/showthread.php?t=1703488
May help if you're new to adb.
Otherwise it's a case of downloading and installing the drivers for your phone and the Android SDK http://developer.android.com/sdk/index.html
Thanks for all your replies.
Just wanted to confirm if i have the efs backup in sd card as under folder backup_efs and there are two files in tar.gz format will i be able to use the phylz recovery to use this replace my efs folder? if yes then can you guide me the steps please.
Regards,
Mush
mush2004 said:
Thanks for all your replies.
Just wanted to confirm if i have the efs backup in sd card as under folder backup_efs and there are two files in tar.gz format will i be able to use the phylz recovery to use this replace my efs folder? if yes then can you guide me the steps please.
Regards,
Mush
Click to expand...
Click to collapse
I do not remember right now what creates an backup_efs folder but it really does not matter that much - the tar.gz is a "file archive" and .img is usually a partition image. Each could have minor advantages - the .img also contains the entire filesystem of the partition (and will work easier if the filesystem is bonked) but a tar.gz backup is more versatile when you have bad sectors or a changed partition.
Under an advanced recovery like Philz you would just navigate some menus and try to restore the EFS - see the info in those specific threads.
Under ADB you need to have stuff (drivers and some programs) installed in your PC, you connect the phone on USB and you run ADB commands from the command line.
Problem solved!
**********************
I think my problem happened because a flashed a ROM with MG4 baseband, and then flashed UltimaROM with another baseband which caused my baneband to corrupt.
I tried to flash Stock ROM and install different baseband but non of this worked.
finally I flashed BTU stock ROM (Which comes with MG4) but the problem still here.
Then I installed root, deleted the efs folder and replaced all the files with the files in the backup - restart and everything is working! my IMEI returned to normal.
**********************
Original question
Hello devs,
I have Siyah kernel which auto backup my EFS, i have backup named "efs_28Aug2013-1852.tar.gz"
I want to restore from this backup because I lost my IMEI when I flashed UltimaROM
I renamed it to "efsbackup.tar.gz" and put it in the root of the sdcard
then I started adb shell & run the code
Code:
su
umount /efs
mke2fs /dev/block/mmcblk0p1
mount -w -t ext4 /dev/block/mmcblk0p1 /efs
busybox tar zxvf /sdcard/ efsbackup.tar.gz -C /
I granted ADB shell root access
then i went to recovery and run the command (because I can't run umount /efs while device's running it gives resource busy message)
However when I run the first command "su" in gives me this message
Code:
/sbin/sh: su: not found
so I skipped to the next command
but I get the message
Code:
umount: can't umount /efs: Invalid argument
Please guys any help appreciated
Click to expand...
Click to collapse
Unzip it with a file manager and use a root explorer to replace manually
Sent from my GT-I9300 using Tapatalk 4
.
I've backup my efs with adb but how do you have a file on tar format, i've got a file on .img, it's normal ?
There's about nine different ways to backup the efs, .img is fine but a little on the large side at 20mb. A .tar of the same is only 5mb.
rootSU said:
Unzip it with a file manager and use a root explorer to replace manually
Sent from my GT-I9300 using Tapatalk 4
Click to expand...
Click to collapse
Thank you for your reply, I did as you said but this only changed my IMEI from "Unknown" to the generic IMEI "004999..."
Is there something wrong in the method or my backup may be corrupt
Sent from my Nexus 7 using Tapatalk 2
Read the imei / efs thread in general.
Sent from my GT-I9300 using Tapatalk 4
Thank you again, I read the thread in the past but it looks like it has been updated recently.
I think my problem happened because a flashed a ROM with MG4 baseband, and then flashed UltimaROM with another baseband which caused my baneband to corrupt.
I tried to flash Stock ROM and install different baseband but non of this worked.
finally I flashed BTU stock ROM (Which comes with MG4) but the problem still here.
Then I installed root, deleted the efs folder and replaced all the files with the files in the backup - restart and everything is working! my IMEI returned to normal.
Thank you RootSU for your help.
hey bro,
i am stuck
help me out
- my efs(folder) is blank
- i installed stock with pit file but no help!
- right now my cell is in bootloop!
- it goes to recovery, download mode.
i have efs.tar.gz file and a folder named efs in my ext sd
how do i copy that to int memory?
can't even create a cwm flashable zip file of the same?????
help me bro.....
You are posting in a thread that tells you how to restore an efs backup, how much more could you possibly need?
Go to recovery, factory reset.
Get the phone to boot, unpack the .tar file and follow the instructions in the OP.
boomboomer said:
You are posting in a thread that tells you how to restore an efs backup, how much more could you possibly need?
Go to recovery, factory reset.
Get the phone to boot, unpack the .tar file and follow the instructions in the OP.
Click to expand...
Click to collapse
Dear boomboomer,
i am sorry, but my phone is in "bootloop" how am i suppose to delete the "EFS" ? that s what i am asking!!!!!
i have both efs.tar.gz and extracted folder ready in my ext-sd......
i wonder if somebody can help me with creating a cwm.zip from the .tar file
thanks ....
try to install stock again via odin but this time install a diffrent version (for example if you installed INU this time try INS).. before that factory reset your phone and wipe cache via recovery mode.. don't lose your efs backup it's very important copy it to your PC in case something wrong happens
i already did so
almousawi said:
try to install stock again via odin but this time install a diffrent version (for example if you installed INU this time try INS).. before that factory reset your phone and wipe cache via recovery mode.. don't lose your efs backup it's very important copy it to your PC in case something wrong happens
Click to expand...
Click to collapse
bro, thanks for your help recently i tried cm 10 also but nothing happened.
believe me i tried everything now the only option is left that is
to restore efs backup from efs.tar.gz (which is about 12 MB)
OR
create a cwm flashable zip from the efs folder which is about 22 MB)
OR
take my phone to download mode and try to push whole "efs" folder to the location with help of "ADB"
hello
mikks said:
bro, thanks for your help recently i tried cm 10 also but nothing happened.
believe me i tried everything now the only option is left that is
to restore efs backup from efs.tar.gz (which is about 12 MB)
OR
create a cwm flashable zip from the efs folder which is about 22 MB)
OR
take my phone to download mode and try to push whole "efs" folder to the location with help of "ADB"
Click to expand...
Click to collapse
hello nobody is here to help......??????
mikks said:
hello nobody is here to help......??????
Click to expand...
Click to collapse
Correct this is not a paid for service .
Suggest you take it to a service centre .
know that i did that already....
JJEgan said:
Correct this is not a paid for service .
Suggest you take it to a service centre .
Click to expand...
Click to collapse
thanks for the reply, respect to your reply and interest no disrespect ...
i took that to the center but they failed and by the way they come to me in some cases... so they give me free service...
my phone is in boot loop, i have efs.tar.... can i use phills recovery ????? or can i use someone elses backup... just to boot up my device ...then i'll be good .... i just need to get my device booted up.....