When re-partitioning the internal storage, you are wiping out the
/efs directory that contains device-specific information, including phone's IMEI, wireless MAC address, etc. This information is encrypted, so you will need to take extra steps to back up this folder, and restore it after partitioning.
You can do this manually by following the steps for backup:
- On your computer (assuming Windows PC) open Command window and issue the following commands:
su - accept the prompt on the phone to allow root privileges.
busybox tar zcvf /sdcard/efsbackup.tar.gz /efs - this compresses the contents of the
/efs directory and copies the file to your internal SD Card, preserving the Linux file permissions, OR
cat /dev/block/mmcblk0p1 > /sdcard/efsdevblock-mmcblk0p1.img - this copies the entire partition as an image to your internal SD Card. This is probably a safer method.
- Copy the file(s) created above (efsbackup.tar.gz and/or efsdevblock-mmcblk0p1.img) from your internal SD Card to your computer.
To restore you would need to do the reverse:
- Copy either efsbackup.tar.gz or efsdevblock-mmcblk0p1.img from your PC to
/sdcard (the internal SD Card) of your Galaxy S2.
- On your PC open Command prompt and issue commands to restore the contents of
su - gain root privileges.
busybox tar zxvf /sdcard/efsbackup.tar.gz -C / - restores only the
/efs folder, OR
cat /sdcard/efsdevblock-mmcblk0p1.img > /dev/block/mmcblk0p1 - restores the entire partition containing the folder.
Alternatively, dev community members came up with apps (that you must either side-load or run from your PC) that will automate this process for you.
Keep in mind that while this works on many Samsung devices, other manufacturers store device-specific information in other locations of internal memory, so the instructions will be different, and apps may not work.