[Q] Is it necessary to backup the /efs folder? - AT&T Samsung Galaxy S II SGH-I777

I saw a thread on the international S2 forum regarding the importance of backing up the /efs folder on the phone so you don't lose the phones imei. I was wondering if this is still a necessity on our phone as well? And if so is there a different process to do it than what they used? They used terminal commands to back it up using terminal Emulator or ADB.
This is the thread:
http://forum.xda-developers.com/showthread.php?t=1068193

Its very important..ask me..i lost my IMEI and dint have a back up of the efs folder..had to go to the store and get a new phone under warranty.
Please make a backup of it.

After 2 months, someone just had EFS corruption last week - so yes, now I think it's a good idea to back it up.
IMO it would be a good idea to image the partition too...

Entropy512 said:
IMO it would be a good idea to image the partition too...
Click to expand...
Click to collapse
Can you verify the partition? Is 0p3 the right one, or is it 0p1? I coundn't find a definitive answer by searching.

For some reason I thought it was p3, but I was wrong. It's p1:
Code:
/dev/block/mmcblk0p1 on /efs type ext4 (rw,nosuid,nodev,noatime,barrier=1,journal_checksum,data=ordered)
To back it up, get ADB working, and run the following using ADB while the phone is in CWM recovery and /sdcard is mounted (It often is not when you first enter CWM, mount it in the Mounts and Storage menu if it is not) (If you do this when the phone is running, you may back it up as it is getting written to, which could result in a bogus backup)
Code:
adb shell dd if=/dev/block/mmcblk0p1 of=/sdcard/efs_backup.img

Thanks for the verification entropy!
Sent from my SAMSUNG-SGH-I777 using XDA App

Entropy512 said:
Code:
/dev/block/mmcblk0p1 on /efs type ext4 (rw,nosuid,nodev,noatime,barrier=1,journal_checksum,data=ordered)
Click to expand...
Click to collapse
I don't know much about linux commands. Is this how you verified the partition?
Also, am I correct in assuming that if the partition is backed up, it would not be necessary to back up the efs directory using a file explorer? Or is there a reason to have both?

You can also run the command from entropy in terminal emulator on your phone. Do su first to get root and enter the dd command to do your backup.
Sent from my SGH-I777

creepyncrawly said:
I don't know much about linux commands. Is this how you verified the partition?
Also, am I correct in assuming that if the partition is backed up, it would not be necessary to back up the efs directory using a file explorer? Or is there a reason to have both?
Click to expand...
Click to collapse
I verified it by executing the following command and looking at the output:
Code:
mount
It may be easier to restore a folder backup - not sure. A partition backup is the best way to guarantee you got EVERYTHING in that partition, byte-for-byte.

That's crazy. Cause I don't understand how you learn stuff like that but thanks(aka I'm gonna go do this since I mess with my phone alot.) I followed amk28's troubles. What's the difference between efs backup pro and this mehod? They both backup images
Entropy512 said:
For some reason I thought it was p3, but I was wrong. It's p1:
Code:
/dev/block/mmcblk0p1 on /efs type ext4 (rw,nosuid,nodev,noatime,barrier=1,journal_checksum,data=ordered)
To back it up, get ADB working, and run the following using ADB while the phone is in CWM recovery and /sdcard is mounted (It often is not when you first enter CWM, mount it in the Mounts and Storage menu if it is not) (If you do this when the phone is running, you may back it up as it is getting written to, which could result in a bogus backup)
Code:
adb shell dd if=/dev/block/mmcblk0p1 of=/sdcard/efs_backup.img
Click to expand...
Click to collapse
Sent from my SAMSUNG-SGH-I777 using XDA App

Related

[INFO] Backup the pds partition of your Atrix!

It is a wise idea to backup the /pds partition of your Atrix. It is /dev/block/mmcblk0p3. It holds very important information unique to the phone, like the wifi and bluetooth mac addresses. We still don't fully understand it, but it can resolve issues with the touchscreen not taking input properly. This has happened to a number of people, and now that everyone can have the unlock, I am sure people will do things that will cause the same problem.
Steps:
1. Pick your favorite method: adb, ssh, terminal emulator, etc
2. Become root if not already, REQUIRED
3. dd if=/dev/block/mmcblk0p3 of=/tmp/pds.img
4. Pick your favorite method to get the file off the phone: scp, sd card, etc
The file should be about 2mb. Keep it in a safe place.
edgan said:
It is a wise idea to backup the /pds partition of your Atrix. It is /dev/block/mmcblk0p3. It holds very important information unique to the phone. We still don't fully understand it, but it can resolve issues with the touchscreen not taking input properly. This has happened to a number of people, and now that everyone can have the unlock, I am sure people will do things that will cause the same problem.
Steps:
1. Pick your favorite method: adb, ssh, terminal emulator, etc
2. Become root if not already, REQUIRED
3. dd if=/dev/block/mmcblk0p3 of=/tmp/pds.img
4. Pick your favorite method to get the file off the phone: scp, sd card, etc
The file should be about 2mb. Keep it in a safe place.
Click to expand...
Click to collapse
Everyone can't have the Unlock... Bell is denied for now.
This is sweet though. Thanks for the tip.
Can Root Explorer be used to do this?
no pds is mounted but root exp sees an empty partition, btw would be possible to know which files exactly are in the directory?
me and others messed up this partition using tenfar's recovery, now we have problem with temp throttling, i guess (cpu reaches only 50% of max freq)
Once you go through steps 1 to 3, you can go to /tmp in root explorer and copy pds.img file to sdcard or wherever you want to copy the pds file
Uhhh, is this still possible to back up after unlocking and flashing the 2.3.4 build?
Sent from my MB860 using XDA App
neer2005 said:
Uhhh, is this still possible to back up after unlocking and I flashing the 2.3.4 build?
Sent from my MB860 using XDA App
Click to expand...
Click to collapse
I don't see any reason why you wouldn't be able to.
Screwed up my PDS on my old Atrix. Made sure to immediately back mine up when I got a new one too lol
Backed up the pds file to my ext-sd card using adb shell and got a 2.00mb file. Is this right?
Thanks for the info!
yes
now share it
Thanks I just make a backup image... but how do you restore it?
dd if=/tmp/pds.img of=/dev/block/mmcblk0p3
edgan said:
It is a wise idea to backup the /pds partition of your Atrix. It is /dev/block/mmcblk0p3. It holds very important information unique to the phone. We still don't fully understand it, but it can resolve issues with the touchscreen not taking input properly. This has happened to a number of people, and now that everyone can have the unlock, I am sure people will do things that will cause the same problem.
Steps:
1. Pick your favorite method: adb, ssh, terminal emulator, etc
2. Become root if not already, REQUIRED
3. dd if=/dev/block/mmcblk0p3 of=/tmp/pds.img
4. Pick your favorite method to get the file off the phone: scp, sd card, etc
The file should be about 2mb. Keep it in a safe place.
Click to expand...
Click to collapse
i cant seem to find the file once i created it!
ok, seems simple enough, but stupid question... can someone explain the commands "dd=" and "of=".
I was able to see the file @ dev/block with winscp but how do I convert it to a .img file, etc.
Thanks for your help.
samcripp said:
i cant seem to find the file once i created it!
Click to expand...
Click to collapse
It's in /tmp.
I suggest people use this command:
*MicroSD Installed*
dd if=/dev/block/mmcblk0p3 of=/sdcard-ext/pds.img
*No MicroSD Installed*
dd if=/dev/block/mmcblk0p3 of=/sdcard/pds.img
These commands will create the pds.img file in the root directory of your MicroSD or your Internal SD card respectively.
What is pdf partition?
I believe and if I am wrong I am sure someone will correct me but
dd = I'm not sure
if = input file
of = output file
dd essentially takes a disk and copies it.
Sent from my MB860 using Tapatalk
Not to sound newbish, but I am, I keep getting Cannot Open for Read: Permission Denied
Could someone assist? Thanks.
Realized:
SU is what I needed to type, methinks...will try.
Worked:
Yeah, once I put SU and got that done, it worked out.
_Dennis_ said:
I believe and if I am wrong I am sure someone will correct me but
dd = I'm not sure
if = input file
of = output file
dd essentially takes a disk and copies it.
Sent from my MB860 using Tapatalk
Click to expand...
Click to collapse
From Wikipedia: "dd is a common Unix program whose primary purpose is the low-level copying and conversion of raw data............. dd can also be used to copy regions of raw device files, e.g. backing up the boot sector of a hard disk, or to read fixed amounts of data from special files like /dev/zero or /dev/random.[4]"
So, I am a n00b on using adb (etc..) so I will explain the way I did it using adb.
1. Make sure you have adb.exe installed on your computer and connect the phone to the computer. (I got my adb.exe from the Gladroot script. Here is a link: http://goo.gl/jHiJc)
2. Open a command window
3. Browse to the directory where the adb.exe is and type the following (press enter after each line):
adb shell
su
dd if=/dev/block/mmcblk0p3 of=/sdcard-ext/pds.img
Now, if you DON'T have a SDcard in your phone, take out the "-ext" from that last line.
The file (pds.img) should now be in either the internal sdcard or on your physical sdcard, as nexxusty described.
I hope that helps some as it took me a while to learn this.
Sorry if this is too noob for some, but I started from zero knowledge of this
garekinokami said:
Not to sound newbish, but I am, I keep getting Cannot Open for Read: Permission Denied
Could someone assist? Thanks.
Click to expand...
Click to collapse
Only thing I can think of is if you didn't give ADB superuser permission. You have to physically click allow on the phone after you type "su". Could that be it?
wirednix said:
Only thing I can think of is if you didn't give ADB superuser permission. You have to physically click allow on the phone after you type "su". Could that be it?
Click to expand...
Click to collapse
Lol Yes. 10 Char.
Aye I know what it IS....not what dd MEANS lol. Thank you for the guide.....I completed this in terminal emulator.

18 Aug: EFS auto backup script (for devs)

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.

[Q] nandroid backup via adb (no screen)

long story short, my 3d took a swim. dried it in rice and everything, but the lcd doesn't look like it is going to come back all the way. I tried to boot into the bootloader and I can see a little light at the bottom of the screen and the bootloader screen VERY faintly. I can connect to the phone via adb and send some commands so the phone seems to be at least kindof working, except for the screen.
I've tried to find a way to do this but I am stuck. what is the easiest way to backup everything on my phone through adb (since I have no working screen)? can you do a nandroid backup through adb? I have the latest twrp installed.
jon1234444 said:
long story short, my 3d took a swim. dried it in rice and everything, but the lcd doesn't look like it is going to come back all the way. I tried to boot into the bootloader and I can see a little light at the bottom of the screen and the bootloader screen VERY faintly. I can connect to the phone via adb and send some commands so the phone seems to be at least kindof working, except for the screen.
I've tried to find a way to do this but I am stuck. what is the easiest way to backup everything on my phone through adb (since I have no working screen)? can you do a nandroid backup through adb? I have the latest twrp installed.
Click to expand...
Click to collapse
It is not necessarily a nandroid, but you can 'adb pull' your system and data.
私のEVO 3Dから送信される。
jon1234444 said:
long story short, my 3d took a swim. dried it in rice and everything, but the lcd doesn't look like it is going to come back all the way. I tried to boot into the bootloader and I can see a little light at the bottom of the screen and the bootloader screen VERY faintly. I can connect to the phone via adb and send some commands so the phone seems to be at least kindof working, except for the screen.
I've tried to find a way to do this but I am stuck. what is the easiest way to backup everything on my phone through adb (since I have no working screen)? can you do a nandroid backup through adb? I have the latest twrp installed.
Click to expand...
Click to collapse
i might be missing it, but i'm not seeing any command line arg which can be passed to the actual recovery binary to trigger a nandroid backup
i'm looking is the source file to the latest twrp recovery.c around these lines: https://github.com/TeamWin/TWRP2/blob/master/recovery.c#L912
Code:
switch (arg) {
case 'p': previous_runs = atoi(optarg);
break;
case 's': send_intent = optarg;
break;
case 'u': update_package = optarg;
break;
case 'w': wipe_data = wipe_cache = 1;
break;
case 'c': wipe_cache = 1;
break;
case 'e': encrypted_fs_mode = optarg; toggle_secure_fs = 1; break;
case 't': ui_show_text(1);
break;
case '?': LOGE("Invalid command argument\n");
continue;
}
the good news: almost anything is possible over ADB!
the bad news:
otherwise, i'm not seeing any command line type input point in the backstore.c file to access the nandroid functions.
the older amon ra was using a sh for backup/restore which could be access thru the command line.
looking at the earlier release of twrp, nandroid backup/restore seems to setup similarity w/o command line access. as i recall, has been a while, but cwm is also using similar functionality as twrp in that there isn't command line access, but I could be wrong on cwm?
dastin1015 said:
It is not necessarily a nandroid, but you can 'adb pull' your system and data.
私のEVO 3Dから送信される。
Click to expand...
Click to collapse
this is prob the easiest method to pull all the files out. if you wanted to make it simplier, you could create a tar of the directories onto the sdcard and then adb pull the single .tar file
first, make sure to mount the partitions:
adb shell
mount -o rw /system /system
mount -o rw /data /data
then exit the shell
something such as: adb shell tar -cvf /sdcard/system-backup.tar /system
and: adb shell tar -cvf /sdcard/data-backup.tar /data
for using the straight adb pull method, you'll want to mount the partitions first and then you can execute the adb command.
adb shell
mount -o rw /system /system
mount -o rw /data /data
then exit the shell
adb pull /system c:\android-backup\system
adb pull /data c:\android-backup\data
hope that helps point in the right direction. good luck!
thanks a lot joey, though I managed to find a very similar solution late last night: http://forum.xda-developers.com/showthread.php?t=1021625
though after doing that and opening the tar files with 7-zip it gave me an "unexpected end of archive" error so I was suspicious it didnt get everything.
the real kicker though was finding this:
http://code.google.com/p/androidscreencast/
it actually works and I was able to get in and titanium backup everything.
joeykrim said:
for using the straight adb pull method, you'll want to mount the partitions first and then you can execute the adb command.
adb shell
mount -o rw /system /system
mount -o rw /data /data
then exit the shell
adb pull /system c:\android-backup\system
adb pull /data c:\android-backup\data
hope that helps point in the right direction. good luck!
Click to expand...
Click to collapse
Did this.. Now how to restore? ADB push?
Some kind of format the phone first?
Also can restore to different (replacement, same kind) phone?
Thanks much!
jackfrost909 said:
Did this.. Now how to restore? ADB push?
Some kind of format the phone first?
Also can restore to different (replacement, same kind) phone?
Thanks much!
Click to expand...
Click to collapse
Also, curious how you would restore the files.
Could you just rename the .tar file as system.img and issue the following commands?
fastboot flash system system.img
Would this work?

S3 won't boot after app gone wrong - need opinion plz

Hey. I tried this swapper2 app from the market and this little thing formated some partition from my phone thinking it was the swap one. Now phone won't go pass the samsung logo with sound.
I can get into recovery and into download mode. I tried flashing a brand new pcodin EMB5 flash, with no .pit nor repartition. No go. Rooted with CF-root (which also gives me CWM recovery). Recovery gives me the error: can't mount /efs so i'm guessing my /efs got formated. I have a backup made by copying the /efs files to another folder when all was working. What i'm guessing needs to be done is get my /efs partition created again (or at least mounted, not sure it's state) so i can copy it's contents there again.
What's the best way of doing this? I've seen people saying they can just use adb, mount /efs with the commands:
mke2fs /dev/block/mmcblk0p1
mount -w -t ext4 /dev/block/mmcblk0p1 /efs
and copy it's contents. But i need my phone to boot first to use adb, right? Doesn't seem to be working from recovery or download mode.
Would reflashing with odin using the pit file, repartition option or even the Clear ESF option work? I'm not very clear about what "clear efs" does.
Any other ideas?
Thanks!
EDIT:
I've managed to solve my problem, phone's up and running again. I'll post the entire process later for anyone else, god knows i'd have loved to see this written somewhere instead of all the inconclusive bits and pieces scavenged around the internet.
Update:
On recovery (CWM) /efs is the only partition it can't mount.Log says
"w:failed to mount /dev/block/mmcblk0p3 (invalid argument)
Error mounting /efs"
From what i understand, mmcblk0p3 is the /efs partition. Would restoring an image of mmcblk0p3 work? I have my /efs contents but not an image of it. Would it be possible to get an image from some other phone, restore it on mine and just replace it's contents later?
If so, would anyone be so kind to send me one image of mmcblk0p3 for the gt-i9000?
Thank you.
adb works from recovery.
no, no one will send you their efs folder
Yes, i managed to get adb working with recovery. i figured as much. to be honest, but i though if someone had an image from a broken phone or simply wouldn't mind sharing, it wouldn't hurt to ask since i've seen them around for other phones before. I couldn't care less about other phone's contents, just want to replace them with mine.
I will try to recreate this partition via adb with fdisk or something. Can anyone share the details of the mmcblk0p3, like size, blocks, etc?
Any other ideas are also appreciated.
efs contains fragile data, like the IMEI. Having it, it is relatively easy to unblock the phone locked as the result of stolen one claim.
I doubt if someone would share this content, first. Second, any effort related with IMEI cloning is not welcomed here.
spamtrash said:
efs contains fragile data, like the IMEI. Having it, it is relatively easy to unblock the phone locked as the result of stolen one claim.
I doubt if someone would share this content, first. Second, any effort related with IMEI cloning is not welcomed here.
Click to expand...
Click to collapse
I'm well aware and not trying to clone anything. But I'll change my request then: think it's possible for someone to extract the efs image, mount it elsewhere (in linux or something, should be an ext4, right?) delete it's files, save and send it to me? The partition structure should still be there (which is what i want) but no delicate files for me to use. I can then restore it to my phone, hopefully mount it manually in adb and copy my /efs contents.
Think this would work?
Thank you

[GUIDE] Recover phone from a formated /efs partition

I'm just writting this because i've recently had this problem. I managed to sort it out by my own but didn't really find it written anywhere, just bits and pieces scavenged from so many pages that might point to a solution (granted, part of my problem was also finding what was really my problem since the phone stopped working so fast i didn't really had the time to get what happened)
I was trying out swap for my S3, i had created a swap partition in my external card and then followed a guide here from xda to use an app called swapper2 (from market) to enable swap. I must have done something wrong because what it did was format my /efs partition instead as if it was a swap partition. Phone stopped working on the spot, obviously, and wouldn't past samsung's bootscreen.
Also, keep in mind while this worked for me there might be other ways of doing this which may be simpler. This is just what i figured for a solution.
When this helps:
- you accidentally formated your /efs partition
- you have a backup from your /efs partition, files copied with root explorer but not an image you can just flash back to the partition.
- your phone boots to download and to recovery but not to main system (which every tutorial i found seemed to assume to be able to do, i just figured their /efs was not as screwed as mine was)
- your recovery won't mount the /efs partition because it expects it to be ext4 but it's formated to something else and it showing the message:
"e: failed to mount /efs (Invalid argument)"
What doesn't work:
- any kind of standard solution like reflashing a stock rom with odin, with or without .pit file, clear EFS, whatever. It will flash, just won't solve since, apparently, nothing touches the /efs partition because it's so sensible. Even custom recoveries do mount it and apparently format and replace every single other partition but the /efs, which is why i had to do it manually.
Solution:
- simply format the /efs partition back to ext4 and copy your backup files there
What's needed:
- phone drivers installed on the computer. If you had kies installed, this should be covered already. Think you can't have it running while doing this though. Also, for what's worth, i've done this with windows 8 x64.
- updated android sdk tool, mainly adb. If adb is saying device not connected or not found, you may be using an outdated adb.exe (i was). I used adb.exe that came with this software here:
http://forum.xda-developers.com/showthread.php?t=1308546
- root. If your rom isn't rooted you can always flash CF-root from odin in download mode.
http://forum.xda-developers.com/showthread.php?t=1695238
- busybox, am not really sure if i actually got to need this, think so for the formating tool. Can't hurt to have more options though. This is how to install:
http://www.omappedia.com/wiki/Android_Installing_Busybox_Command_Line_Tools
- custom recovery that allows root through adb, i used Philz which is pretty awesome
http://forum.xda-developers.com/showthread.php?t=2002953
- backup files from your /efs. I had mine unzipped and copied to my externalsd while in windows. They were in an efs folder in the sd card. You can push this through adb to the phone later, but i found this way simpler.
How to:
- get into recovery (vol up+home+power button) and plug your phone to the computer. You'll hear an usb connected sound from windows after a bit.
- in recovery, navigate to Mounts and try the "mount /efs". It'll fail. Now, navigate to advanced and "view log". You'll see below that the phone tried to mount a partition and failed, in my case, it had unsucessfully tried to mount /dev/block/mmcblk0p3 which is the partition /efs uses. Take note of this partition name.
- On windows, open a command line (type cmd on you start menu), navigate to where you have adb.exe and type:
adb shell
If all went well, command prompt has changed. You can now issue commands directly to your phone from terminal.
- type "su" to get root permissions. Your command line should change to something like [email protected] Before i had this working i needed to use "Fix permissions". It's an option in the recovery menus on the phone.
- this step is optional but i did it anyway. I created an image of the partition i was going to mess with. If anything went wrong i could always flash it back even if it was broken. By the way, this is what i should have done in the first place instead of just copying /efs files. Would have made the process so much simpler... also, do this if you ever get the phone back working again. Type:
dd if=/dev/block/mmcblk0p3 of=/externalsd/efs.img
The /externalsd/efs.img is just a place you can save stuff to, like your external sd card. You can check what's your mounting point for the card with the command "mount" and look for something relevant like "externalsd".
Also, you may want to copy that efs.img to somewhere else from your phone (like your computer) for safekeeping. Literally remove card from phone, put in computer and copy files there. Notice you may need to reboot phone to recovery if you remove your card so it detects and mounts your card again. Sure, you can also do that from the command line, but it's just easier to reboot the phone.
- Now, we'll format the partition to something your phone can mount (ext4) and is expecting. Be careful, by doing this, you're actually erasing what's left of your partition and replacing by something clean. Type:
mk2fs /dev/block/mmcblk0p3
If all went well, you should see some kind of small report about what was just done.
- To mount this we'll need a mounting point. Type:
mkdir /efs
this will create an /efs folder in root, if it doesn't exist already, and to mount, type:
mount -t ext4 /dev/block/mmcblk0p3 /efs
- if all went well, you now have access to the /efs folder and can copy you files back:
cp -r /externalsd/efs/* /efs
where externalsd was my external sd card mounted on my phone.
- Check if your /efs folder has it's contents properly
ls /efs
I had to reboot the phone to recovery once more at this point and use the "fix permissions" option again.
After this, my phone booted up normally again.
I'm getting Segmentation fault, I guess there's some kinda hardware error on my phone. Gonna take it to Sammy's tomorrow.
Code:
mke2fs -F /dev/block/mmcblk0p11
Segmentation fault
sh-4.2#
Hi thnx for your Guide. I have the EFS problem, after installin 4 diferent rom in 2 hours my imei and baseband lost.( dont now why) i dont have a backup. I was thinking if it take the EFS from another S3 does it work?
Will this work with a Galaxy S4? I545
Enea307 said:
Hi thnx for your Guide. I have the EFS problem, after installin 4 diferent rom in 2 hours my imei and baseband lost.( dont now why) i dont have a backup. I was thinking if it take the EFS from another S3 does it work?
Click to expand...
Click to collapse
No. Read General > Sticky roll-up thread > "IMEI / EFS - Know this stuff"
is normal this output? (i'm meaning the tar.gz unfinding file)
Code:
*****************************************
* BACKUP EFS *
*****************************************
WARNING: Do you wish to Continue? (This will make EFS BACKUP) [Y,N]?Y
--- STARTING ----
--- WAITING FOR DEVICE
--- Backup efs image ---
761 KB/s (9357 bytes in 0.012s)
7 KB/s (39 bytes in 0.005s)
SM-N9000ZWEXXV_N900XXUCMJ3_RF1DA111EAY_
Creating filesystem with parameters:
Size: 20971520
Block size: 4096
Blocks per group: 32768
Inodes per group: 1280
Inode size: 256
Journal blocks: 1024
Label:
FLEX_BG size: 0
Blocks: 5120
Block groups: 1
Reserved block group size: 0
Created filesystem with 59/1280 inodes and 2432/5120 blocks
40960+0 records in
40960+0 records out
20971520 bytes transferred in 7.271 secs (2884269 bytes/sec)
unknown option -- ZBusyBox v1.19.4-cm9 bionic (2012-02-05 18:40 +0100) multi-cal
l binary.
Usage: tar -[cxtzjahmvO] [-X FILE] [-T FILE] [-f TARFILE] [-C DIR] [FILE]...
Create, extract, or list files from a tar file
Operation:
c Create
x Extract
t List
f Name of TARFILE ('-' for stdin/out)
C Change to DIR before operation
v Verbose
z (De)compress using gzip
j (De)compress using bzip2
a (De)compress using lzma
O Extract to stdout
h Follow symlinks
m Don't restore mtime
exclude File to exclude
X File with names to exclude
T File with names to include
2684 KB/s (9962352 bytes in 3.623s)
2805 KB/s (20971520 bytes in 7.299s)
remote object '/sdcard/SM-N9000ZWEXXV_N900XXUCMJ3_RF1DA111EAY_EFS.tar.gz' does n
ot exist
7-Zip (A) 4.65 Copyright (c) 1999-2009 Igor Pavlov 2009-02-03
Scanning
SM-N9000ZWEXXV_N900XXUCMJ3_RF1DA111EAY_EFS.tar.gz: WARNING: Impossibile trovare
il file specificato. [COLOR=Red](impossible to find the specify file)[/COLOR]
Creating archive SM-N9000ZWEXXV_N900XXUCMJ3_RF1DA111EAY_EFS.zip
Compressing getprop.txt
Compressing SM-N9000ZWEXXV_N900XXUCMJ3_RF1DA111EAY_EFS.raw.img
Compressing SM-N9000ZWEXXV_N900XXUCMJ3_RF1DA111EAY_EFS.tar.md5
WARNINGS for files:
SM-N9000ZWEXXV_N900XXUCMJ3_RF1DA111EAY_EFS.tar.gz : Impossibile trovare il file
specificato.[COLOR=Red] (impossible to find the specify file)[/COLOR]
----------------
WARNING: Cannot find 1 file
-
-
Finished. Output file is SM-N9000ZWEXXV_N900XXUCMJ3_RF1DA111EAY_EFS BACKUP
Premere un tasto per continuare . . .
well in the zip there are only the txt + md5 + .raw.img
Thanks for this great tutorial. It was my final step to recover my efs partition, without any backup. I copied the efs folder from another device and modified the files according my devices info (bluetooth mac, serial etc). Worked great on my SGS4
By the way I had the same error:
Code:
mke2fs /dev/block/mmcblk0p10
Segmentation fault
You get this error if you run adb shell when you booted to your ROM.
You need to run adb shell in recovery mode
Great tutorial but i hope you can help me, I can't seem to properly find the SDcard. When I type cp -r /externalsd/efs/* /efs
it comes back with cp: can't stat '/sdcard/efs*' : No such file or directory
I cleared my whole sdcard card except for efs directory. I also tried sdcard instead of externalsd but same thing.
I am getting stuck trying to fix this as I have a boot loop or corrupt /efs or something. I have tried to get my phone working by installing my ROM ( Omega v58 ) and also by trying to flash the latest stock 4.3 through Odin v3.09. I havent tried total stock 4.0.3 yet. No matter what I have done though I can't get past the boot logo ( or the walking Omega droid ). My phone just sits there and hangs
I have followed your steps and I have Philz ( 6.07.9.19 ) installed ( but not busybox unless it is sat there somehow from the Omega install ) but when i try to get adb shell running nothing happens or works..as you can see
What am i doing wrong? OR is my phone totally borked?
hi..
Blackwatch said:
I am getting stuck trying to fix this as I have a boot loop or corrupt /efs or something. I have tried to get my phone working by installing my ROM ( Omega v58 ) and also by trying to flash the latest stock 4.3 through Odin v3.09. I havent tried total stock 4.0.3 yet. No matter what I have done though I can't get past the boot logo ( or the walking Omega droid ). My phone just sits there and hangs
I have followed your steps and I have Philz ( 6.07.9.19 ) installed ( but not busybox unless it is sat there somehow from the Omega install ) but when i try to get adb shell running nothing happens or works..as you can see
What am i doing wrong? OR is my phone totally borked?
Click to expand...
Click to collapse
I have successfully fix my efs partition follwing this thread.
you are receiving such message in cmd. I faced it too.
Sol: Use Philoz Recovery 5.0.
Fix permissions.
there you are.. done..
Philz 6.0 do not have an option for "fix permission".
hope it helps..
I wrote a script that attempts to recover your nv_data.bin from a corrupted EFS partition for the i9300. Thus if you don't have a backup and your EFS is corrupt, try the script. The script is still in Alpha phase and may not work for other devices. Feedback would be much appreciated.
You can find the script at: https://github.com/chriscz/efs_recover
I dont have /efs backed up
Hi ,
If i dont have /efs backed up , can I copy any other mobile (same model) efs data to my mobile and try?
Thanks and Regards
Vamshi Pulumati
vamshipulumati said:
Hi ,
If i dont have /efs backed up , can I copy any other mobile (same model) efs data to my mobile and try?
Thanks and Regards
Vamshi Pulumati
Click to expand...
Click to collapse
No, it won't work and trying to clone another imei is illegal.
boomboomer said:
No, it won't work and trying to clone another imei is illegal.
Click to expand...
Click to collapse
How to register for a new IMEI ? Is it possible?? Could you please help me with any site or link?? I don't want to replace motherboard..
Any help are highly appreciated.
No, it isn't possible and discussion about changing imei is banned on xda.
Take your phone to a service centre and pay then to recode it for you, make sure it works on 4.3 before you pay.
boomboomer said:
No, it isn't possible and discussion about changing imei is banned on xda.
Take your phone to a service centre and pay then to recode it for you, make sure it works on 4.3 before you pay.
Click to expand...
Click to collapse
Hey I would like to tell you that a miracle happened for my S3. Yesterday i tried to do same as per in this guide. After taking backup of broken efs backup i tried to clear the efs folder with this command "mk2fs /dev/block/mmcblk0p3"
After that i just flashed 4.4.4 based stock ROM and somehow phone booted up perfectly. No network issues. Bluetooth wifi sim card everything works. IMEI & Serial No is there. But when i'm checking network unlock status it is showing as everything locked. But still I can use everything... I'm amazed.!!!!
Do you have any idea how this happened??
@boomboomer
Same problem with a Samsung gt-i9070 - Galaxy S Advance
Hi!
My i9070 has the same problem, but when i run the command: "mke2fs /dev/block/mmcblk0p3" shows the "Segmentation fault" error message.
Some one can help?
Thanks.
Bro U stated to format but How to format /efs partition
/efs not backed up
boomboomer said:
No, it won't work and trying to clone another imei is illegal.
Click to expand...
Click to collapse
I Dont have efs backed up and I also have formatted efs partition from adb shell and using that Dev type commands now i am in factory mode and my network is not working please give me any solution.
kaynpayn said:
I'm just writting this because i've recently had this problem. I managed to sort it out by my own but didn't really find it written anywhere, just bits and pieces scavenged from so many pages that might point to a solution (granted, part of my problem was also finding what was really my problem since the phone stopped working so fast i didn't really had the time to get what happened)
I was trying out swap for my S3, i had created a swap partition in my external card and then followed a guide here from xda to use an app called swapper2 (from market) to enable swap. I must have done something wrong because what it did was format my /efs partition instead as if it was a swap partition. Phone stopped working on the spot, obviously, and wouldn't past samsung's bootscreen.
Also, keep in mind while this worked for me there might be other ways of doing this which may be simpler. This is just what i figured for a solution.
When this helps:
- you accidentally formated your /efs partition
- you have a backup from your /efs partition, files copied with root explorer but not an image you can just flash back to the partition.
- your phone boots to download and to recovery but not to main system (which every tutorial i found seemed to assume to be able to do, i just figured their /efs was not as screwed as mine was)
- your recovery won't mount the /efs partition because it expects it to be ext4 but it's formated to something else and it showing the message:
"e: failed to mount /efs (Invalid argument)"
What doesn't work:
- any kind of standard solution like reflashing a stock rom with odin, with or without .pit file, clear EFS, whatever. It will flash, just won't solve since, apparently, nothing touches the /efs partition because it's so sensible. Even custom recoveries do mount it and apparently format and replace every single other partition but the /efs, which is why i had to do it manually.
Solution:
- simply format the /efs partition back to ext4 and copy your backup files there
What's needed:
- phone drivers installed on the computer. If you had kies installed, this should be covered already. Think you can't have it running while doing this though. Also, for what's worth, i've done this with windows 8 x64.
- updated android sdk tool, mainly adb. If adb is saying device not connected or not found, you may be using an outdated adb.exe (i was). I used adb.exe that came with this software here:
http://forum.xda-developers.com/showthread.php?t=1308546
- root. If your rom isn't rooted you can always flash CF-root from odin in download mode.
http://forum.xda-developers.com/showthread.php?t=1695238
- busybox, am not really sure if i actually got to need this, think so for the formating tool. Can't hurt to have more options though. This is how to install:
http://www.omappedia.com/wiki/Android_Installing_Busybox_Command_Line_Tools
- custom recovery that allows root through adb, i used Philz which is pretty awesome
http://forum.xda-developers.com/showthread.php?t=2002953
- backup files from your /efs. I had mine unzipped and copied to my externalsd while in windows. They were in an efs folder in the sd card. You can push this through adb to the phone later, but i found this way simpler.
How to:
- get into recovery (vol up+home+power button) and plug your phone to the computer. You'll hear an usb connected sound from windows after a bit.
- in recovery, navigate to Mounts and try the "mount /efs". It'll fail. Now, navigate to advanced and "view log". You'll see below that the phone tried to mount a partition and failed, in my case, it had unsucessfully tried to mount /dev/block/mmcblk0p3 which is the partition /efs uses. Take note of this partition name.
- On windows, open a command line (type cmd on you start menu), navigate to where you have adb.exe and type:
adb shell
If all went well, command prompt has changed. You can now issue commands directly to your phone from terminal.
- type "su" to get root permissions. Your command line should change to something like [email protected] Before i had this working i needed to use "Fix permissions". It's an option in the recovery menus on the phone.
- this step is optional but i did it anyway. I created an image of the partition i was going to mess with. If anything went wrong i could always flash it back even if it was broken. By the way, this is what i should have done in the first place instead of just copying /efs files. Would have made the process so much simpler... also, do this if you ever get the phone back working again. Type:
dd if=/dev/block/mmcblk0p3 of=/externalsd/efs.img
The /externalsd/efs.img is just a place you can save stuff to, like your external sd card. You can check what's your mounting point for the card with the command "mount" and look for something relevant like "externalsd".
Also, you may want to copy that efs.img to somewhere else from your phone (like your computer) for safekeeping. Literally remove card from phone, put in computer and copy files there. Notice you may need to reboot phone to recovery if you remove your card so it detects and mounts your card again. Sure, you can also do that from the command line, but it's just easier to reboot the phone.
- Now, we'll format the partition to something your phone can mount (ext4) and is expecting. Be careful, by doing this, you're actually erasing what's left of your partition and replacing by something clean. Type:
mk2fs /dev/block/mmcblk0p3
If all went well, you should see some kind of small report about what was just done.
- To mount this we'll need a mounting point. Type:
mkdir /efs
this will create an /efs folder in root, if it doesn't exist already, and to mount, type:
mount -t ext4 /dev/block/mmcblk0p3 /efs
- if all went well, you now have access to the /efs folder and can copy you files back:
cp -r /externalsd/efs/* /efs
where externalsd was my external sd card mounted on my phone.
- Check if your /efs folder has it's contents properly
ls /efs
I had to reboot the phone to recovery once more at this point and use the "fix permissions" option again.
After this, my phone booted up normally again.
Click to expand...
Click to collapse
I have restored my s6 edge by following this method. The EFS partition name is "sda3" for s6 edge if anyone want to restore s6 edge. There is typo in command "mk2fs /dev/block/mmcblk0p3" it should be mke2fs i think.
After restoring EFS my phone recovered from boot loop. But the imei is still invalid. Do you know any method to repair imei for s6 edge?. Thank You
---------- Post added at 02:18 PM ---------- Previous post was at 02:14 PM ----------
Blackwatch said:
I am getting stuck trying to fix this as I have a boot loop or corrupt /efs or something. I have tried to get my phone working by installing my ROM ( Omega v58 ) and also by trying to flash the latest stock 4.3 through Odin v3.09. I havent tried total stock 4.0.3 yet. No matter what I have done though I can't get past the boot logo ( or the walking Omega droid ). My phone just sits there and hangs
I have followed your steps and I have Philz ( 6.07.9.19 ) installed ( but not busybox unless it is sat there somehow from the Omega install ) but when i try to get adb shell running nothing happens or works..as you can see
What am i doing wrong? OR is my phone totally borked?
Click to expand...
Click to collapse
You don't have to run "su" command. "#" shows you already have root access.

Categories

Resources