Corrupt IMEI and EFS. Samsung Galaxy S2 i9000 (for dummies)
Please do not give me any credit. I am rewriting this out as my entire family and over a dozen of my friends are using Galaxys S/1/2/notes. Its written to assist me and hopefully assist those with mid-high level of computer literacy. I do lack experience with Linux and Android.
The below is for the Galaxy S2.
0001. Symptoms: No network, no IMEI, flight mode. (settings > about phone > status). Wifi should still work to assist in rooting the device. Flashing the device with firmware will not work.
0002. Possible causes SGS2 (rooted/unrooted) loses IMEI and network connections. This can happen randomly. In my brothers (unrooted phone) case, happened when transferring file from PC to SD card. The SGS has 16gb internal, 2gig allocated to operating system and 14gb to the SD. The efs file is part of the operating system and is not visible unless you have root (admin rights). The directory is also set to read only (like certain parts of the windows environment, marked as hidden and read only).
Possible causes: efs gets unmounted or nv_data.bin & nv_data.bin.md5 become corrupted. These files are encrypted and I dont think it can be generated unless by Samsung.
The backup is essential for all Galaxy S series users. In order to do the backup, you must root the device. The irony is that it will void your warranty. USB jig on deal extreme can reset the yellow counter (Ive heard).
0003. Required: Rooted phone with Busybox (Im not sure %100 sure, but my brother rooted and installed busybox to try and resolve by other means gave up after 6hrs). Windows (Ive had Win7 64bit at the time) SDK with ADB shell (allows PC to talk Android device via the development option on the phone). USB cable with SGS2 drivers. 7 Zip (extraction program that can handle tar.gz file).
0004. 2 Methods: Unmount and mount efs Extract and alter backup files from the efs directory.
1001. Installing SDK (reference http://www.addictivetips.com/mobile/what-is-adb-and-how-to-install-it-android/) Download from: http://dl.google.com/android/installer_r18-windows.exe My installation was default (click next all the way) with the installed directory C:\Program Files (x86)\Android\android- sdk. When you first run SDK manager it will have missing packages. Technically you only need platform tools. Check it and click on install packages. It should then look like below: 2 | P a g e
1002. Setting up the Path Variable for the SDK This will enable the ADB to start from anywhere in the dos command prompt. The dos command prompt is click start > run > type cmd.
3 | P a g e
To setup the path, click start > control panel > system > Advanced system settings
Click Environment Variables 4 | P a g e
Double click Path
Add to the end of the string exactly below (including semi colon): ;C:\Program Files (x86)\Android\android-sdk\tools;C:\Program Files (x86)\Android\android-sdk\platform-tools Make sure you do NOT REPLACE the string. If you do, some programs may not run from the command line correctly. This will now enable you to recall ADB from command line from any directory. To test, click start > run > cmd At the dos prompt type adb and a list of functions should run down the screen. 5 | P a g e
2001. Installing USB drivers. With the SGS2, just plug the phone and wait for all necessary drivers to be installed. Win7 detected them automatically. On the SGS2 goto settings > application > development and check USB debbugging. To test if the device is working, type adb devices. It should show a connection.
3001. Installing 7 zip (open source) http://downloads.sourceforge.net/sevenzip/7z920-x64.msi (64bit) http://downloads.sourceforge.net/sevenzip/7z920.exe (32bit) Just default the install (next all the way).
4001. Method 1. Unmounting and mounting the efs directory (reference and credits to dickie2007 http://forum.xda- developers.com/showthread.php?t=1261948&highlight=efs+restore) It is possible that the files are still intact but the efs is not mounted or the partition is no longer there This method involves extracting out the efs and putting backing in. This will give you the opportunity to backup and view the efs files. 6 | P a g e
Unfortunately I did not take any screen shots during the process as I doubted it would work.
4002. Run adb shell Check that your phone is in debugging mode (settings > applications > development > tick first box). Click start > run > cmd to start command prompt. On the command line type adb devices to see if its connected. Type adb shell
4003. Extracting EFS to SDCARD. Type su And the prompt will change to #. Type busybox tar zcvf /sdcard/efs/efs-backup.tar.gz /efs This will zip up the efs to the sdcard/efs directory. Disconnect usb and development mode and access phone via windows to copy the zip file to safe place like Dropbox. Name it as an original copy and do NOT tamper with it. Navigate to sdcard/efs. You can now use 7 zip to view the zip file and check if you have the following files .nv_data.bak, nv_data.bin, .nv_data.bak.md5, nv_data.bin.md5 The ones with a dot at the beginning and contains the words bak are the back up files. These are dated way back. The back up files I worked with was dated 01 Jan 2010. 7 | P a g e
For now, we are just viewing the zip file to see if everything is intact. The efs zipped file should like this inside:
4004. Mounting the efs to the SGS2 Connect phone via the usb debbugging mode. Start adb shell Type the following (thanks dickie): su umount /efs mke2fs /dev/block/mmcblk0p1 mount -w -t ext4 /dev/block/mmcblk0p1 /efs busybox tar zxvf /sdcard/efs/efs-backup.tar.gz -C / reboot
The above basically does: Su = # in the prompt This will unmount the efs. Creates the new partition. 8 | P a g e
Then mounts the partition Unzips the backup from the SDCARD operating system partition reboots the phone.
Once phone has rebooted, you can check the IMEI by using the dialer *#06#. You can then remove battery to confirm they are matching. You will see why in the next method. If its all good, you wont need to read on..
5001. Method 2. Replacing the bin files in efs directory. (Reference and credits to dickie2007 http://forum.xda- developers.com/showthread.php?t=1261948&highlight=efs+restore) I was fortunate that the efs I extracted had the 2 critical files bak files .nv_data.bak, .nv_data.bak.md5. This method (http://forum.xda-developers.com/showthread.php?t=1261948&highlight=efs+restore) requires you to delete the nv_data.bin and nv_data.bin.md5 and replace them with the bak files. We are going to repeat the above steps except that we are going to modify the files.
5002. Run adb shell Check that your phone is in debugging mode (settings > applications > development > tick first box). Click start > run > cmd to start command prompt. On the command line type adb devices to see if its connected. Type adb shell
5003. Extracting EFS to SDCARD. Type su 9 | P a g e
And the prompt will change to #. Type busybox tar zcvf /sdcard/efs/efs-backup.tar.gz /efs This will zip up the efs to the sdcard/efs directory. Disconnect usb and development mode and access phone via windows to copy the zip file to safe place like Dropbox. Name it as an original copy and do NOT tamper with it. Navigate to sdcard/efs. You can now use 7 zip to view the zip file and check if you have the following files .nv_data.bak, nv_data.bin, .nv_data.bak.md5, nv_data.bin.md5 The ones with a dot at the beginning and contains the words bak are the back up files. These are dated way back. The back up files I worked with was dated 01 Jan 2010. For now, we are just viewing the zip file to see if everything is intact. The efs zipped file should like this inside:
Using 7 zip, you directly change the files inside the zip file. Remove/delete nv_data.bin and nv_data.bin.md5. Rename .nv_data.bak > nv_data.bin .nv_data.bak.md5 > nv_data.bin.md5 Close the zip and it will ask save. 10 | P a g e
5004. Mounting the efs to the SGS2 Connect phone via the usb debbugging mode. Start adb shell Type the following (thanks dickie): su umount /efs mke2fs /dev/block/mmcblk0p1 mount -w -t ext4 /dev/block/mmcblk0p1 /efs busybox tar zxvf /sdcard/efs/efs-backup.tar.gz -C / reboot
The above basically does: Su = # in the prompt This will unmount the efs. Creates the new partition. Then mounts the partition Unzips the backup from the SDCARD to operating system partition reboots the phone.
Once phone has rebooted, you can check the IMEI by using the dialer *#06#. You can then remove battery to confirm they are matching. I followed dickies method and ended up with a generic IMEI 004999010640000. The phone should now work. Problem will be the IMEI not matching. Googling this, some have stated that the phone may not connect with network or not download properly from the play store (please confirm). It is also illegal changing IMEIs. What I did here was I went back to the original Dropbox backup efs extraction and copied out the files nv_data.bin and nv_data.bin.md5 that I had thought was corrupted at the time and placed them back in the efs-backup.tar.gz via 7zip on the sdcard. I then pumped it back it up using the same commands: su umount /efs mke2fs /dev/block/mmcblk0p1 mount -w -t ext4 /dev/block/mmcblk0p1 /efs busybox tar zxvf /sdcard/efs/efs-backup.tar.gz -C / reboot
11 | P a g e
I hope this helps. And apologies for not writing an XP version.