I just wanted to share a story of woe and redemption so that it doesn't happen to you.
As background, I had sim unlocked my phone using helroz's method a while back, and my phone has been working fine from team whiskey's early days till now. Recently, I was flashing my phone as most of us do. I noted that after flashing the dead horse kernel, my market was not working properly, so I decided to odin back to JFD. From there, I flashed Bionix, but afterward, noted that I wasn't getting any cell reception. After some investigation and several odins, I looked at my software info and found that my baseband was unknown. I flashed back to JFD however, and it worked fine. In fact, this was the only rom where the cell worked. The phone otherwise was functioning flawlessly, including wifi.
Further investigation showed that this has happened to others, and anecdotally, people have fixed it by odining over and over or doing some magic with their sim card. I did just that but to no avail. After some thinking, it occurred to me that maybe my /efs data was bad, so I took a look. Hitting *#06# showed the generic samsung IMEI while in JFD (it did not work in other versions as the baseband was not working), not my normal IMEI. That's odd. I still had the backup from trying to sim unlock it months ago. I tried to overwrite the /efs folder w/ my own, but I could not write it due to 'not enough space.'
Further investigation showed that indeed, my efs partition had been borked, and so I could not write data to it (I could copy however). The only way to fix this is by flashing/odin'ing a new partition. This only works if you have a backup, which I didn't. Basically, I had a fancy media player at this point.
I went ahead and looked on craigslist and found a vibrant w/ a broken screen, figuring I could swap out the guts. I immediately backed up the /efs folder and partition of the broken phone, just in case. On a whim, I tried to flash the efs partition from the broken phone to my phone. Lo and behold, the baseband came back. I was now able to write to that partition, so overwrote the /efs folder w/ my backup from before. My IMEI came back afterwards, and so now, I have 2 functioning vibrants. I'm not sure what data is stored in /dev/block/stl3, but I do know I was able to fix my phone using another phone's data. They both work w/ my sim, though I am unsure if they can connect simultaneously using different sims or if they are somehow cloned, but the IMEIs are different for sure.
The moral of the story is that this phone is nigh unbrickable and even when it doesn't boot, you can always try the jig. The only part of the phone you can't fix w/ a routine odin it seems, is the efs partition, so I would encourage everyone to make a backup and keep it safe. This is not done standard as an initiation into rooting and roms and such, but it should be. Normally, odin'ing a rom does not write to this area, but even w/o screwing with this, frequent flashing and odins can apparently corrupt it, leaving you high and dry. With this backup and odin, you could probably fix your phone from any jam.
Here are the relevant threads on how to do this:
http://forum.xda-developers.com/showthread.php?t=882039
http://forum.xda-developers.com/showthread.php?t=859914
Keep those backups safe!
Thank you for sharing ur experience, I recently noticed that my data speeds have gone down after unlocking my vibrant using the method you mentioned above.Damn, I get edge speeds when I am on a HSPA network. Dunno whats the problem,called up simple mobile,am not data throttled.Sigh..
Sent from my SGH-T959 using XDA App
man this is scary, but your phone still works at JFD right?
Sent from my SGH-T959 using XDA App
It didn't for a while. Now, both phones are fully functional. I had a copy of the /efs folder of my old phone, but not an image of the partition. The problem is, when the partition gets screwed, you can't write to it, making the /efs useless.
That's why I'm trying to get people to make the backup. It takes a few minutes, but can be a lifesaver. I do believe you can flash a foreign stl3 partition and overwrite the /efs like I did, but unless you had a friend, no one would share it w/ you as it contains their imei info. Better to just back up your own. And if you lose your /efs, game over.
How exactly do you back up a partition?
Very cool of you to post this up. Is there any reason to back up your efs partition if you have no reason to unlock?
<---backing it up anyway.
It's not the unlocking. It seems that over time, some people (such as myself) screwed up the efs partition by just flashing/odin'ing various roms. It shouldn't happen, but it does. Consider that no roms write to the stl3 layer, yet mine was working one day, then one odin later, it didn't. I'm sure the number of people this happens to is quite small, but when it happens, it happens. It's like a 6 mb backup which isn't that big of a deal.
It's better to be safe than sorry.
I did an experiment on my Galaxy Tab, that I move the /efs folder to memory card.
Soon I found the reception goes way worse (at least 10dBm less) and the serial number changed to 00000000, then I immediately copied (restore) the folder and everything was back to normal.
I tried to examine the files with hex editor but I found nothing spectular.
vnamee said:
It's not the unlocking. It seems that over time, some people (such as myself) screwed up the efs partition by just flashing/odin'ing various roms. It shouldn't happen, but it does. Consider that no roms write to the stl3 layer, yet mine was working one day, then one odin later, it didn't. I'm sure the number of people this happens to is quite small, but when it happens, it happens. It's like a 6 mb backup which isn't that big of a deal.
Click to expand...
Click to collapse
That's really weird. I've never really looked into the occurrence because I always assumed it was isolated only to those that did some weird hacking in an attempt to unlock, or to those that were developing and found themselves doing some nasty, nasty things.
I just created efs_dev-block-st13.img and efs-backup.tar.gz so hopefully I'm all safe and sound now.
Thanks again! Once I get beyond GPS stuff I find myself clueless.
draikz said:
How exactly do you back up a partition?
Click to expand...
Click to collapse
You need to read the two links in the OP and download adb. You also need root and busybox.
all you need is to root your phone, such as w/ superoneclick which will put busybox on there. Then all you need is adb.exe.
Open up a command prompt where adb.exe is located. You can adb su or just go adb shell and then su.
The only commands you need are:
cat /dev/block/stl3 > /sdcard/stl3.bin (backs up sector management layer of partition)
cat /dev/block/bml3 > /sdcard/bml3.bin (backs up block management layer of partition)
tar zcvf /sdcard/efs-backup.tar.gz /efs (tars /efs folder)
cp stl3.bin efs.rfs (just makes copy of stl3.bin to new name efs.rfs)
tar -cf efs.tar efs.rfs (makes an odin flashable tar of partition)
I kept a copy of stl3.bin, bml3.bin, efs-backup.tar, and efs.tar.
vnamee said:
all you need is to root your phone, such as w/ superoneclick which will put busybox on there. Then all you need is adb.exe.
Open up a command prompt where adb.exe is located. You can adb su or just go adb shell and then su.
The only commands you need are:
cat /dev/block/stl3 > /sdcard/stl3.bin (backs up sector management layer of partition)
cat /dev/block/bml3 > /sdcard/bml3.bin (backs up block management layer of partition)
tar zcvf /sdcard/efs-backup.tar.gz /efs (tars /efs folder)
cp stl3.bin efs.rfs (just makes copy of stl3.bin to new name efs.rfs)
tar -cf efs.tar efs.rfs (makes an odin flashable tar of partition)
I kept a copy of stl3.bin, bml3.bin, efs-backup.tar, and efs.tar.
Click to expand...
Click to collapse
I've got backups of stl3.bin, bml3.bin and efs-backup.tar.gz
When I try to make the partition an odin flashable tar it tells me: "No such file or directory".
You have to cd into the directory, or else it should be:
cp /sdcard/stl3.bin /sdcard/efs.rfs (just makes copy of stl3.bin to new name efs.rfs)
tar -cf /sdcard/efs.tar /sdcard/efs.rfs (makes an odin flashable tar of partition)
This is kind of old news, but nevertheless important.
Months ago in the Q&A section there were two threads about the importance of the EFS, and how a corrupted nv_data.bin and EFS can cause many problems including losing the ability to use a different carriers sim, yet nobody paid attention to those threads, but I thought the info was vital.
Would using ROM Manager and backing up your current rom, also backup the /efs?
vnamee said:
You have to cd into the directory, or else it should be:
cp /sdcard/stl3.bin /sdcard/efs.rfs (just makes copy of stl3.bin to new name efs.rfs)
tar -cf /sdcard/efs.tar /sdcard/efs.rfs (makes an odin flashable tar of partition)
Click to expand...
Click to collapse
Yeah, I did. I'll do it again and post up exactly what I type and put in. Maybe it's just operator error.
Here ya go.
It might have been operator error because that time I watched efs.tar get written to /sdcard
It should be efs.rfs, not efs/rfs. It's a file, not a directory.
SamsungVibrant said:
Would using ROM Manager and backing up your current rom, also backup the /efs?
Click to expand...
Click to collapse
Nandroid does not back up the /efs partition, at least not that I can tell. All those files in the backup folder are of the various partitions, and efs partition is not part of it.
The reason I made this thread to begin with is because when I had this problem, I looked high and low, and found scant info. In the future, if someone else has this problem, this will come up in a search and won't have some lame magical fix that may or may not work.
vnamee said:
It should be efs.rfs, not efs/rfs. It's a file, not a directory.
Click to expand...
Click to collapse
Pinky slip!!! For whatever reason, it took 3 tries but I finally got it to backup. Thanks for the help! I would never think to back this stuff up. Everyone does Nandroid's like crazy, which is good, but losing this stuff is losing your phone!
Excellent write-up vnamee thank you..........
Related
I flashed my phone to JF 1.5 and in the process some how managed to screw up my sd card and lost all my apps. i did do a nandroid backup of jf 1.41 so i ahve those img files. I tried to restore to that to recover everything but it wont boot past the g1 logo. I tried downgrading firmware to 1.43 (couldnt find 1.41) and using the same restore for nandroid and still wouldnt boot. I also tried jsut applying the user data img to see if i could jsut grab that and it fialed on both firmware revisions 1.5 , 1.43.
In the end im stuck with a backup i cant use, the only thing i need off of it is the apps. I read that you can use the emulator to mount it but i couldnt figure that out. I also looked at yaffs extractor from the google code site but i wasnt quite sure how to compile/run it.
Anyone have a simple solution or a complex one i can follow to getting my apps out?
did you follow this?
http://forum.xda-developers.com/showpost.php?p=3311708&postcount=2
darkrangr said:
I also looked at yaffs extractor from the google code site but i wasnt quite sure how to compile/run it.
Click to expand...
Click to collapse
You go into the source directory, type "gcc -o unyaffs unyaffs.c", then you (create and) go to some directory where you want to extract the contents ("mkdir ~/extract") "cd ~/extract", and finally you extract the image "/path/to/unyaffs /path/to/data.img".
I tried the standard nandroid restore and it failed.
Trying the yaffs thing now and i got an error.
I placed the yaffs files all in a folder on the sdcard and put the img in that folder as well.
I open the terminal on the phone and did cd /sdcard/nan nan being the directory i made
I then tried to run that command "gcc -o unyaffs unyaffs.c" and i get gcc not found. what did i do wrong?
Unless your backup was corrupted, flashing the backup should have been fine.
Code:
fastboot flash boot boot.img
fastboot flash system system.img
fastboot flash userdata data.img
You said it failed - what error did it give? Did it say it couldn't find the command? Be sure you're running these commands on your PC with your G1 connected via USB, the correct drivers are loaded, and you have the fastboot program.
As for using unyaffs - I don't think you understand what you have to do to use it. You have to compile it on your PC...all you get is the source code. I haven't looked on the google code site, but I would imagine there isn't a version for windows.
EDIT: After reading your original post for a second time, I have to ask: if you screwed up your SD card and lost all of your apps, does that mean you were using Apps2SD? That's a bit of an important detail to leave out, if so. Unless I'm mistaken (and someone correct me if I'm wrong), your apps wouldn't be in the backup anyway, you're wasting your time. If your backup is just restoring the symlinks to the SD card and the SD card is screwed up, then no wonder it's hanging at boot. You'd need to wipe your SD card and start from scratch. I'd recommend doing that either way - would you rather have to redownload a few apps or continue having a bricked phone for days?
it didnt fail on the restore with fastboot, it loaded up everything fine and then when i rebooted it just sat on the boot screens forever and never loaded.
I am feeling nice so darkrangr if you want to PM your image files I will unyaffs it on my ubuntu box for you.
TemporalShadows said:
EDIT: After reading your original post for a second time, I have to ask: if you screwed up your SD card and lost all of your apps, does that mean you were using Apps2SD? That's a bit of an important detail to leave out, if so. Unless I'm mistaken (and someone correct me if I'm wrong), your apps wouldn't be in the backup anyway, you're wasting your time. If your backup is just restoring the symlinks to the SD card and the SD card is screwed up, then no wonder it's hanging at boot. You'd need to wipe your SD card and start from scratch. I'd recommend doing that either way - would you rather have to redownload a few apps or continue having a bricked phone for days?
Click to expand...
Click to collapse
no, my apps were installed normally. I am running curent jf firmwar enow while i try to get my stuff back, but some of the apps i had are no longer available or have converted to pay apps, plus i forgot a lot of apps i had.
http://forum.xda-developers.com/showthread.php?t=497034
In the other tools archive on this post you can find the unyaffs tool fully compiled. Just move your image to the same folder, drag and drop it on the unyaffs.exe and watch the files appear.
How about YOU DIDN'T INSTALL GCC!!!
darkrangr said:
I tried the standard nandroid restore and it failed.
Trying the yaffs thing now and i got an error.
I placed the yaffs files all in a folder on the sdcard and put the img in that folder as well.
I open the terminal on the phone and did cd /sdcard/nan nan being the directory i made
I then tried to run that command "gcc -o unyaffs unyaffs.c" and i get gcc not found. what did i do wrong?
Click to expand...
Click to collapse
Hi everyone!
The reason why I post this threat is that there is no clearly mention about the /efs folder in the rooting/how-to guides in here. In my opinion, it's the MOST IMPORTANT thing to know for all Samsung devices with Android OS before flashing any custom ROM. There is a really good threat posted in Original Android Development by Rawat, which I'm going to quote right here. Unfortunately, it's not a sticky threat so it's gone somewhere deeper in the forums.
I really beg you for a sticky of this thread, or Rawats to prevent all new users of damaging their phones.
My point is: many of you can agree, the /efs folder is very sensitive. If it get corrupted and you have no backup of it, well.. let's just say it's nearly impossible to get you phone working again. It contains your IMEI number and some other important things! There have been some situations when it get corrupted after flashing some ROMs. Without a backup, your IMEI is gone. The only way to get your phone working again is to send it back to Samsung Service.
Here is the guide, originally posted by Rawat! Thank you very much:
This guide is based on a guide by Candanga on the i9000 forums, and some commands from supercurio
Please hit thanks on their posts and show them some love for the write up.
-----------------------------------------------------------------------------------------------------------------------
I’ve compiled a quick guide to instruct how to make a copy of the /efs folder. I’ve found in many threads suggestions about backing up this folder but the methods itself are very general. Most of the times they suggest to “root and copy the folder” with Root Explorer or similar, but usually it’s not that easy or it just doesn't work for everyone.
This guide ASUMES you have read this Excellent Guide by Darkstrikerfirst:
H E R E <-- Make sure to read the ADB Guide.
I recommend doing this with a Mobile just taken out of the box or with any Official ROM of its Service Provider. If you have already Flashed your phone with another ROM but its working fine, then you can use that /efs also.
Why the /efs folder?
This is a very sensitive system folder that contains Phone-specific information such as the IMEI (encrypted in the nv_data.bin), wireless devices MAC addresses, product code (also in the nv_data.bin), and much more. Often users trying to change product codes or trying to unlock the mobile will end up corrupting data in this location.
Why back it up?
Well, let’s resume it saying that backing-up this little folder will keep you away from Samsung service centres.
***WARNING: I take no responsibility to any damage caused by the methods cited and/or written here. Their sole purpose is to back-up data and not to alter in any way the integrity of the original files of the mobile***
What you will need:
* Rooted SGS II to get permissions as a SU (Super User) and perform the backup
* I would suggest learning a little about the terminal commands used (in case you are not familiar with them), as it’s better to know what you are doing rather than typing strings like a little chimp without knowing what they are; if you are a little lazy, then you have a good chance bricking your mobile. <- Busybox Commands(or Google them)
* Terminal Emulator by Jack Palevich (available from the market) <-Terminal Emulator or use ADB which is included in the SDK Development Tools
The standard prompt of terminal (adb) is a $ sign. Once you enter “SU” it will become a # Sign.
***NOTE: Make sure to keep an eye on the screen of your SGS II during this process, because it may request SU permissions [currently doesn't on CF-root]; else, you will get an error (just if it’s the first time). In Terminal Emulator you will need to reset the app after granting permissions cause it usually freezes***
*Remember: to use ADB you need to enable USB DEBUGGING under Applications/Development in your SGS II.
Here are 3 methods, I recommend that you do both Clean and RAW.
Basic, unix permissions lost :
Code:
su
busybox cp -a /efs /sdcard/efs/
Clean :
Code:
su
busybox tar zcvf /sdcard/efs/efs-backup.tar.gz /efs
After this, you will end up with the file efs-backup.tar.gz in your INTERNAL SDCARD in sdcard/efs/, which is a “tarball” or a ZIP of the /efs folder. That file is your backup. You can expand it with Winrar.
You can also back up the mmcblk0p1 (where /efs is stored) under /dev/block which can greatly support in recovering your IMEI in case of a screw-up:
RAW :
Code:
su
cat /dev/block/mmcblk0p1 > /sdcard/efs/efs_dev-block-mmcblk0p1.img
alternative
Code:
dd if=/dev/block/mmcblk0p1 of=/sdcard/efs/efs_dev-block-mmcblk0p1.img
Same thing, the target is the INTERNAL SDCARD in sdcard/efs/, so go ahead and copy the file.
--------------------------------------
original thread by Rawat @ xda: click here
matee89 said:
Without a backup, your IMEI is gone. The only way to get your phone working again is to send it back to Samsung Service.
Click to expand...
Click to collapse
Not 100% true, there are other ways, for example I know how to generate valid nv_data files.
matee89 said:
RAW :
Code:
su
cat /dev/block/mmcblk0p1 > /sdcard/efs/efs_dev-block-mmcblk0p1.img
Same thing, the target is the INTERNAL SDCARD in sdcard/efs/, so go ahead and copy the file.
Click to expand...
Click to collapse
I think using dd is better than cat, I dont know why but I have a feeling cat could do some character conversion in some circumstances, so :-
dd if=/dev/block/mmcblk0p1 of=/sdcard/efs/efs_dev-block-mmcblk0p1.img
or better still do both, cannot have too many backups
Thanks for info Odia! Well, the backup is still important. Saves a lot of time for newbies, so i think that this guide should be sticky. Everyone can see it clearly then
There is already a thread about this...
rawat thread
And there's an app on the way apparently..
app thread
Yes, but this thread is not sticky. If you at least read a little part of mine post you should see that I quoted Hawats thread and put a link to it. My point is that this should be more visible for everyone. To be honest, it should be sticky like the rooting guides and other how to's, because it can give you serious problems with the device when files inside /efs get corrupted. Myself I haven't know about the purpose of /efs since yesterday, because it wasn't clearly mentioned in here. Just want to help other newcomers to Samsung devices.
This app will do exacly the same thing like you will do right now following this guide. It's not released yet, so this guide should be used meanwhile.
matee89 said:
Thanks for info Odia! Well, the backup is still important. Saves a lot of time for newbies, so i think that this guide should be sticky. Everyone can see it clearly then
Click to expand...
Click to collapse
Sure the backup is important, is why I added some input to your thread about using the dd command to make double sure the backup taken was valid.
Can an admin or mod make Rawat's thread sticky pls?
Okay, shall edit and post the alternative backup method with dd comand instead of cat.
Would be great with sticky. I don't think that majority of people who's flashing ROM's know how important this folder is. From what I've heard the nandroid backup in CWM recovery does not backup the /efs so it's needed to be done manually.
before using this comands you should use mkdir /sdcard/efs if you don't want to get an error
I made clean, raw and dd back up. Now I have two files of 20 MB each and one of 28Kb is it ok?
Yes, it seems okay. I saved my efs backup files on my PC as well in case something happens to the internal sdcard storage.
Thank you for that. I will backup mine tonight.
Thank you got the backup with my Note
Re: mp1806
Probably some of the ROMs that you flashed had an automatic backup script included, so you already got a working efs backup on your sd card. If you want to be completly sure if the backup is correct, you can make it manually by following the steps in my first post. Later you can even copy your backup to your PC if you like to.
There is three or four apps by now that aid you in creating EFS backups.
Most have been mentioned in the other (older) EFS backup thread.
It's one app i forgot the name of, EFS-Pro that works from your computer and my own one (see sig).
If you search for "efs backup" on the market you will find "Nitrality" (or however it's spelled, forgot the exact name right now) and my one.
Mine also offers an option to check the EFS backup if it's OK or corrupted, so can be really sure to have a good one when the check succeeds.
Point beeing:
No real need to tinker on the shell anymore
Great Thanks for this
Hi, I am using the RAW method on my Galaxy Note, rooted, but I keep getting a file not found error. Anyone able to help? I got the su and the prompt changed correctly, but after:
cat /dev/block/mmcblk0p1 > /sdcard/efs/efs_dev-block-mmcblk0p1.img
It just says file not found. What am I doing wrong?
Another way is to use ktool made by Hellcat to backup your efs and even restore.
http://forum.xda-developers.com/showthread.php?t=1314719&highlight=ktool
Anyone knows if this tool is as good as command line way?
(nvm)
Odia said:
Not 100% true, there are other ways, for example I know how to generate valid nv_data files.
Click to expand...
Click to collapse
Can you please let me know how to generate it? I HAVE LOST THE EFS FILES ON MY PHONE!
Samsung Tool
Samsung Tool is the easiest and more safe method
how do you restore it?
This is a CWM zip which intended purpose is to make creating heimdall one click roms easier.
It will backup partitions using dd and put them in a folder on your internal SD card labeled partition-backup. You can then use these to create heimdall one-click versions of your own rom.
The partitions backed up are as follows:
Captivate Stock based roms:
/system (/dev/block/stl9)
/dbdata (/dev/block/stl10)
/cache (/dev/block/stl11)
kernel (/dev/block/bml7)
modem (/dev/block/bml12)
param.lfs (/dev/block/stl6)
Captivate MIUI/Cyanogenmod based roms:
/system (/dev/block/mtdblock2)
/datadata (/dev/block/mtdblock6)
/cache (/dev/block/mtdblock3)
/radio (/dev/block/mtdblock5)
kernel (/dev/block/mtdblock0)
recovery (/dev/block/mtdblock1)
modem (/dev/block/mtdblock5)
The data partition is not included.
This is not intended to be a backup for your Captivate, although it could be used as one. Again, it's intended for Heimdall rom creation.
For backups, it is preferable to use CWM. I personally, really like the 5.0.2.6 version by mtcarey as it tars up the data rather than dd's the entire partition which saves a lot of space (like the /data partition for example).
DISCLAIMER: I am in no way to be held responsible for what you do to your device. If you use it, whatever the consequences, they are your responsibility.
Now with that being said, this script doesn't do anything destructive but simply copies the partitions to the internal SD card for later use.
Here are the links:
Captivate Stock based - http://db.tt/tPGn42Pi
MIUI/CyanogenMod based - http://db.tt/rwy5WIel
Let me know if you have any issues with the scripts.
My bad...
10 char
b-eock said:
You have to include data on stock ROM's as it will run the check when it installs on reboot... it will fail because of the missing data partition..., so you might wanna put that into the SCRIPT!
Click to expand...
Click to collapse
you will only get the error if you re-partition
b-eock said:
You have to include data on stock ROM's as it will run the check when it installs on reboot... it will fail because of the missing data partition..., so you might wanna put that into the SCRIPT!
Click to expand...
Click to collapse
You don't need /data...
dbdata is the one that gives that error if you re-partition.
Have you given thought to writing a cwm script to backup efs, or adding it to this script?
mrhaley30705 said:
Have you given thought to writing a cwm script to backup efs, or adding it to this script?
Click to expand...
Click to collapse
I could be wrong on this point but as I understand it the IMEI number is contained there so this isn't probably the best idea.
I could add a separate script for it but I will need to confirm that this wouldn't cause issues for people replicating an IMEI number.
I was thinking of using it as a way to backup an efs.
Understood. I'll put one up later today. In the meantime, you can always copy the folder to your sdcard for safe keeping.
backing up of both EFS and Data, would be nice for PERSONAL backups, make a note not to redistribute efs or data in the heimdall one click packages.
any of your passwords/saved information will be in data..... unless you backup data immediately after flashing/pushing apps BUT before android OS setup...
efs is still a DO NOT DISTRIBUTE.
Tried using partition backup and it didn't make the backup file, or i can't find it.
in a folder on your internal SD card labeled partition-backup
Click to expand...
Click to collapse
how long did it take? a while? it should if it did something.
No, just a couple of second.
Edit
Mount system first?
It should take a minute or so to complete. Once done, reboot back into the OS and there should be a folder /sdcard/patition-backup/.
Within this folder you should have multiple images all ending in .rfs. Really they would typically end in .img but I had it save the images using an rfs extention to facilitate things with heimdall as that's what it expects.
What version of Android are you running?
MIUI. 1.11.18 w/Neo 17r18.
TRusselo said:
backing up of both EFS and Data, would be nice for PERSONAL backups, make a note not to redistribute efs or data in the heimdall one click packages.
any of your passwords/saved information will be in data..... unless you backup data immediately after flashing/pushing apps BUT before android OS setup...
efs is still a DO NOT DISTRIBUTE.
Click to expand...
Click to collapse
Agreed. /data has all your personal data and efs has your IMEI. You don't want to distribute either of these. That is primarily why I left them out of the script. Don't forget you can either copy the entire efs folder or just zip it up and save it somewhere off your phone as a backup. If you are just looking to backup the phone, CWM is much more efficient at backing it up, IMO.
mrhaley30705 said:
MIUI. 1.11.18 w/Neo 17r18.
Click to expand...
Click to collapse
Hmmm... I haven't tested it on either MIUI or Cyanogenmod. They may use a different partioning scheme. Can you please copy/paste the response of typing 'mount' from a shell?
( adb shell, then just simply type 'mount' from there )
How's this
Ok, I see the problem. It appears the MIUI and Cyanogenmod use /dev/block/mtdblock* whereas stock Captivate based roms use /dev/block/mmcblk*.
I'll see about making one for your setup.
Thanks for testing this!
No problem.
After being stuck on OTA2 without root for a while, I finally got it today, and finishing finals and all, I really got to messing around with it. Well, long story short, I backed up my tablet with nandroid, got CM9, then realized I'm having a lot of issues with it/not worth the upgrade yet. I can't use my nandroid backup for some reason either as it keeps giving me some md5 checksum error, so is it advisable to just go wherever after this, whether OTA or OTA2 or w/e, since I guess my backup failed and I'm trying to leave CM9 (too many incompatible applications >.>)
Try the market linked in this thread until a solution is found:
http://forum.xda-developers.com/showthread.php?t=1559264
Alright, thanks a lot.
yahoowizard said:
After being stuck on OTA2 without root for a while, I finally got it today, and finishing finals and all, I really got to messing around with it. Well, long story short, I backed up my tablet with nandroid, got CM9, then realized I'm having a lot of issues with it/not worth the upgrade yet. I can't use my nandroid backup for some reason either as it keeps giving me some md5 checksum error, so is it advisable to just go wherever after this, whether OTA or OTA2 or w/e, since I guess my backup failed and I'm trying to leave CM9 (too many incompatible applications >.>)
Click to expand...
Click to collapse
I was having the same issues with doing a restore, I realized I was using the initial CWR, i downloaded Koshu's fixed CWR at http://forum.xda-developers.com/showpost.php?p=21916505&postcount=71
for whatever reason I had to manually type all the ADB commands in simply copying and pasting was not allowing me to mount it as RW. and dont forget to make sure the IMG file name is referenced correctly in the name. but after that I was able to backup and restore without a hitch.
Code:
C:\Program Files (x86)\Android\android-sdk\platform-tools>adb
adb push cwr_ventana_2.img /data/local/
C:\Program Files (x86)\Android\android-sdk\platform-tools>adb shell
$ su
su
# mount -o rw,remount /system
mount -o rw,remount /system
# echo "#!/system/bin/sh" > /system/etc/install-recovery.sh
echo "#!/system/bin/sh" > /system/etc/install-recovery.sh
# dd if=/data/local/cwr_ventana_2.img of=/dev/block/mmcblk0p1
dd if=/data/local/cwr_ventana_2.img of=/dev/block/mmcblk0p1
There's no way to bring back that backup that didn't work, is there? I see all the files except the nandroid.md5 as far as I can see, but that in the end is what's necessary to make it run.
You could do it manually in adb, but without the md5 sums you can't be sure that the files are complete/not corrupt.
I believe the restore fails because the backup was bad. To make a good backup you have to clean out the internal sd card, or the backup file exceeds the limit of this version of CWR.
yahoowizard said:
not worth the upgrade yet.
Click to expand...
Click to collapse
If you want to have CM9, perhaps you can contribute by testing and reporting the problems you have. So that you will get double reward: 1) CM9 earlier 2) being acknowledged as part of the project
Well, yeah, I guess the stuff on my tablet wasn't that important. It was all the notes I had taken from this quarter, but the thing was that I took the finals the day before all this went down, so yeah. I'll stick with CM9 for now then see how it plays out from there. The updates have been coming out really fast anyway so pretty happy overall.
Koshu said:
Try the market linked in this thread until a solution is found:
http://forum.xda-developers.com/showthread.php?t=1559264
Click to expand...
Click to collapse
This doesn't seem to change anything. Most of the applications still aren't working in the market, like almost all of them. There might have been a few that I didn't notice, but yeah, not really sure. Was I supposed to place the file in folder, reboot, then clear data, or the other way around =0
I uploaded a new CM9 version with another fix. It doesn't seem to work for everyone (got only a little feedback until now) but if you want to give it a try... Could need some additional testers to pinpoint the bugs.
http://forum.xda-developers.com/showthread.php?t=1490831
(Full wipe before flashing)
Ok, I'm officially in trouble. I have a SM-G900F rooted with towelroot, SuperSu and BusyBox installed. I tried flashing with Mobile Odin Pro the latest NG2 firmware to keep root and not trip Knox. It failed twice (or three times), both times I was able to restore the original firmware with desktop Odin (http://forum.xda-developers.com/galaxy-s5/help/mobile-odin-pro-4-20-issues-t2834671).
Then something strange happened: I noticed that on 4G I had only data but no signal bars (http://forum.xda-developers.com/galaxy-s5/help/help-4g-data-signal-bars-t2837031). Then I had problems connecting to Wifi and a message appeared telling me I am in "Factory Mode" and some things are limited.
It was clear that my EFS partition is corrupted. I installed Root Explorer and there is nothing in my EFS folder (still I can use the phone in 2G/3G/4G for data and 2G/3G for calls but no Wifi).
I have 2 backups for EFS: one is made using Samsung Tools (http://forum.xda-developers.com/galaxy-s3/development/efs-samsung-tool-universal-support-t2602325) and it's an efs.img file, the other is made using some EFS backup tool and it's just a copy of exactly what was in EFS folder (a few folders and files). I tried using Samsung Tools to restore the backup but no luck. When I restart the phone, EFS folder is still empty.
I rebooted in recovery mode and it said "failed to mount /efs". That's probably why Samsung Tools can't do it's job but I'm not sure. At this moment I'm not sure of anything. I think that someone with some knowledge (knowledge that unfortunately I'm missing) can help me fix this.
I really need for some help, so any ideas are welcomed.
Thank's,
Mihai Raducan
..
fffft said:
No TWRP backup, huh? How did I know that was going to be the case? 10 demerits. Okay, you seem to have been on the right track in recognizing that your EFS partition was unmounted and therefore inaccessible in recovery mode.. but you didn't mount it? You didn't give us much detail to work with, but assuming that you have a custom recovery like TWRP, you could go to the advanced /mount menu and check the mount EFS partition. Or if you don't have that option for some reason, mount it yourself e.g.
.
Click to expand...
Click to collapse
It's only stock recovery, no TWRP or CWM.
I didn't mount the EFS partition before because I didn't know how. I'll follow your guide and report back.
Regarding the exact copy of EFS (efs.img): It's done with Samsung Tools but never had a chance to test it, so... I don't know. But let's take it one at a time. First problem: mount efs partition.
PS: My Windows laptop is playing tricks on me so it's going to take a while to reinstall Windows, adb, etc. But I'll be back.
Thank's.
..
Ok, I installed Adb, phone is recognized.
The first line of code
Code:
# ls -al /dev/block/platform/msm_sdcc.1/by-name
gave me a list with the location of efs (and more). EFS is at dev/block/mmcblk0p12.
The second line of code
Code:
# /sbin/mount /dev/block/mmcblk0p12 /efs
gives me : tmp-mksh: /sbin/mount: not found
Am I missing something?
is img of /efs partition enough for restore?
here, it says, that we need to have 3 partitions for full restore..??..: http://forum.xda-developers.com/showthread.php?t=2737448
dd if=/dev/block/mmcblk0p12 of=/mnt/sdcard/efs.img.ext4
dd if=/dev/block/mmcblk0p13 of=/mnt/sdcard/modemst1.bin
dd if=/dev/block/mmcblk0p14 of=/mnt/sdcard/modemst2.bin
but Samsung tool only makes efs.img..??.. who is right who is wrong?
..
fffft said:
Personally, if an EFS backup program made an image (.img} file and it was the same size as your EFS partition I'm sure that it was an exact copy and try writing it back. It's unlikely to make anything worse. But don't blame me if it somehow goes wrong. I'm just describing an option of last resort and commenting on what I would do with my own phone.
You can check the size of your EFS partition with the cat command (EFS should be partition 12)
Code:
$ su
# cat /proc/partitions
.
Click to expand...
Click to collapse
I checked the size of my efs.img and the size of the partition with the command you gave me. They are both 14MB but on a closer look, adb shows 14336 and Windows reports 14680kb. So I don't know....
fffft said:
You're using ADB instead of a terminal emulator app which is a new variable. There are a lot of ADB variants around and I have no idea what your command interpreter (mksh) or you have done with the shell environment.. which may require syntax adjustments.
Not found implies that the /system partition isn't mounted. But it could also be an ADB syntax quirk, path or symlink error, a typo or.. well, could be a lot of things. Perhaps try the syntax below. Or run the command from a terminal emulator instead of ADB shell.
Code:
$ su
# adb shell mount /system
# adb shell mount /efs
.
Click to expand...
Click to collapse
I installed Android Terminal Emulator and Shell Terminal Emulator (PlayStore) but I got the same thing. What's strange is that in both of them when I run the command "adb devices" they both give me nothing while in adb shell on desktop I get a number (as it should).
I understand that the syntax is for a specific terminal emulator. Tell me please what is that terminal emulator (that you know syntax is correct) so I can try with that one.
..
fffft said:
Try this terminal emulator app.
If you have continued difficulties, you should describe step by step what you are doing. In exhaustive detail or as close as you can get to that. Then someone in the forum will have a good basis to see where you are going astray. Or alternately where I made a typo or whatever the impediment turns out to be.
.
Click to expand...
Click to collapse
This is one the apps I tried with.
I'm describing step by step what I do. What I start with: SM-G900F rooted with towelroot, stock recovery, SuperSU and BusyBox installed, Knox 0x0.
I download and install https://play.google.com/store/apps/details?id=jackpal.androidterm.
Using this app:
Code:
su
and it changes to [email protected]:/#
I enter:
Code:
# ls -al /dev/block/platform/msm_sdcc.1/by-name
and it gives me a list with paths to different things. EFS apears to be at /dev/block/mmcblk0p12
I enter
Code:
# /sbin/mount /dev/block/mmcblk0p12 /efs
and it says: "tmp-mksh: /sbin/mount: not found"
When I try
Code:
adb devices
it gives me no number.
I attached a file where you can see what I did.
One more thing: when I enter (stock) recovery, every time it says "Installing system update" for about 20 seconds and then enters recovery where it says "failed to mount/efs : invalid argument". The CSC part is apparently ok.
..
It doesn't work. From ADB it says "mkdir failed for /efs, File already exists".
And from terminal emulator, (with busybox) it asks for an argument (pic atached).
Is there any way of using Odin to fix this, because it seems that nothing works.
fffft said:
Who is right about what? You didn't give much of a context for your question. The OP said that his EFS was corrupt, so we have been talking about EFS which is self contained in partition 12 or exported as efs.img.
Click to expand...
Click to collapse
i thought there could be more to the problem, not just /efs partition, since he said it was clear to him, and not beeing 100% fact..
..
Thank's for your time. I'm flashing now the original firmware (so I can start fresh) and I'll document every step I take. I'll report back.
Ok, I tried flashing the original firmware (ANE2) and this time I can't even get pass the Samsung authentication screen (the first time you boot your phone and asks for language, Google account, etc), It asks me for the Samsung account and password that this phone was registered with) and it tries for a couple of minutes to verify the credentials (on data network) then it fails saying it is a network error.
I tried wipe cache/factory reset (from recovery) and reinstall a different firmware. Same thing. It seems now it's really messed up.
As mentioned earlier, we did not expect a firmware image to fix your EFS. And the EFS is critical to normal phone operation.
The purpose of stock firmware is so that your phone is stable, reduce variables that might interfere and facilitate fixing your EFS. So I'm not why you apparently expected it to be an outright fix in and of itself?
Having installed the stock firmware should help you achieve your remaining goals. Now you need to decide if you are going to install a custom recovery or not. A custom recovery will increment your Knox flag if it isn't already. That affects very little, but it's your decision. It may affect the private mode feature or warranty claims, however many carriers don't care about Knox and E.U. legislation bars Samsung from invalidating a warranty unless they can demonstrate that root damaged your phone.
Whether or not you install a custom recovery, you will want to try writing your 14 MB EFS backup image to your phone. I believe that you'd find it easier to do so with a custom recovery. But it can be done with a stock one too, you will just have to deal with a bit more syntax in the latter case.
.
fffft said:
As mentioned earlier, we did not expect a firmware image to fix your EFS. And the EFS is critical to normal phone operation.
The purpose of stock firmware is so that your phone is stable, reduce variables that might interfere and facilitate fixing your EFS. So I'm not why you apparently expected it to be an outright fix in and of itself?
Having installed the stock firmware should help you achieve your remaining goals. Now you need to decide if you are going to install a custom recovery or not. A custom recovery will increment your Knox flag if it isn't already. That affects very little, but it's your decision. It may affect the private mode feature or warranty claims, however many carriers don't care about Knox and E.U. legislation bars Samsung from invalidating a warranty unless they can demonstrate that root damaged your phone.
Whether or not you install a custom recovery, you will want to try writing your 14 MB EFS backup image to your phone. I believe that you'd find it easier to do so with a custom recovery. But it can be done with a stock one too, you will just have to deal with a bit more syntax in the latter case.
.
Click to expand...
Click to collapse
I didn't expect to fix the problem, I wanted a fresh start so I can try again the adb/terminal emulator commands. But what I didn't expect was not being able to, basically, start the phone. When you first start a new phone (or after a factory reset) it asks you language, Wifi, Google account and, in my case, for a Samsung account that this phone was paired with.
If I try to connect to a Wifi network the phone reboots itself. If not, it tries via data connection. Google credentials are ok but when it tries to verify Samsung credentials it gets stuck saying that it's a network problem and it doesn't go futher. So I get stuck at this point, between booting and actually being able to use the phone. I can't install anything, I can't receive or make phone calls (like before). I can't go to USB debugging so ADB doesn't see the phone.
I don't want to install a custom recovery because my Knox is 0x0 and my warranty is intact. I live in EU but in this case, it's clear that root access is what got me in trouble and brought the phone in this state. Actually not root access got me in trouble, but what I did with root access
raducanmihai said:
I didn't expect to fix the problem, I wanted a fresh start so I can try again the adb/terminal emulator commands. But what I didn't expect was not being able to, basically, start the phone. When you first start a new phone (or after a factory reset) it asks you language, Wifi, Google account and, in my case, for a Samsung account that this phone was paired with.
If I try to connect to a Wifi network the phone reboots itself. If not, it tries via data connection. Google credentials are ok but when it tries to verify Samsung credentials it gets stuck saying that it's a network problem and it doesn't go futher. So I get stuck at this point, between booting and actually being able to use the phone. I can't install anything, I can't receive or make phone calls (like before). I can't go to USB debugging so ADB doesn't see the phone.
I don't want to install a custom recovery because my Knox is 0x0 and my warranty is intact. I live in EU but in this case, it's clear that root access is what got me in trouble and brought the phone in this state. Actually not root access got me in trouble, but what I did with root access
Click to expand...
Click to collapse
The only way to get your phone to work again and gain access to networks/wifi is by installing a new motherboard if you can`t restore the old EFS folder somehow.
Next time try this method to backup and restore your EFS folder http://forum.xda-developers.com/showthread.php?t=2737448 if you are rooted.
raducanmihai said:
I didn't expect to fix the problem, I wanted a fresh start
Click to expand...
Click to collapse
Sorry that you found it a surprise.. but if reinstalling the stock firmware eliminated your phones problems, that would make it a solution, whereas it's a stepping stone. I did try to explain this earlier, where I told you that installing the firmware would not fix your EFS. And the EFS is essential to normal phone operation.
Regardless of the surprise, you are now on a better footing to finish fixing your phone. But for clarity, your problem started when your EFS got corrupted somehow. And your EFS needs to be restored before the problem will be resolved.
On the positive side, you appear to have a EFS backup, even if the backup app won't easily restore it to you phone. If you stick with it.. you just have some minor hurdles remaining - syntax or whatever - in getting your 14 MB EFS backup restored (written) to your EFS partition.
If you want that done painlessly, then pack a case of beer and your phone into a box and ship it to me. And I'll return it fixed. As it seems unlikely that you'd do that though.. then try to provide as much info as you can here and someone will try to help you finish fixing your phone in this thread.
.