[SOLVED][Guide] How to backup EFS + Modemfs folders

Search This thread

YMatrix

Senior Member
Thats wrong, to backup using cp use something like cp [original efs] [sdcard/backup folder]

I guess it's better to use dd command for this purpose:

dd if=/dev/block/mmcblk0p7 of=/sdcard/efs_backup.img

dd if=/dev/block/mmcblk0p2 of=/sdcard/modemfs_backup.img

To restore just switch if with of (input file / output file)

Sent from my GT-I9070 using xda app-developers app

Thanks frapeti!
Back to a question I asked in this thread, what exactly is the difference between CP and DD commands? And why is DD better for this procedure while you can just copy paste the folders?

Sent from my GT-I9070 using Tapatalk 4 Beta
 

frapeti

Inactive Recognized Developer
Mar 23, 2012
1,048
4,224
Cordoba, Argentina
www.groupon.com.ar
Thanks frapeti!
Back to a question I asked in this thread, what exactly is the difference between CP and DD commands? And why is DD better for this procedure while you can just copy paste the folders?

Sent from my GT-I9070 using Tapatalk 4 Beta

dd dump the whole partition, while cp copy separated files / folders

Sent from my GT-I9070 using xda app-developers app
 

BOOTMGR

Senior Member
Aug 3, 2010
728
3,395
anoobdevsdiary.blogspot.in
Thats wrong, to backup using cp use something like cp [original efs] [sdcard/backup folder]

I guess it's better to use dd command for this purpose:

dd if=/dev/block/mmcblk0p7 of=/sdcard/efs_backup.img

dd if=/dev/block/mmcblk0p2 of=/sdcard/modemfs_backup.img

To restore just switch if with of (input file / output file)

Sent from my GT-I9070 using xda app-developers app
Not telling you're wrong, just informing. every partition from /dev/block/* can be treated as file.dd deals with block devices while cp works with files.so cp can be used for backing up partition (we have been doing this for ages for my previous device to backup and restore baseband) though dd will convert and copy it to target directory so looks more organized.
 
  • Like
Reactions: fredrickaein

fredrickaein

Member
Jun 3, 2013
12
7
Pune
Size of efs & modemfs in root folder.

Hi,

I was trying to take backup of these folders, but before that, i thought of having a look at the actual folder in the root for their sizes.

efs = 87 files, 12 folder. total six=ze is 4.84Kb
modemfs = This folder is empty.

Now please tell is if these are normal sizes. If it is normal then how come their backup is 10 & 16 Mb respectively.

Phone - Samsung S Advance 9070
ROM - Pure Vanila V5
Kernel CoCore E6.8

Regards,
Fred


in the terminal type:
Code:
su
cp /dev/block/mmcblk0p7 /sdcard/efs_backup
cp /dev/block/mmcblk0p2 /sdcard/modemfs_backup

check that efs_backup is 10MB and modemfs_backup is 16MB.And this is for JB.I don't know about GB but most probably they'll be same...
 

YMatrix

Senior Member
Hi,

I was trying to take backup of these folders, but before that, i thought of having a look at the actual folder in the root for their sizes.

efs = 87 files, 12 folder. total six=ze is 4.84Kb
modemfs = This folder is empty.

Now please tell is if these are normal sizes. If it is normal then how come their backup is 10 & 16 Mb respectively.
Regards,
Fred

I am surprised that your modemfs folder is empty :eek:
As for the folder size vs. backup size, this is because that these folders are actually partitions on the phone. when backing up using DD / CP commands you are backing up the whole partition (even the "empty" bits of data), which is why you get the according sizes (these are the partition's sizes).
 

fredrickaein

Member
Jun 3, 2013
12
7
Pune
modemfs folder size.

Hi,

Thanks for the reply

I checked the modemfs folder again using ES Explorer, i still find it 0 bytes and its working fine. I think we both are using the same ROM.
Prior to flashing this ROM i was using the HarshJelly ROM based on JB DDULP8 with stock Kernel. My device baseband is I9070DDULP8, is this the reason for this discrepancy.

Can i please know what is the size of the actual modemfs on your phone.

Regards,
Fred.


I am surprised that your modemfs folder is empty :eek:
As for the folder size vs. backup size, this is because that these folders are actually partitions on the phone. when backing up using DD / CP commands you are backing up the whole partition (even the "empty" bits of data), which is why you get the according sizes (these are the partition's sizes).
 

arffrhn

Senior Member
Mar 12, 2013
1,583
763
Kuala Lumpur
I am surprised that your modemfs folder is empty :eek:
As for the folder size vs. backup size, this is because that these folders are actually partitions on the phone. when backing up using DD / CP commands you are backing up the whole partition (even the "empty" bits of data), which is why you get the according sizes (these are the partition's sizes).

I copied the entire folders efs and modemfs and got only 8kb and 16kb respectively. You sure need 10 n 16mb?

Sent from my GT-I9070 using xda app-developers app
 
  • Like
Reactions: fredrickaein

YMatrix

Senior Member
Hi,

Thanks for the reply

I checked the modemfs folder again using ES Explorer, i still find it 0 bytes and its working fine. I think we both are using the same ROM.
Prior to flashing this ROM i was using the HarshJelly ROM based on JB DDULP8 with stock Kernel. My device baseband is I9070DDULP8, is this the reason for this discrepancy.

Can i please know what is the size of the actual modemfs on your phone.

Regards,
Fred.

I don't know why the discrepancy exists, my EFS folder is 8.76 KB, and MODEMFS folder is 10.63 KB.
Maybe @frapeti can shed light on this.

I copied the entire folders efs and modemfs and got only 8kb and 16kb respectively. You sure need 10 n 16mb?

Sent from my GT-I9070 using xda app-developers app

Read the post you quoted:

when backing up using DD / CP commands you are backing up the whole partition (even the "empty" bits of data), which is why you get the according sizes (these are the partition's sizes).
 
  • Like
Reactions: fredrickaein

YMatrix

Senior Member
Yeah that's why I asked. Wondering if I do anything wrong and it won't work when restoring.

Copying the folders in theory should also work, its just safer to back them up using the DD command since you get the original structure, permissions, dates etc. of the partitions.
Thus when restoring its as if you never tampered with them, while the "copy folder" method doesn't give you the original data structure.
Again, it shouldn't make a difference (in theory), but we always like to be closest to the original ;)
 

arffrhn

Senior Member
Mar 12, 2013
1,583
763
Kuala Lumpur
Copying the folders in theory should also work, its just safer to back them up using the DD command since you get the original structure, permissions, dates etc. of the partitions.
Thus when restoring its as if you never tampered with them, while the "copy folder" method doesn't give you the original data structure.
Again, it shouldn't make a difference (in theory), but we always like to be closest to the original ;)

I see. Yeah, closest so that we know we did everything correctly. :)
 

BOOTMGR

Senior Member
Aug 3, 2010
728
3,395
anoobdevsdiary.blogspot.in
about size of the back up, theoretically it should be 10 and 16 MB because these partitions are 10 & 16MB resp.I'm still not much familiar with samsung devices so don't know why you modemfs is null
Code:
major minor  #blocks  name

   7        0      24980 loop0
   7        1      40572 loop1
   7        2      17703 loop2
 179        0   15388672 mmcblk0
 179        1      16384 mmcblk0p1
 179        2      16384 mmcblk0p2
 179        3     626688 mmcblk0p3
 179        4     313344 mmcblk0p4
 179        5    2097152 mmcblk0p5
 179        6       1536 mmcblk0p6
 179        7      10240 mmcblk0p7
 179        8   11859968 mmcblk0p8
 179        9     327680 mmcblk0p9
 179       10       1024 mmcblk0p10
 179       11      51200 mmcblk0p11
 179       12       2048 mmcblk0p12
 179       13      16384 mmcblk0p13
 179       14       2048 mmcblk0p14
 179       15      16384 mmcblk0p15
 179       16       2048 mmcblk0p16
 179       17      16384 mmcblk0p17
 179       64       2048 mmcblk0boot1
 179       32       2048 mmcblk0boot0
 179       96    3866624 mmcblk1
 179       97    3862528 mmcblk1p1
 254        0      24979 dm-0
 254        1      40572 dm-1
 254        2      17703 dm-2
 
  • Like
Reactions: fredrickaein

fredrickaein

Member
Jun 3, 2013
12
7
Pune
I don't know why the discrepancy exists, my EFS folder is 8.76 KB, and MODEMFS folder is 10.63 KB.
Maybe @frapeti can shed light on this.



Read the post you quoted:

I copied the entire folders efs and modemfs and got only 8kb and 16kb respectively. You sure need 10 n 16mb?

Sent from my GT-I9070 using xda app-developers app

Gents,

Let me check another S Advance with baseband V I9070DDULP8 and i will get back to you. It seams to me that the folder sizes & its contents are different in diff regions. Even the folder sizes doesn't match on both of your devices.

Thanks both of you for your comments.:victory::good:
 

fredrickaein

Member
Jun 3, 2013
12
7
Pune
I copied the entire folders efs and modemfs and got only 8kb and 16kb respectively. You sure need 10 n 16mb?

Sent from my GT-I9070 using xda app-developers app

I don't know why the discrepancy exists, my EFS folder is 8.76 KB, and MODEMFS folder is 10.63 KB.
Maybe @frapeti can shed light on this.



Read the post you quoted:

Hi,

I just checked another S Advance with the baseband version DDULP8 and it seems that the efs folder is 4.62 KB and the modemfs folder is empty. Now do you guys have any idea why this is so?

Regards,
Fred
 

t4n017

Senior Member
Jan 17, 2012
916
1,761
Thanks for the post. I did the backup, my 'efs_backup' file size is 10mb and the 'modemfs_backup' is 16mb. Im using the firmware LQG (Italy).

I have one question. When I was in GB I backed up only the 'efs' folder and not with 'dd', but copying it manually from phone to the computer. How to know if it's useful?
 

YMatrix

Senior Member
Thanks for the post. I did the backup, my 'efs_backup' file size is 10mb and the 'modemfs_backup' is 16mb. Im using the firmware LQG (Italy).

I have one question. When I was in GB I backed up only the 'efs' folder and not with 'dd', but copying it manually from phone to the computer. How to know if it's useful?


It's supposed to be useful, but having a DD backup is much safer.




can you backup this to the external sd ??? would the original data structure be saved as well ?

Yes, you can backup to external sd, even good to keep a copy on your pc. By using the DD command the structure is saved.

Sent from my GT-I9070 using Tapatalk 4 Beta
 

Top Liked Posts

  • There are no posts matching your filters.
  • 7
    Hello!

    So I recently stumbled upon some information that while flashing all kinds of Roms, you might lose your IMEI, thus being left over with a nice paper weight.
    To my understanding this information is stored in the EFS folder (though according to this thread it is actually stored in modemfs).
    I googled around and saw many options: PC software, terminal commands, apps etc.
    Since each phone utilizes this option in different ways, which would be a good way to backup these folders in case of emergency on the S Advance?

    Thanks!

    SOLUTION:

    These are the commands from the ADB shell, but can also be used within the terminal.

    Backup Process:
    Code:
    adb shell
    su
    dd if=/dev/block/mmcblk0p7 of=/sdcard/efs_backup.img
    dd if=/dev/block/mmcblk0p2 of=/sdcard/modemfs_backup.img 
    exit
    exit
    adb pull /sdcard/efs_backup.img efs_backup.img
    adb pull /sdcard/modemfs_backup.img modemfs_backup.img

    Restore Backup Process:
    Code:
    adb push efs_backup.img /sdcard/efs_backup.img
    adb push modemfs_backup.img /sdcard/modemfs_backup.img
    adb shell
    su
    dd if=/sdcard/efs_backup.img of=/dev/block/mmcblk0p7 
    dd if=/sdcard/modemfs_backup.img of=/dev/block/mmcblk0p2 
    exit
    exit

    Thanks to @mr.harsh and @KINGbabasula for help and KINGbabasula for making the script!
    Please note that the restore commands haven't been tested out, but theoretically its supposed to work.
    If someone has made a backup and wiped his EFS folder, he wont mind testing it out :D
    4
    Oh, alright, so to sum up so people can use this for future reference:

    Backup Process:
    Code:
    adb shell
    $ su
    # cp /sdcard/efs_backup /dev/block/mmcblk0p7 
    # cp /sdcard/ /dev/block/mmcblk0p2 
    # exit
    
    [/QUOTE]
    
    Thats wrong, to backup using cp use something like cp [original efs] [sdcard/backup folder]
    
    I guess it's better to use dd command for this purpose:
    
    dd if=/dev/block/mmcblk0p7 of=/sdcard/efs_backup.img
    
    dd if=/dev/block/mmcblk0p2 of=/sdcard/modemfs_backup.img
    
    To restore just switch if with of (input file / output file)
    
    Sent from my GT-I9070 using xda app-developers app
    3
    Hello!

    So I recently stumbled upon some information that while flashing all kinds of Roms, you might lose your IMEI, thus being left over with a nice paper weight.
    To my understanding this information is stored in the EFS folder (though according to this thread it is actually stored in modemfs).
    I googled around and saw many options: PC software, terminal commands, apps etc.
    Since each phone utilizes this option in different ways, which would be a good way to backup these folders in case of emergency on the S Advance?

    Thanks!
    in the terminal type:
    Code:
    su
    cp /dev/block/mmcblk0p7 /sdcard/efs_backup
    cp /dev/block/mmcblk0p2 /sdcard/modemfs_backup

    check that efs_backup is 10MB and modemfs_backup is 16MB.And this is for JB.I don't know about GB but most probably they'll be same...
    2
    Yeah that's why I asked. Wondering if I do anything wrong and it won't work when restoring.

    Copying the folders in theory should also work, its just safer to back them up using the DD command since you get the original structure, permissions, dates etc. of the partitions.
    Thus when restoring its as if you never tampered with them, while the "copy folder" method doesn't give you the original data structure.
    Again, it shouldn't make a difference (in theory), but we always like to be closest to the original ;)
    2
    Hi,

    I was trying to take backup of these folders, but before that, i thought of having a look at the actual folder in the root for their sizes.

    efs = 87 files, 12 folder. total six=ze is 4.84Kb
    modemfs = This folder is empty.

    Now please tell is if these are normal sizes. If it is normal then how come their backup is 10 & 16 Mb respectively.
    Regards,
    Fred

    I am surprised that your modemfs folder is empty :eek:
    As for the folder size vs. backup size, this is because that these folders are actually partitions on the phone. when backing up using DD / CP commands you are backing up the whole partition (even the "empty" bits of data), which is why you get the according sizes (these are the partition's sizes).