Sign in to follow this  
Followers 0
PaulOBrien

18 Aug: EFS auto backup script (for devs)

5 posts in this topic

I have now seen a number of cases of the EFS partition getting wiped / corrupted on the SGS II, leaving users with an effectively useless phone.

With this in mind, i've written a little init.d script for my ROM which backs up the EFS partition on boot if a backup does not already exist. A non intrusive safety net for users if you will. :)

The script just needs a suitable boot image that runs init.d, although it could easily be tacked onto the end of install-recovery.sh if that's not the case.

I'd love to encourage all developers to use this script for users' sake!

You can download the script here - http://cl.ly/2j0p0R3F07052m2T2u0e - but it's very simple, here's the code...

#!/system/bin/sh
# EFS auto backup script for Samsung Galaxy S II
# By @paulobrien - http://s2.MoDaCo.com

mount /dev/block/mmcblk0p11 /sdcard

if [ ! -f /sdcard/efs.autobackup.img ];
then
dd if=/dev/block/mmcblk0p1 of=/sdcard/efs.autobackup.img
fi

umount /sdcard[/code]

:)

Note the manual mount / umount of sdcard is necessary because this happens late in the boot process.

Cheers!

P

0

Share this post


Link to post
Share on other sites

As a matter of interest Paul, if it became necessary to restore the efs partition, how do you go about doing it? Is it as described here:

http://forum.xda-developers.com/showthread.php?t=1085374

Or would it be different as yours is a .img file?

I've had a bit of a google about, found your thread on the xda devs site, but still no answer about restoring the image. Fastboot maybe?

Sorry if it's a noob question but i'm still learning about these things ;)

0

Share this post


Link to post
Share on other sites

You'd 'dd' the image back.

P

Ah! Cool, so i'm assuming then that the phone would still be in some sort of bootable state then after corruption. Probably just sim and radio related issues i suppose.

Cheers. Good to know :)

0

Share this post


Link to post
Share on other sites

Ah! Cool, so i'm assuming then that the phone would still be in some sort of bootable state then after corruption. Probably just sim and radio related issues i suppose.

Cheers. Good to know :)

Correct! :)

P

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

MoDaCo is part of the MoDaCo.network, © Paul O'Brien 2002-2016. MoDaCo uses IntelliTxt technology.