Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,813,020 Members 54,022 Now Online
XDA Developers Android and Mobile Development Forum

[GUIDE] how to get IMEI to stick across reboots

Tip us?
 
groksteady
Old
(Last edited by groksteady; 7th August 2012 at 03:56 PM.) Reason: solved, deleted OP question and changed to solution.
#1  
groksteady's Avatar
Senior Member - OP
Thanks Meter 105
Posts: 367
Join Date: Feb 2012
Location: Phnom Penh
Default [GUIDE] how to get IMEI to stick across reboots

This is a rundown of restoring your IMEI and /efs partition. A lot of people lose their IMEI and have no problem restoring it a variety of ways. But if your restored IMEI disappears on next reboot, your problem is something else. I had this, and I believe it was a corrupted /efs partition.

solution, short answer: flash a good efs.rfs file. I did it in Heimdall; I assume it'll also work in Odin. The one I found online (see attachment) restored my efs to the dummy IMEI of 004999010640000. Where I live and on my provider, this gives me network access. From there I could restore my backup nv_data.bin file to /efs. And then my proper IMEI sticks across reboots.

also: kitch posts another way to fix this, here and here.

NOTE: Messing with IMEI has potential legal problems. The attached file restores IMEI to a fairly common dummy number, so I assume it's not a problem. (mods, please delete if this is a problem). The dummy IMEI could work in your area, but that still could pose legal problems. Check in your area, and see the next paragraph.

WARNING/DISCLAIMER: I found this file on Rapidshare. I don't know who made it, put it there, where it might have been linked from, or what exactly is in it. All I had was a filename and I googled it. And all I know about it is that if you have the problems described above and below, then this may work for you. It did for me. If anyone can "see" inside the file to check that it doesn't contain anything malicious, please comment. All I can say is that ClamXav found nothing wrong with BML3_RESTORE.tar.md5 or the efs.rfs contained within it. And that I'm not responsible for what you do to your own phone.

More ways to check if this is your problem:

- You have no signal. In System Settings > About phone, Baseband says Unknown, even if you know you have a modem in there. Also, them going to Status, your IMEI and IMEI SV also say "Unknown". Other people posting about lost IMEI say they have either all zeroes there, or the dummy IMEI 004999010640000.

The rest of this is what I did in GB. I assume if you have this problem, you tried other solutions that got you here too.

- Flashing stock Samsung ROM with repartition doesn't restore IMEI (at least in Heimdall; I can't check Odin). Flashing EZbase Recovery in Heimdall doesn't do it either. They flash, but afterward boots to recovery mode and shows errors about not being able to apply Multi-CSC.

- in Terminal Emulator or adb, running 'mount /efs' returns: 'mount: can't read 'etc/fstab/': no such file or directory'.

- From here, you can still flash a rooted kernel and flash GB ROMs in CWM recovery mode. After each flash, recovery mode shows errors about not being able to mount /efs and/or /dbdata, and not being able to apply CSC.

- From here, if you try flashing to CM7 or CM9, installation aborts. Onscreen error message shows problems with /tmp/updater.sh.

- If you tried to flash a recent kernel with Heimdall, you can get in its recovery mode. I did this trying to get to a known working JB nandroid. I flashed the JB rom again, and it completes. Rebooting sent me back to recovery mode. Repeat rebooting until fed up. Restoring nandroid completes. Rebooting sent me back to recovery mode. Repeat rebooting until fed up.

solution, long answer:

For me, this was from GB.

- Flash the attached file. For Heimdall, untar it (in command line, run 'tar -xvf /path/to/BML3_RESTORE.tar' without quotes, and replacing /path/to/ with the proper filesystem path. If you don't know what this is, try dragging and dropping the file into your terminal window on your computer.)

Then run: 'heimdall flash --efs /path/to/efs.rfs' (without quotes, again replacing path, or drag-and-drop the file into your terminal window)

On first attempt (second was other human error), I did not flash a whole package with PIT file, or repartition. I did later, and that worked fine, too.

- It automatically reboots (unless you told Heimdall not to). You may go to recovery mode and see a bunch of errors about mounting, but applying Multi-CSC is a success. Reboot, and the phone starts normally. You may momentarily see the circle-and-slash no-signal icon in the upper left corner, but soon after it should show signal bars. Your homescreen may show your network somewhere.

- Check IMEI. It should be the dummy number. You can do this with the phone's number keypad (typing *#06#). I prefer to go to System Settings > About phone > Status. This way you can see the dummy IMEI, and IMEI SV should now also show a number. Go back up one level and also check Baseband; that should now show your modem.

- Restore actual IMEI. This requires that you previously backed up your /efs folder. Restoring this is documented better and more thoroughly elsewhere. I went into my /efs backup folder and copied nv_data.bin to /efs. This is easy with Root Explorer. Press the filename, select copy, navigate back up and to /efs. At the top of the screen, click Mount R/W. Delete everything in there (menu, multi-select, select all, delete). Paste the file. Long press the file, change permissions. Make it 644 (Owner is Read+Write, others are Read), save. Long press again, scroll toward bottom of menu and Change Ownership. Make it Radio (1001) and Radio (1001), save. Click to Mount R/O and exit.

- Check it. Go back and check your IMEI and it should be your real one. IMEI SV should probably change, too. (For me, it was 01 in GB, but now it's 03 in ICS). Reboot, and it should remain. Baseband is also filled in.

From here you can flash up to ICS, or whatever, and your IMEI should remain.

note on attachment: The original filename I searched for and found on Rapidshare was BML3_RESTORE.tar.md5. I've changed the extension to be *.tar, so it can upload to XDA. I think Odin users need to add the .md5 extension.

md5 checksum for BML3_RESTORE.tar: f5ab4c90ed60105c8b50e4e9b112e50b

Credit: XDA user magarto is the one whose post led me to this file and fix, from his post here.

errata: This was originally a [Q]-tagged Question thread. I overwrote the OP with this guide and changed the thread title. Hence, the next several posts may seem out of context.
Attached Files
File Type: tar BML3_RESTORE.tar - [Click for QR Code] (6.26 MB, 3258 views)
Home is where the ~ is.
The Following 5 Users Say Thank You to groksteady For This Useful Post: [ Click to Expand ]
 
xsenman
Old
#2  
xsenman's Avatar
Recognized Contributor
Thanks Meter 2,223
Posts: 3,920
Join Date: Apr 2012
Location: Philippines
Still unsolved huh? Khmers do have limited access, due to what happened in their country, anyway you can get a better idea here http://forum.gsmhosting.com/vbb/f258/ how efs problems are solved by various box. Just search this forum about efs or post, many Filipinos there .

Having said that, the version of Galaxy S I am using is Korean (has DMB TV, so hardware differences), and to solve this in our version , we simply flash the beginning ROM (with MOVI Files) Its like the Installation Files of Windows, which does a complete setup . This is the last resort for the Korean Galaxy S, solves any and every problems, always wondered why the Galaxy S, does not have this compilation or its only with samsung service centers. anyway

If you have an efs backup, you should try using Root explorer to overwrite (copy paste) the the current efs folder, fix chmod 644 and EXIT using the menu of root explorer and reboot phone to see if it sticks.
 
groksteady
Old
#3  
groksteady's Avatar
Senior Member - OP
Thanks Meter 105
Posts: 367
Join Date: Feb 2012
Location: Phnom Penh
thanks for the forum link. yeah, the phone shop nerd was stuck, too. and they did have a box, several that sounded like the octopus box you said.

i've been doing some looking, too, and wondering if it's corrupted file system. i saw several posts about corrupted internal SD, and I don't know if that could be related. my internal SD mounts fine when I boot up, and all my files are there and working. nonetheless, this post seemed interesting, about reformatting in adb with parted:

http://forum.cyanogenmod.com/topic/6...e/page__st__20

but i still have yet to find out if it's related. flashing anything in recovery, i see this:

E:failed to mount /efs /dbdata your storage not prepared yet please use UI menu for format and reboot actions

ehhh... i'd put off learning more about adb on the backburner. looks like i'm diving in.
Home is where the ~ is.
The Following User Says Thank You to groksteady For This Useful Post: [ Click to Expand ]
 
xsenman
Old
#4  
xsenman's Avatar
Recognized Contributor
Thanks Meter 2,223
Posts: 3,920
Join Date: Apr 2012
Location: Philippines
Two different issues, internal SD get corrupted when one fails to UNDO lag fix, since samsung uses rfs and lag fixing changes it to ext 4, internal SD will fail to be recognized and needs to be formated to rfs by any Rom using rfs ( mostly stock Roms (to solve that flashing a speedmod kernel, does the trick) But your problem is efs folder

and i came across one person, who had both because he had made a onenand mode lagfix and failed to undo before flashing and was pretty impossible to get over
 
groksteady
Old
#5  
groksteady's Avatar
Senior Member - OP
Thanks Meter 105
Posts: 367
Join Date: Feb 2012
Location: Phnom Penh
Quote:
Originally Posted by xsenman View Post
and i came across one person, who had both because he had made a onenand mode lagfix and failed to undo before flashing and was pretty impossible to get over
ugh ... that does not sound promising.

and i'm not even fully aware yet what lagfix is or does. it had never been an option on any kernel i used since i started flashing roms, only early this year from stock to CM7 and soon after to CM9 and other ICSes. Well, until yesterday, when i tried flashing a supercurio kernel on a GB rom, and that failed. But I did see lagfix options under recovery>advanced. at any rate, i hope i'm not in the same boat.

is there any way in adb to find out if i am?
Home is where the ~ is.
 
xsenman
Old
#6  
xsenman's Avatar
Recognized Contributor
Thanks Meter 2,223
Posts: 3,920
Join Date: Apr 2012
Location: Philippines
Quote:
Originally Posted by groksteady View Post
ugh ... that does not sound promising.

and i'm not even fully aware yet what lagfix is or does. it had never been an option on any kernel i used since i started flashing roms, only early this year from stock to CM7 and soon after to CM9 and other ICSes. Well, until yesterday, when i tried flashing a supercurio kernel on a GB rom, and that failed. But I did see lagfix options under recovery>advanced. at any rate, i hope i'm not in the same boat.

is there any way in adb to find out if i am?
what I am saying is that, you do not have this problem, cause If you had, your internal SD will become unavailable and cannot be used and cannot be formated either ...so just solve the efs problem , thats what you need to concentrate on.
The Following User Says Thank You to xsenman For This Useful Post: [ Click to Expand ]
 
groksteady
Old
#7  
groksteady's Avatar
Senior Member - OP
Thanks Meter 105
Posts: 367
Join Date: Feb 2012
Location: Phnom Penh
Quote:
Originally Posted by xsenman View Post
what I am saying is that, you do not have this problem, cause If you had, your internal SD will become unavailable and cannot be used and cannot be formated either ...so just solve the efs problem , thats what you need to concentrate on.
thanks, man. i just did try this, simply taking a Camera photo and opening it in Gallery. also, ran mount in terminal to see, and yeah, saw rfs not ext.

when i try to mount /efs, i get an error:

moutn: can't read '/etc/fstab/': no such file or directory. there's a vold.fstab in there, with paths for mounting the internal and external sdcards. ehhhh... still learning what all this is about.
Home is where the ~ is.
 
xsenman
Old
#8  
xsenman's Avatar
Recognized Contributor
Thanks Meter 2,223
Posts: 3,920
Join Date: Apr 2012
Location: Philippines
Quote:
Originally Posted by groksteady View Post
thanks, man. i just did try this, simply taking a Camera photo and opening it in Gallery. also, ran mount in terminal to see, and yeah, saw rfs not ext.

when i try to mount /efs, i get an error:

moutn: can't read '/etc/fstab/': no such file or directory. there's a vold.fstab in there, with paths for mounting the internal and external sdcards. ehhhh... still learning what all this is about.
efs folder has read only permission, so you cannot do anything you like...don't mess with vold.fstab...you will have problems with your SD cards .

The only thing I can suggest is to go back to th earliest eclair or froyo to recover.

you may need to unarchive the downloaded file and then unarchive the resulting TAR files too

Hence in heimdall you should have

PIT file (s1_odin_20100512.pit), CHECK repartition
IBL+PBL = boot.bin
SBL = Sbl.bin
MODEM = modem.bin
PARAM = param.lfs
CACHE = cache.rfs
DBDATAFS = dbdata.rfs
FACTORYFS = factoryfs.rfs
KERNEL = zImage

But First, try to delete the EFS Folder (using root explorer) shut down, Go into recovery and wipe everything than battery pull to shut down and go onto download mode after that Flash

just a suggestion
The Following User Says Thank You to xsenman For This Useful Post: [ Click to Expand ]
 
groksteady
Old
(Last edited by groksteady; 5th August 2012 at 10:34 AM.)
#9  
groksteady's Avatar
Senior Member - OP
Thanks Meter 105
Posts: 367
Join Date: Feb 2012
Location: Phnom Penh
Quote:
Originally Posted by xsenman View Post
Hence in heimdall you should have

PIT file (s1_odin_20100512.pit), CHECK repartition
thanks ... this is where I get hung up. Anytime I check repartition, I get libusb End of Pit errors. It runs fine without repartition. This is Heimdall 1.3.1 and 1.3.2 on a Mac 10.5.8.

I'm going to make an Ubuntu Live CD and see if I can get it that way. I used to have an old Lubuntu laptop, and I remember Heimdall working to flash a kernel when the Mac didn't. It'd be great if the repartitioning is what's holding me back.
Home is where the ~ is.
 
groksteady
Old
(Last edited by groksteady; 5th August 2012 at 09:06 PM.) Reason: tried the last of the last suggestions.
#10  
groksteady's Avatar
Senior Member - OP
Thanks Meter 105
Posts: 367
Join Date: Feb 2012
Location: Phnom Penh
aargh. didn't work. Heimdall on Linux does let me repartition, but on the reboot I still get errors that /efs can't be mounted, multi-CSC can't be applied, etc. I tried ezbase recovery and the full stock setup for the original provider from sammobile. I tried deleting /efs, full wiping and pulling the battery like you suggested. I tried separately flashing a dbdata.rfs in heimdall, which was suggested for someone else with mount problems. but, it seems like all the other mount problems people have are with sdcard, and not /efs.

If I restore /efs, is it supposed to write data to /dev/block/stl3? because that file is always 0kb. But I could try the dd command to restore that way... maybe later tonight. it's been a long afternoon working through this.

I also don't know what is the deal with not being able to find /etc/fstab. I saw in some other places that Android doesn't use it, so I don't know what's calling it, and why. Or if that's tied to why I can't flash anything beyond a GB rom; I get errors about /tmp/updater.sh.

EDIT: OK, so at some point with ezbase recovery and manually restoring nv_data.bin to /efs, after a little while I saw that my /sys/block/stl3 (and so /dev/block/stl3) were looking normal. I successfully restored the file, plus the IMEI folder, which has bluetooth info. I did this with flight mode on, toggled it off and connected to my network. About Phone was showing my real IMEI, plus BT and wifi MAC addresses. And I had /sys/block/stl3 looking normal. So I ran the dd if=/sys/block/stl3 of=/sdcard/efs.rfs, and used that efs.rfs file to flash full roms in heimdall, repartitioned. I used ezbase recovery and the stock firmware from sammobile.com for the original mobile provider. Neither worked. On first boot both times, I got errors about not being able to mount /efs or apply multi-CSC. My IMEI on reboot is always "unknown", not even all zeroes, until I fix it. And CWM won't flash any CM7 or CM9 zips, giving status 7 errors that it couldn't mount. I also tried flashing the efs.rfs file alone in heimdall command line, and that didn't work. Ezbase is 2.3.3 and my stock is 2.3.5, and serial number info indicates it was made in 2011 or really late 2010 (i'm loathe to pull the battery off these days), so I wouldn't think Froyo could help out. I've reached out to a few people here who had the same problem, but never posted about a fix, or finally giving up. I'm almost at my wit's end. There must be a solution, some way to reformat or push back /efs data to /stl3.

BTW, can anyone post the filenames of what is in /sys/data/stl3 for their i9000? I'd like to know if I'm missing something in there, at least when it does fill up. Right now, I'm thinking it's gotta be a bad partition.
Home is where the ~ is.

The Following 2 Users Say Thank You to groksteady For This Useful Post: [ Click to Expand ]
Tags
dev/block/stl3 imei
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes