Related
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
Same thing, the target is the INTERNAL SDCARD in sdcard/efs/, so go ahead and copy the file.
+1 just do it....
Can this not be tasked by using a root file explorer and copying efs folder as i have always done .
jje
JJEgan said:
Can this not be tasked by using a root file explorer and copying efs folder as i have always done .
jje
Click to expand...
Click to collapse
From the thread:
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.
Click to expand...
Click to collapse
And just copying the folder won't preserve permissions etc.
JJEgan said:
Can this not be tasked by using a root file explorer and copying efs folder as i have always done .
jje
Click to expand...
Click to collapse
As long as you don't copy it to /sdcard, because it's VFAT and you'll lose the permissions settings on the files. If you copy it to /data or something then that's fine.
bumpity bump
RyanZA said:
As long as you don't copy it to /sdcard, because it's VFAT and you'll lose the permissions settings on the files. If you copy it to /data or something then that's fine.
Click to expand...
Click to collapse
Thanks the SGS 1 EFs i copied was copied to external sd card and then copied off to PC . Did likewise on SGS 2 using Super Manager .
So according to what you are saying that was not going to back up if needed .
jje
JJEgan said:
Thanks the SGS 1 EFs i copied was copied to external sd card and then copied off to PC . Did likewise on SGS 2 using Super Manager .
So according to what you are saying that was not going to back up if needed .
jje
Click to expand...
Click to collapse
It would probably have worked, but it would have made your EFS files readable and writable by any app that tried - not the end of the world since it's unlikely that any apps would try, but you still might as well avoid it if you can. I don't think there are any executables in EFS or anything that this will actually break though.
Thanks i did lose IMEI at one flash on SGS1 but a second flash recovered it .
I do like full backup of original firmware and anything else before playing with phone .
jje
I've done all 3 forms of backup myself. . Clean, raw and basic
thanks for the info. have had close calls previously and having backups would have helped ease the stress
Updated first post
Vodafone Fimrware backup BUKE1
Guys,
Have got a new samsung from Vodafone UK , but the firmware kernel seems a bit different, BUKE1. Is this something now and is the above method correct to backup the entire firmware so that it might be useful for vodafone samsung users. Is there an easy guide to backup the firmware ?
Regards
VJ
Guys can someone give me a bit of advice pleeeease
I followed this guide but am a bit worried i might have messed it up, i'm comfortable with command prompt as i'm a software dev but haven't used linux commands much.
Anyway i used the ADB shell from the Android SDK tools and entered the first command to backup the efs directory to the internal sdcard....
Basic, unix permissions lost :
Code:
su
busybox cp -a /efs /sdcard/efs/
Click to expand...
Click to collapse
And i got a lot of
Code:
cp: can't preserve ownership of 'sdcard/efs/...' : Operation not permitted
messages flashing up?
However i checked to see if the backup had been made and it had? What does this mean?
Next i compressed it using...
Clean :
Code:
su
busybox tar zcvf /sdcard/efs/efs-backup.tar.gz /efs
Click to expand...
Click to collapse
Which seemed to work as i have the file in the place i expect
When i did the next step...
You can also back up the mmcblk0p1 (where /efs is stored) under /dev/block which can support greatly to recover your IMEI in case of a screw-up:
RAW :
Code:
su
cat /dev/block/mmcblk0p1 > /sdcard/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
It completed really quickly, with no messages telling me it was done but when i checked root explorer i couldn't find /dev/block/mmcblk0p1?
What has it done with it? I have dev/block/ but there is no mmcblk0p1? Although i do have /sdcard/efs_dev-block-mmcblk0p1.img. Should i have both?
From what i understand cat concatenates files and prints them to standard output, so i'm assuming the > is piping the std output to the internal sdcard?
Sorry for the questions but i thought i understood what i was doing but the last step and the "can't preserve ownership of.." messages from the first step threw me
Could someone explain this to me a little ;p
These aren't steps but rather separate methods achieving different things. Don't bother about the first one - it notes unix permissions lost , which is why you are seeing the can't preserve ownership messages. The files still backup but correct r/w permissions do not. You may as well chuck the files really, since you managed the tarball (second instruction). Just grab this and backup to external storage, in case you ever need it.
The raw backup will be under sdcard as you have found - stash this away somewhere safe too. You won't find mmcblk0p1 in root explorer as it is a partition, not a folder.
Thanks for the swift reply simion_levi
These aren't steps but rather separate methods achieving different things. Don't bother about the first one - it notes unix permissions lost , which is why you are seeing the can't preserve ownership messages. The files still backup but correct r/w permissions do not. You may as well chuck the files really, since you managed the tarball (second instruction). Just grab this and backup to external storage, in case you ever need it.
Click to expand...
Click to collapse
Do if i move the tarball to the external drive i can get rid of the sdcard/efs directory i copied to the internal card? The tarball has all the correct permissions?
The raw backup will be under sdcard as you have found - stash this away somewhere safe too. You won't find mmcblk0p1 in root explorer as it is a partition, not a folder.
Click to expand...
Click to collapse
Ok i didn't realise it was a partition, so i've just created an image of the partition that the efs folder resides on? Should i copy this to my external sd card as well?
Cheers brother
No problem! Yes, you've got it - backup the tarball and the partition image to computers, external drives etc so you can recover back to the phone in case of future catastrophe. The sdcard/efs directory can be deleted as the tarball contains exactly the same files (but with correct permissions).
Awesome, will get it done later. Out of interest how do you recover the partition image in the event of a disaster occurring?
Sent from my GT-I9100 using XDA App
One question please, since i stumbled on this one almost by luck.
Is there anything else to save before departing from stock?
Thanks.
Okay, so this guide assumes I already rooted my phone, but as a newbie I am completely in the dark about what does and what does not potentially harm the /efs. I would rather backup EVERYTHING before I flash/change anything, but from what I have read so far I need at least root to do backups.
Would it be safe to flash the Lite'ning Rom v1.1, coming from stock I9100XWKE2/I9100XENKE1/I9100XXKDJ/I9100XWKE2, and then backup mmcblk0p1?
Thanks!
Earlier today when I was having some trouble trying to get my GN booting, I went into CWM and plugged in the USB cord, and was able to ADB into the phone in recovery mode. All my files were there and I was able to push/pull what I needed.
After a full reinstall and re-root, now something has changed. When I go in by ADB in CWM recovery, all the directories appear to be empty and I can't adb pull any files out.
Any idea what changed and how to make it so I can access files again by ADB in recovery?
Just to show you what I mean, here is me doing the same ls command from the OS and from recovery:
D:\root>adb-windows shell
[email protected]:/ # cd data
cd data
[email protected]:/data # ls
ls
NVM0
NVM1
NVM13
NVM2
NVM3
NVM5
NVM6
anr
app
app-private
backup
cal.bin
dalvik-cache
data
dontpanic
drm
local
lost+found
media
misc
property
radio
resource-cache
smc
system
user
[email protected]:/data # reboot recovery
reboot recovery
D:\root>adb-windows shell
~ # cd data
cd data
/data # ls
ls
media
/data # exit
exit
D:\root>
Click to expand...
Click to collapse
Have you tried su then ls?
No difference - with ADB in recovery, su gives me:
/sbin/sh: su: not found
The sdcard directory is empty too in recovery.
And now that my phone is unbootably crashed again... I have a nandroid backup sitting on internal storage and I'm trying to find a way to yank it out with access only to bootloader and recovery.
Ok I feel silly. Had to mount everything under mounts and storage. Now I can see it all.
It turns out that because /data and /sdcard actually reside in the same place... if /data is not mounted on GN, then you can't see /sdcard either.
cmstlist said:
Ok I feel silly. Had to mount everything under mounts and storage. Now I can see it all.
It turns out that because /data and /sdcard actually reside in the same place... if /data is not mounted on GN, then you can't see /sdcard either.
Click to expand...
Click to collapse
no, /sdcard/ is just a symlink to /data/media, put there for backwards compatibility. if you 'ls /data/media/' you should be able to see all "sdcard" contents.
hey guys, do any of u have a backup of ur efs folder?
if not, would any be so good to make a backup?
unluckily i haven't backup my efs folder
EFS store your personal data such as IMEI, bluetooth MAC address, WIFI mac address
if this folder corrupted you will get your IMEI as lucky number 00000000 and also MAC address+wifi address will show wrong information
khairilyazit said:
hey guys, do any of u have a backup of ur efs folder?
if not, would any be so good to make a backup?
Click to expand...
Click to collapse
Backup, backup and backup. Few times ego I don't have backup and after flash CM 10 ROM I lost data from efs partition ... my IMEI was same 0000000. I was have to used utilites from Qualcom for repair it.
How to backup the EFS folder?
nisiomorais said:
How to backup the EFS folder?
Click to expand...
Click to collapse
Code:
su
export TARG=mmcblk0p27
dd if=/dev/block/$TARG of=/mnt/sdcard/efs-$TARG.img bs=4096
You should see 1280+0 blocks in & out.
Now you have a backup of the EFS partition in your SD Card
-- Sent from a GT-I8150 running ICS perfectly well. F'U, Sams#!t --
pepoluan said:
Code:
su
export TARG=mmcblk0p27
dd if=/dev/block/$TARG of=/mnt/sdcard/efs-$TARG.img bs=4096
You should see 1280+0 blocks in & out.
Now you have a backup of the EFS partition in your SD Card
-- Sent from a GT-I8150 running ICS perfectly well. F'U, Sams#!t --
Click to expand...
Click to collapse
i use this one cat /dev/block/mmcblk0p27 > /sdcard/EFS.img . is this the same?
my problem is, all my emei and wifi and bluetooth mac are intact. just the efs folder is not there. when i manually mount the device, it doesn't have anything in it..
how do i proceed?
hadidjapri said:
i use this one cat /dev/block/mmcblk0p27 > /sdcard/EFS.img . is this the same?
Click to expand...
Click to collapse
The problem is, some characters *might* mean something for the cat program, since cat is mostly designed for text files.
dd performs pure binary transfer, so it's more suitable for the task.
-- Sent from a GT-I8150 running ICS perfectly well. F'U, Sams#!t --
pepoluan said:
Code:
su
export TARG=mmcblk0p27
dd if=/dev/block/$TARG of=/mnt/sdcard/efs-$TARG.img bs=4096
You should see 1280+0 blocks in & out.
Now you have a backup of the EFS partition in your SD Card
-- Sent from a GT-I8150 running ICS perfectly well. F'U, Sams#!t --
Click to expand...
Click to collapse
can you explain how i can restore from the generated file?
spyblaster91 said:
can you explain how i can restore from the generated file?
Click to expand...
Click to collapse
I have the same question. So how can we restore?
Inviato dal mio GT-I8150 con Tapatalk 2
spyblaster91 said:
can you explain how i can restore from the generated file?
Click to expand...
Click to collapse
dd but the other way around.
That is, swap "of" with "if"
-- Sent from a GT-I8150 running ICS perfectly well. F'U, Sams#!t --
ummm...more noobish pls
If I am not wrong it is this
Code:
su
export TARG=mmcblk0p27
dd of=/dev/block/$TARG if=/mnt/sdcard/efs-$TARG.img bs=4096
He said to switch the If/of
Sent from my GT-I8150 using xda app-developers app
is the backed up file flashable via odin?? if not can we make it ?
ps:why i cant find the \efs on ANY file managers (tried some with root access) . i backed up with this command :su
export TARG=mmcblk0p27
dd if=/dev/block/$TARG of=/mnt/sdcard/efs-$TARG.img bs=4096
on terminal emulator and got a 5 mb .img file is this right?
eri000 said:
is the backed up file flashable via odin?? if not can we make it ?
ps:why i cant find the \efs on ANY file managers (tried some with root access) . i backed up with this command :su
export TARG=mmcblk0p27
dd if=/dev/block/$TARG of=/mnt/sdcard/efs-$TARG.img bs=4096
on terminal emulator and got a 5 mb .img file is this right?
Click to expand...
Click to collapse
1. No it's not
2. Yes, but you have to convert the file into tar.md5 format
3. It's not normally mounted by Android; you have to mount it first
4. Honestly, I forgot. Lemme check...
Edit: yes, the size of the efs partition is exactly 5MiB.
Sent from my GT-I8150 using xda app-developers app
Hello.i tryed to backup efs partition on tab p1000,and got the 2gb efs.img file.As i know now,its too big.Is it possible that image contains /efs folder in it?And if yes,how can i restore?
Отправлено с моего PantechP9070 через Tapatalk
Finn81 said:
Hello.i tryed to backup efs partition on tab p1000,and got the 2gb efs.img file.As i know now,its too big.Is it possible that image contains /efs folder in it?And if yes,how can i restore?
Отправлено с моего PantechP9070 через Tapatalk
Click to expand...
Click to collapse
You must first find out which partition is the efs partition. My method works only for the W, because the partitions of the W has been extensively mapped. For other devices, you have to find out yourself. Why don't you ask in the P1000 forum?
Sent from my GT-I8150 using xda app-developers app
,,,,
Hi all!
I would like to request a full nand backup from our device (3.68 GB uncompressed, <1 GB compressed).
The reason is to find a free sim-unlock sollution.
Mainly I need a factory unlocked (not with imei, or box!) device, but a locked one can be also good to compare the image with mine.
Required:
- GT-i8160 EUR
- ROOT permision
- terminal emulator or ADB
- 3,68 GB space on SDCARD.
- factory reset before doing (for reducing the size of the disk image and removing userdata from the image)
This backup will contain every information about your phone, inlcuding imei and sim lock and a few other things.
If you agree with that please post the dl link for the file in a private message to me, DO NOT POST IN PUBLIC!
BACKUP PROCEDURE:
1, Open terminal emulator and enter:
Code:
su
[B]For GB:[/B]
dd if=/dev/block/mmcblk0 of=/sdcard/external_sd/nand.bin
;; or if you used modified vold.fstab to swap sd with internal sd then:
dd if=/dev/block/mmcblk0 of=/sdcard/nand.bin
[B]For JB:[/B]
dd if=/dev/block/mmcblk0 of=/storage/extSdCard/nand.bin
;; or if you used modified vold.fstab to swap sd with internal sd then:
dd if=/dev/block/mmcblk0 of=/sdcard/nand.bin
Compress nand.bin with winrar or 7zip or any other compressor to reduce the size and upload somewhere you can delete after I downloaded.
I was looking around the OEM Partition with my root file explorer and found that the files on this particular partition cannot be deleted even after mounting the partition as R/W. I read some info from @Uzephi about this.
Can anyone provide an explanation as to why this occurs? Why can we mount OEM as R/W but not delete these apps? Do we know what is preventing us from modifying the OEM Partition?
Thanks for reading and for any help you can provide.