[GUIDE] If your EFS is corrupt - AT&T, Rogers, Bell, Telus Samsung Galaxy S III

When I first got SGS3 I made efs backup as suggested by xda. I didn't backup it as a folder, only as a dd block copy.
So if you are good today - make block copy of EFS and tar copy using adb:
adb shell
su
dd if=/dev/block/mmcblk0p11 of=/sdcard/efs.sbn
cd /sdcard
tar cvf efs.tar /efs
Also there is a way of saving NVRam into recovery. Do it now if you haven't yet:
adb reboot nvbackup
Then if you still don't feel safe download QPST tools from IMEI thread and backup your NVRam to PC.
My earpiece died and I got a replacement SGS3.
Something (CWM6?) caused IMEI corruption. I didn't know that, so I tried reflashing modems and ROMs. I was trying everything to restore my connectivity. It somehow didn't help that there are seversal guides on how to do IMEI restore.
While I was waiting for another tool download I decided to restore efs from my previous SGS3 on to current SGS3 (I was at my wits end). And I didn't backup current EFS - my huge mistake! But I already almost give up on the phone at that point.
QPST+Peoplearmy tool was able to restore my IMEI. But EFS is now corrupt (why? I cannot even mount it!). And I can only use one modem - the one I used when backing up EFS (UCALG1 modem).
On the good side - after formatting EFS and making it clean, I can run CM10.1 without any issues. My serial number is 000000, but who cares.
Here's how to format EFS:
1. Reboot into recovery (CWM 5.8.0.5 touch is my preferred)
2. You should be able to see phone connected to PC in adb (recovery mode)
3. Issue following commands:
adb shell
mke2fs -T ext4 /dev/block/mmcblk0p11
mkdir /efs
mount -w -t ext4 /dev/block/mmcblk0p11 /efs
Lesson learned - try not to mess with EFS at all. Do IMEI restore using QPST and Peoplearmy. I'll keep you posted on EFS restore efforts.

Assuming I made a block copy of my EFS partition using "dd if=/dev/block/mmcblk0p11 of=/sdcard/efs.sbn".
How would I restore it should I corrupt my EFS?
Like this?
dd if=/sdcard/efs.sbn of=/dev/block/mmcblk0p11

HiKsFiles said:
Assuming I made a block copy of my EFS partition using "dd if=/dev/block/mmcblk0p11 of=/sdcard/efs.sbn".
How would I restore it should I corrupt my EFS?
Like this?
dd if=/sdcard/efs.sbn of=/dev/block/mmcblk0p11
Click to expand...
Click to collapse
Correct.
Sent from my SAMSUNG-SGH-I747 using xda premium
---------- Post added at 03:19 PM ---------- Previous post was at 03:15 PM ----------
Or you can do the backup in one nice command:
dd if=/dev/block/mmcblk0p11 | gzip -9 > /sdcard/efs.gz
And to restore:
gunzip /sdcard/efs.gz - | dd of=/dev/block/mmcblk0p11
Oh, and you don't need to reformat the partition before restoring, that happens during the restore, because every bit gets overwritten.
Sent from my SAMSUNG-SGH-I747 using xda premium

bravomail said:
...make block copy of EFS and tar copy using adb:
adb shell
su
dd if=/dev/block/mmcblk0p11 of=/sdcard/efs.sbn
cd /sdcard
tar cvf efs.tar /efs
Click to expand...
Click to collapse
The TAR command failed for me on my i747, TAR not found.
d3athsd00r said:
Or you can do the backup in one nice command:
dd if=/dev/block/mmcblk0p11 | gzip -9 > /sdcard/efs.gz
Click to expand...
Click to collapse
This worked like a charm for me, thanks.

Related

[HOWTO] Backup your EFS partition

As with newer Samsung Android phones it is practically essential that if you go to the modding scene and start uploading custom roms you should have a backup of your efs
For simple backup of efs partition
by sishgupta
Code:
adb shell
su
dd if=/dev/block/platform/omap/omap_hsmmc.0/by-name/efs of=/sdcard/efs.img
and for a full image of your brand new phone
as various users have stated there are other more correct ways of backing up your new efs partition,
the one i liked the most is this one by because it backs up all your partitions
by c0ns0le
Code:
IF YOU HAVE BUSY BOX INSTALLED
adb shell
su -
for i in $(ls /dev/block/platform/omap/omap_hsmmc.0/by-name/ | grep -v user)
do
dd if=/dev/block/platform/omap/omap_hsmmc.0/by-name/${i} of=/sdcard/${i}.img &
done
NO BUSYBOX:
adb shell
su -
for i in boot cache dgs efs metadata misc param radio recovery sbl system xloader
do
dd if=/dev/block/platform/omap/omap_hsmmc.0/by-name/${i} of=/sdcard/${i}.img &
done
deprecated just staying here because this started all the correct backup commands for your efs
In order to do this for your galaxy nexus you should have adb working on your machine and also debugging enabled in your phone
this is practically easy, your phone must be rooted, or at least booted with the boot.img of this thread How to Root GALAXY NEXUS
Code:
adb root
adb remount
adb pull /factory
and now backup that file to at least 2 places lol
I always get paranoid with this
have fun installing custom roms
i don't think that works for GN
Samsung changed their EFS recently on the new released phones
it's no longer how it was with the Galaxy S line of phones
No one know if we really can backup and restore /factory (EFS)?
this should put an .img file in /sdcard. It's the same method as the one in the sgs2 section but with different paths.
Code:
adb shell
su
cat /dev/block/platform/omap/omap_hsmmc.0/by-name/efs > /sdcard/efs.img
edit: you'll need to be root, obviously
edit again:
this is technically better but does the same thing:
Code:
adb shell
su
dd if=/dev/block/platform/omap/omap_hsmmc.0/by-name/efs of=/sdcard/efs.img
Out of curiosity, what is efs?
I am pretty familiar with flashing my HTC Desire, but there is not an efs partition (AFAIK)?
Cheers!
It backs up your imei information in case it gets corrupted by flashing custom roms and mods
Sent from my GT-I9000 using xda premium
420SYN said:
It backs up your imei information in case it gets corrupted by flashing custom roms and mods
Sent from my GT-I9000 using xda premium
Click to expand...
Click to collapse
Cool thanks!
Stew
Is this something specific to Samsung phones? I have been rooting and flashing since the nexus one and have never needed this.
Doesn't clockwork mod back this up? If not, why not?
Sent from my LG-P999
dave_t321 said:
Code:
adb shell
su
dd if=/dev/block/platform/omap/omap_hsmmc.0/by-name/efs of=/sdcard/efs.img
Click to expand...
Click to collapse
Would it be if=/dev/block/platform/omap/omap_hsmmc.0/by-name/factory since this partition is named "factory" now?
If the efs is really in the /factory folder and its not hardlinked files sitting somewhere else is there a better way to save the files and keeping the permissions?
Using tar or gzip on them before?
So which method to follow in order to backup my efs folder?All information is under /factory
use
Code:
adb shell
su
dd if=/dev/block/platform/omap/omap_hsmmc.0/by-name/efs of=/sdcard/efs.img
this is the right command as if you run ls on the by-name folder you can see that it is still efs not factory
factory must be a link to this
omg, i have a 0049... IMEI after flashing ICL53F via fastboot!
how could i restore my old IMEI?
edit: jippie, i got my IMEI back after flashing the ITL41F odin version from this post!
i suggest everyone to backup the efs before flashing other firmwares!
Could someone provide the correct commands to restore the efs folder please Ive backed it up just need to know how to restore it if something bad happens
There is a guide for it on these forums. Google 'efs restore android' and you should find it.
There is also an efs restore application that will use img files (like how we made in this guide) instead of just the nv_data.bin
Sent from my Galaxy Nexus using XDA App
does it actually work with this phone?
fun w/ shellfoo
Code:
IF YOU HAVE BUSY BOX INSTALLED
adb shell
su -
for i in $(ls /dev/block/platform/omap/omap_hsmmc.0/by-name/ | grep -v user)
do
dd if=/dev/block/platform/omap/omap_hsmmc.0/by-name/${i} of=/sdcard/${i}.img &
done
NO BUSYBOX:
adb shell
su -
for i in boot cache dgs efs metadata misc param radio recovery sbl system xloader
do
dd if=/dev/block/platform/omap/omap_hsmmc.0/by-name/${i} of=/sdcard/${i}.img &
done
---------- Post added at 03:43 PM ---------- Previous post was at 03:15 PM ----------
[/COLOR]
dave_t321 said:
this should put an .img file in /sdcard. It's the same method as the one in the sgs2 section but with different paths.
Code:
adb shell
su
cat /dev/block/platform/omap/omap_hsmmc.0/by-name/efs > /sdcard/efs.img
edit: you'll need to be root, obviously
edit again:
this is technically better but does the same thing:
Code:
adb shell
su
dd if=/dev/block/platform/omap/omap_hsmmc.0/by-name/efs of=/sdcard/efs.img
Click to expand...
Click to collapse
i've foud this one..wich is better?
adb shell
su
busybox dd if=/dev/block/platform/omap/omap_hsmmc.0/by-name/efs of=/data/media/my_efs_backup.img
They are the same with different output locations. The one that leads with busy box is for a configuration where the commands are not aliased for a busy box setup.
Sent from my Galaxy Nexus using XDA App
Similar thing happened to me. I got a 2nd nexus, decided to restore a nandroid from my 1st nexus onto the 2nd one. Restore went fine, it was like a clone of the 1st phone except the IMEI was corrupt with a generic 0049... one. I flashed the phone back to a google factory ITL41D and the IMEI was restored. Needless to say I won't be doing that again!
paratox said:
omg, i have a 0049... IMEI after flashing ICL53F via fastboot!
how could i restore my old IMEI?
edit: jippie, i got my IMEI back after flashing the ITL41F odin version from this post!
i suggest everyone to backup the efs before flashing other firmwares!
Click to expand...
Click to collapse

[Request] How to flash system.img through ADB in CWM

I would like to try flashing the stock bell rom back on my phone but I never backed it up initially.
I've been having Bluetooth music issues with both kernelpanics and ho!no!s roms so I have to get stock to test if its the phone or just the roms while its still in warranty.
Thanks guys!!
Sent from my LG-P930 using XDA
EDIT:
Found stock system.img
What are the ADB commands to flash the file to my phone?
Bump for new topic. Found System.img of stock bell canada rom
adb shell
su
dd if=/sdcard/boot.img of=/dev/block/mmcblk0p8
dd if=/sdcard/recovery.img of=/dev/block/mmcblk0p13
dd if=/sdcard/firmware.img of=/dev/block/mmcblk0p1
dd if=/sdcard/system.img of=/dev/block/mmcblk0p27
dd if=/sdcard/baseband.img of=/dev/block/mmcblk0p14
Epyoch said:
adb shell
su
dd if=/sdcard/boot.img of=/dev/block/mmcblk0p8
dd if=/sdcard/recovery.img of=/dev/block/mmcblk0p13
dd if=/sdcard/firmware.img of=/dev/block/mmcblk0p1
dd if=/sdcard/system.img of=/dev/block/mmcblk0p27
dd if=/sdcard/baseband.img of=/dev/block/mmcblk0p14
Click to expand...
Click to collapse
when I type SU in, it says /sbin/sh: su: not found
and if i try dd if=/sdcard/system.img of=/dev/block/mmcblk0p27
it gives me dd: can't open '/sdcard/system.img': No such file or directory
Okay, first, in CWM, you don't need to su for root permissions, your ADB shell has them. Second, if you haven't copied your file to the root level of your sdcard and if your file isn't named "system.img" exactly, that command will fail. I'll leave it to you to figure out how to move/rename your system.img file accordingly lol
Edit, it just occurred to me you might be having the garbled sdcard problem where it will spit out garbage if you type in the "ls" command in ADB. The solution has been posted by kernelpan1c, but first let us know what the output of ls is if you're sure your system.img is in the root level of your sdcard.
Malnilion said:
Okay, first, in CWM, you don't need to su for root permissions, your ADB shell has them. Second, if you haven't copied your file to the root level of your sdcard and if your file isn't named "system.img" exactly, that command will fail. I'll leave it to you to figure out how to move/rename your system.img file accordingly lol
Edit, it just occurred to me you might be having the garbled sdcard problem where it will spit out garbage if you type in the "ls" command in ADB. The solution has been posted by kernelpan1c, but first let us know what the output of ls is if you're sure your system.img is in the root level of your sdcard.
Click to expand...
Click to collapse
I already used ADB to push system.img to my phone's SDCard root directory.
Are you suggesting that I reformat my SDCard through windows?
I just realized that I am lacking the boot.img of the stock bell ROM. system and boot are the two that are absolutely necessary to get the phone working correct?
Which rom are you coming from? If it's a Nitro rom/kernelpan1c's rom, you shouldn't have to flash boot.img.
Yeah, according to kernelpan1c, there is something weird going on with the way our sdcard is formatted. After formatting it in Windows he says it should work just fine in the CWM flashed by Rom Manager (I haven't tested it myself, but I'm sure he's correct). I really want to know what is making the Rom Manager CWM unable to read it where bytecode64's CWM can read it just fine...
Malnilion said:
Which rom are you coming from? If it's a Nitro rom/kernelpan1c's rom, you shouldn't have to flash boot.img.
Yeah, according to kernelpan1c, there is something weird going on with the way our sdcard is formatted. After formatting it in Windows he says it should work just fine in the CWM flashed by Rom Manager (I haven't tested it myself, but I'm sure he's correct). I really want to know what is making the Rom Manager CWM unable to read it where bytecode64's CWM can read it just fine...
Click to expand...
Click to collapse
I think I'll be using HO!NO!'s rom as a base for the boot.img, since he has a bell optimus LTE, not the AT&T phone. I'm assuming that he hasn't made any changes to the boot partition, since no custom kernel development has occurred for this phone yet.
I found a so called legit CWM backup of the BELL rom, in one of the lu6200 threads, http://forum.xda-developers.com/showthread.php?t=1472501
but recovering the backup only hangs on the LG logo. I did a "advanced restore" and restored only the system and boot files but that didn't get past the logo either...
It booted after an advanced restore with the "stock" system(from that thread) and the boot (from HONO's), but the WIFI wouldn't start, it said error.
Where did you get your stock bell system.img? and can you provide it?
hereric said:
when I type SU in, it says /sbin/sh: su: not found
and if i try dd if=/sdcard/system.img of=/dev/block/mmcblk0p27
it gives me dd: can't open '/sdcard/system.img': No such file or directory
Click to expand...
Click to collapse
Mount sdcard in recovery.
After you enter adb shell
"mount /sdcard" (without quotations)
Then use the command "dd if=/sdcard/system.img of=/dev/block/mmcblk0p27"

How to backup EFS

@echo Backup EFS
@pause
@echo --- STARTING ----
@echo --- WAITING FOR DEVICE
@files1\adb wait-for-device
@echo --- Backup efs image ---
@files1\adb shell su -c "dd if=/dev/block/mmcblk0p3 of=/sdcard/efs.img bs=4096"
@files1\adb pull /sdcard/efs.img
@pause
I find code from other board, couldnt use on my phone, is there anyone could check which part is wrong?how to back my EFS ?
THX
Sent from my LG-F180K using xda premium
There is no EFS partition on our phone, the "efs" partition you are trying to backup mmcblk0p3 is sbl partition.
There are at least four guys phone got the same issue as mine, flashed wrong KDZ caused no signal, and cant regist on the carrier, when they flashed the right KDZ, but cant help, we are trying to check it out.
but, if there no EFS, where it storage the IMEI?
Sent from my LG-F180K using xda premium

[Guide][Fix] Motorola Defy Mini XT320/XT321 Burnt NAND

Hello Defy Mini Users, I'm going to write a tutorial on how to fix a burnt NAND.
My overclock became unstable and I had bad blocks everywhere so I decided to recover my NAND. @cute_prince method fixed by phone.
@MauroSZ @Bernd.Defy @wilberfish @conrad0
Thanks to cute_prince tutorial for HTC Explorer NAND recovery. I have just adapted to Defy Mini XT320/XT321.
Now in cmd type in these commands:
Code:
adb reboot bootloader
Code:
fastboot boot twrp.img
Code:
adb shell mount -a
Code:
adb push flash_erase /system/xbin
Code:
adb shell cd /system/xbin
Code:
adb shell chmod 755 flash_erase
Code:
adb shell ./flash_erase -N /dev/mtd/mtd9 0 0
Code:
adb shell ./flash_erase -N /dev/mtd/mtd11 0 0
Code:
adb shell ./flash_erase -N /dev/mtd/mtd12 0 0
Code:
adb reboot bootloader
Code:
fastboot erase userdata
Code:
fastboot erase cache
Code:
fastboot erase system
Now flash back your SBF via RSD-Lite.
on this step "adb shell chmod 755 flash_erase"
I get chmod: flash_erase: no such file or directory.
What am i missing?
@rootdefyxt320, Theoretical question:
Any idea what happens recovering nandroid instead flashing a SBF via RSD Lite ?
MauroSZ said:
@rootdefyxt320, Theoretical question:
Any idea what happens recovering nandroid instead flashing a SBF via RSD Lite ?
Click to expand...
Click to collapse
You restore a nandroid backup that has a corrupted NAND, which is what you don't want. Flashing an SBF doesn't give a corrupted NAND as it is fresh. But you must flash_erase before you flash an SBF otherwise you will still have a burnt NAND.
wilberfish said:
on this step "adb shell chmod 755 flash_erase"
I get chmod: flash_erase: no such file or directory.
What am i missing?
Click to expand...
Click to collapse
Did you push flash_erase to /system/xbin? This fixes the missing file issue. Otherwise you can mount /system manually in TWRP.
Yes, fixed it. Silly mistake.
Thanks it works brilliantly.
wilberfish said:
Yes, fixed it. Silly mistake.
Thanks it works brilliantly.
Click to expand...
Click to collapse
So your NAND is fixed now?
rootdefyxt320 said:
So your NAND is fixed now?
Click to expand...
Click to collapse
Is correct supposing the android automatically avoids bad blocks using others normal blocks instead ? Is journaling correlated ? If true, does make sense flash a sbf first and restore a nandroid just after getting fastboot ? Or do you recommend anorher backup way like titanium ? Or maybe a mixed way using a old nandroid made when the nand was not burnt and Titanium just after to make the device state more recent ?
Is there a easy and quick test to know if the nand is burnt ?
Sent by Smartphone Using Tapatalk 2
rootdefyxt320 said:
So your NAND is fixed now?
Click to expand...
Click to collapse
Yes seems so. Didn't have time to check but after clean install and updates back to 73mb free
Sent from my HTC Desire C using xda app-developers app
---------- Post added at 09:24 PM ---------- Previous post was at 09:17 PM ----------
Originally Posted by rootdefyxt320
So your NAND is fixed now?
Click to expand...
Click to collapse
Is correct supposing the android automatically avoids bad blocks using others normal blocks instead ? Is journaling correlated ? If true, does make sense flash a sbf first and restore a nandroid just after getting fastboot ? Or do you recommend anorher backup way like titanium ? Or maybe a mixed way using a old nandroid made when the nand was not burnt and Titanium just after to make the device state more recent ?
Is there a easy and quick test to know if the nand is burnt ?
Sent by Smartphone Using Tapatalk 2
Click to expand...
Click to collapse
adb shell dmesg will give you a report, scroll down and you will see if you have bad blocks.
Yes it avoids bad blocks automatically. As for backup I have no idea, sorry.
MauroSZ said:
Is correct supposing the android automatically avoids bad blocks using others normal blocks instead ? Is journaling correlated ? If true, does make sense flash a sbf first and restore a nandroid just after getting fastboot ? Or do you recommend anorher backup way like titanium ? Or maybe a mixed way using a old nandroid made when the nand was not burnt and Titanium just after to make the device state more recent ?
Is there a easy and quick test to know if the nand is burnt ?
Sent by Smartphone Using Tapatalk 2
Click to expand...
Click to collapse
The problem with nandroid backups is when you back it up. I backup my phone before overclocking so I can restore my NANDROID backup. You can restore your nandroid if you backup before overclocking. Don't restore your NANDROID if you backed it up after overclocking. Basically YAFFS2 filesystem uses 'blocks' to store the data. It won't write to the 'bad blocks' so you lose storage. Basically a YAFFS2 NANDROID backup also backups the bad blocks which is what you don't want. You can read more about YAFFS Filesystem here: http://en.wikipedia.org/wiki/YAFFS
@rootdefyxt320 thanks for the link, but if i backup just after a minute i overclocked, i am supposed it will not sufficient time to burn the nand, right ? And i can avoid all a process to overclock again if i have to recovery my nand.
It seems the CWM backup creates a continuous nand image containing good and bad blocks. The android skips bad blocks writing data. Then i'm supposed backup apps as Titanium do a good job in this case because (i am also supposed) they don't work with image.
Sent by Smartphone Using Tapatalk 2
MauroSZ said:
@rootdefyxt320 thanks for the link, but if i backup just after a minute i overclocked, i am supposed it will not sufficient time to burn the nand, right ? And i can avoid all a process to overclock again if i have to recovery my nand.
It seems the CWM backup creates a continuous nand image containing good and bad blocks. The android skips bad blocks writing data. Then i'm supposed backup apps as Titanium do a good job in this case because (i am also supposed) they don't work with image.
Sent by Smartphone Using Tapatalk 2
Click to expand...
Click to collapse
Yeah, it won't have that much effect. The effect happens after a couple of weeks of overclocking.
After adb push flash_erase /system/xbin the commands should use full path, mine didn't work with CD.
Also shell commands didn't work first time, maybe because touched some buttons on TWRP screen.
Code:
Code:
adb reboot bootloader
fastboot boot twrp.img
adb shell mount -a
adb push flash_erase /system/xbin
adb shell cd /system/xbin
adb shell chmod 755 /system/xbin/flash_erase
adb shell /system/xbin/flash_erase -N /dev/mtd/mtd9 0 0
adb shell /system/xbin/flash_erase -N /dev/mtd/mtd11 0 0
adb shell /system/xbin/flash_erase -N /dev/mtd/mtd12 0 0
adb reboot bootloader
fastboot erase userdata
fastboot erase cache
fastboot erase system

Is there anyway to delete files on "bootdevice" file with TWRP Terminal?

So today I was trying to backup my EFS/IMEI and found that I could do so using the TWRP Terminal commands:
dd if=/dev/block/bootdevice/by-name/modemst1 of=/sdcard/modemst1.emmc.win
dd if=/dev/block/bootdevice/by-name/modemst2 of=/sdcard/modemst2.emmc.win
Click to expand...
Click to collapse
However I typed it wrong, doing this:
dd if=/dev/block/bootdevice/by-name/modemst1 of=/dev/block/bootdevice/by-name/modemst1emmc.win
dd if=/dev/block/bootdevice/by-name/modemst2 of=/dev/block/bootdevice/by-name/modemst2.emmc.win
Click to expand...
Click to collapse
This resulted in having the backups inside the bootdevice file, is there any way I can delete these files with a TWRP terminal command?

Categories

Resources