[Oppo Find 7 and 7a] Aut0mat3d:
In this Guide you will learn how to modify your system to handle the 9GB Partition 29 as Data (App-Storage) and use the external SD-Card as internal.

Don't be afraid, this is a lot of text mostly to explain the whole procedure, the steps are straight forward.

Thanks go to Kishd (oppoforums), Coldbird and alienmind (xdadevelopers) :D

Beside of the public made solutions i will do the following:

Instead of repartitioning the device i will change only the partition name of "sdcard" to "userdata", mount the external SD as internal and use the remaining 3GB Partition as external SD.

So partition 15 will become "sdcard1" and partition 29 will become "userdata"

On the Find7a you will have 9 gigs of application space and xx gigs for the internal sd (size of the sdcard).

This should work on Find7 too, someone has to check the partition layout if it is equal, than you will have 25 gigs of application space and xx gigs for the internal sd (size of the sdcard).

PRECAUTIONS:

If you mess around with partition table you could brick your device, so be careful!

Thes procedure worked for me, i am not responseable for any missing or mistyped commands/procedures, so THINK BEFORE YOU DO ANYTHING!

I am not an android Pro, nor an Develper. My Spare time is very limited so i can't help you out if something goes wrong!

I've done this with Gummy Rom, not tryed with ColorOS or another custom rom but it should work on all AOSP-based ROMS.

The swapped SD-cards do not belong to recovery, so the internal SD is accessed as before.

What do you need:

1.: Time: This is not done in 5 minutes, so please be patient.

2.: A Linux-PC with working ADB and Fastboot

3.: TWRP recovery image on your PC or installed on the device: http://techerrata.com/browse/twrp2/find7a (I used 2.7.1.0)

4.: An SD card with at least 16Gb inseted into your Find7a

5.: Fully charge your Device before messing around, some jobs will need a lot of time.

6.: A fitting custom ROM installed, i've done this with Gummy-M2.3-06-29-14-NIGHTLY-find7 which is suitable for find7 and find7a which can be found here: http://crackflasher.com/gummy-m2-3-06-29-14-nightly-find7-zip-oppo-find-7a-gummy/

7.: The zip-file of the custom rom on your local PC

What are we going to do:

0.: Boot into recovery and access the Device via ADB

1.: Format external SD to Ext4 Filesystem

2.: Backup the original partition layout and all partitions too

3.: Copy Data from internal SD to external

4.: Rename two partitions

5.: Format the new "userdata" partition and move all content of the old to the new location

6.: Format the new "sdcard1" partition

7.: Edit/replace fstab files in /etc to tell TWRP and System the new mountpoints

OK, let's do the trick ;)

Step0.: Booting into recovery and accessing the Device via ADB-shell:

Put the phone into fast boot mode. (Power Volume Up simultaneously)

Open a terminal in your linux-PC and do the following as root (sudo -r):

#: fastboot devices ( check that fastboot is up and running)

#: fastboot boot openrecovery-twrp-2.7.1.0-find7a.img (or boot into TWRP if already installed)

The phone will boot into twrp.

Connect the phone and go into adb

#: adb shell

After entering the adb shell you should see the following in your terminal:

* daemon not running. starting it now on port 5037 *

* daemon started successfully *

~ #

Step1.: Format external SD to Ext4 Filesystem

First we have to write a new partition table as i dont know how your SD-card looks:

umount /external_sd (could cause errors if no filesystem is present on SD - dont mind)

parted /dev/block/mmcblk1 (you should see parted welcome message, no errors!)

mklabel msdos (this will write a new partition table on your sdcard)

mkpart primary ext4 1 -1 (this will make a ext4 partition which uses the whole sd)

quit

Now we are going to format the ext4 partition:

mke2fs -t ext4 -m 0 -L sdcard /dev/block/mmcblk1p1

tune2fs -c 0 -i -1 -C -1 /dev/block/mmcblk1p1

mount /dev/block/mmcblk1p1 /external_sd (Mount the new formatted sd-card -- this should show no errors)

If all is done without errors, proceed to step2

Step2.: Backup the original partition layout and all partitions too

dd makes physical imagea of partitions so you can put it back if needed

While DD is copying you will see no progress bar or any output, so BE PATIENT!

mkdir /external_sd/backup
parted /dev/block/mmcblk0 print > /external_sd/backup/partitions (original partition Layout for later reference)
dd if=/dev/block/mmcblk0p1 of=/external_sd/backup/modem
dd if=/dev/block/mmcblk0p2 of=/external_sd/backup/sbl1
dd if=/dev/block/mmcblk0p3 of=/external_sd/backup/dbi
dd if=/dev/block/mmcblk0p4 of=/external_sd/backup/ddr
dd if=/dev/block/mmcblk0p5 of=/external_sd/backup/aboot
dd if=/dev/block/mmcblk0p6 of=/external_sd/backup/rpm
dd if=/dev/block/mmcblk0p7 of=/external_sd/backup/boot
dd if=/dev/block/mmcblk0p8 of=/external_sd/backup/tz
dd if=/dev/block/mmcblk0p9 of=/external_sd/backup/pad
dd if=/dev/block/mmcblk0p10 of=/external_sd/backup/modemst1
dd if=/dev/block/mmcblk0p11 of=/external_sd/backup/modemst2
dd if=/dev/block/mmcblk0p12 of=/external_sd/backup/oppodycnvbk
dd if=/dev/block/mmcblk0p13 of=/external_sd/backup/oppostanvbk
dd if=/dev/block/mmcblk0p14 | gzip -c | split -b 2000m -a 3 - /external_sd/backup/system.gz
dd if=/dev/block/mmcblk0p16 of=/external_sd/backup/persist
dd if=/dev/block/mmcblk0p17 of=/external_sd/backup/cache
dd if=/dev/block/mmcblk0p18 of=/external_sd/backup/recovery
dd if=/dev/block/mmcblk0p19 of=/external_sd/backup/fsg
dd if=/dev/block/mmcblk0p20 of=/external_sd/backup/fsc
dd if=/dev/block/mmcblk0p21 of=/external_sd/backup/ssd
dd if=/dev/block/mmcblk0p22 of=/external_sd/backup/misc
dd if=/dev/block/mmcblk0p23 of=/external_sd/backup/LOGO
dd if=/dev/block/mmcblk0p24 of=/external_sd/backup/DRIVER
dd if=/dev/block/mmcblk0p25 of=/external_sd/backup/reserve1
dd if=/dev/block/mmcblk0p26 of=/external_sd/backup/reserve2
dd if=/dev/block/mmcblk0p27 of=/external_sd/backup/reserve3
dd if=/dev/block/mmcblk0p28 of=/external_sd/backup/reserve4
dd if=/dev/block/mmcblk0p30 of=/external_sd/backup/grow

It is not urgently needed to make dd backups of userdata and (internal) sdcard but here for refernce:

Do a compressed multispan backup with dd so you can use the files on an FAT32 filesystem too:

dd if=/dev/block/mmcblk0p15 | gzip -c | split -b 2000m -a 3 - /external_sd/backup/userdata.gz.

dd if=/dev/block/mmcblk0p29 | gzip -c | split -b 2000m -a 3 - /external_sd/backup/sdcard.gz.

Example of restoring partition 29:

cat /external_sd/backup/userdata.gz.* | gzip -dc | dd of=/dev/block/mmcblk0p29

Step3.: Copy Data from internal SD to external SD:

cp -a -i /internal_sd/* /external_sd/ (this can take a while)

ls /external_sd/ (you should see a bunch of files here)

If nothing went wrong go to step4

Step4.: Rename partitions:

umount /internal_sd/

umount /and-sec/

umount /data/

parted /dev/block/mmcblk0

name 15 sdcard

name 29 userdata

print (should show you the renamed layout)

quit

If nothing went wrong go to step5

Step5.: Format the new "userdata" partition and move all content of the old to the new location:

mke2fs -t ext4 -m 0 -L userdata /dev/block/mmcblk0p29

tune2fs -c 0 -i -1 -C -1 /dev/block/mmcblk0p29

mount /dev/block/mmcblk0p15 /internal_sd

mount /dev/block/mmcblk0p29 /data

cp -a -i /internal_sd/* /data/ (this can take a while)

If nothing went wrong go to step6

Step6.: Format the new "sdcard1" partition:

umount /internal_sd/

mke2fs -t ext4 -m 0 -L sdcard1 /dev/block/mmcblk0p15

tune2fs -c 0 -i -1 -C -1 /dev/block/mmcblk0p15

If nothing went wrong go to step7

Step7.: Edit/replace fstab.qcom file to tell System the new mountpoints:

Guide from Coldbird: http://www.oppoforums.com/threads/unpack-repack-find-7-a-boot-img.14538/

Unpack update.zip and make a working directory.

copy file boot.img from update.zip into this directory

download https://github.com/xiaolu/mkbootimg_tools

unpack bootimage:

mkboot boot.img extracted (this will create a folder "extracted" with the content of boot.img where you can find fstab.qcom

edit fstab.qcom co match your needs (i.e. swap internal and external storage as shown below)

pack bootimage:

mkboot extracted newboot.img (creates newboot.img)

test bootimage (via fastboot):

sudo fastboot boot newboot.img

flash bootimage (via fastboot):

sudo fastboot flash boot newboot.img

sudo fatboot reboot

This is how the original file looks:

# Android fstab file.
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK

#TODO: Add 'check' as fs_mgr_flags with data partition.
# Currently we dont have e2fsck compiled. So fs check would failed.

#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
/dev/block/platform/msm_sdcc.1/by-name/system /system ext4 ro,barrier=1 wait
/dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,data=ordered,noauto_da_alloc,journal_async_commit,errors=panic wait,check,encryptable=footer,length=-16384
/dev/block/platform/msm_sdcc.1/by-name/cache /cache ext4 noatime,nosuid,nodev,barrier=1,data=ordered,noauto_da_alloc,journal_async_commit,errors=panic wait,check
/dev/block/platform/msm_sdcc.1/by-name/persist /persist ext4 nosuid,nodev,barrier=1,data=ordered,nodelalloc,nomblk_io_submit,errors=panic wait
/dev/block/platform/msm_sdcc.1/by-name/boot /boot emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/recovery /recovery emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/modem /firmware vfat ro,shortname=lower,uid=1000,gid=1026,dmask=227,fmask=337 wait

/devices/msm_sdcc.1/mmc_host/mmc0 auto auto uid=1023,gid=1023,fmask=0007,dmask=0007 voldmanaged=sdcard0:29,nonremovable,noemulatedsd
/devices/msm_sdcc.2/mmc_host auto auto uid=1023,gid=1023,fmask=0007,dmask=0007 voldmanaged=sdcard1:auto,noemulatedsd

/devices/platform/xhci-hcd auto auto defaults voldmanaged=usbdisk:auto

This is the changed file:
# Android fstab file.
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK

/dev/block/platform/msm_sdcc.1/by-name/system /system ext4 ro,barrier=1 wait
# Use internal sdcard as /data
/dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,data=ordered,noauto_da_alloc,journal_async_commit,errors=panic wait,check,encryptable=footer,length=-16384
#/dev/block/platform/msm_sdcc.1/by-name/sdcard /data ext4 noatime,nosuid,nodev,barrier=1,data=ordered,noauto_da_alloc,journal_async_commit,errors=panic wait,check,encryptable=footer,length=-16384
/dev/block/platform/msm_sdcc.1/by-name/cache /cache ext4 noatime,nosuid,nodev,barrier=1,data=ordered,noauto_da_alloc,journal_async_commit,errors=panic wait,check
/dev/block/platform/msm_sdcc.1/by-name/persist /persist ext4 nosuid,nodev,barrier=1,data=ordered,nodelalloc,nomblk_io_submit,errors=panic wait
/dev/block/platform/msm_sdcc.1/by-name/boot /boot emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/recovery /recovery emmc defaults defaults
/dev/block/platform/msm_sdcc.1/by-name/modem /firmware vfat ro,shortname=lower,uid=1000,gid=1026,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 wait

# CM11 hack: Swap sdcard1 and sdcard0 - both in ext4 and (internal)sdcard1 as emulated
#/devices/msm_sdcc.2/mmc_host auto vfat defaults voldmanaged=sdcard0:auto,noemulatedsd
#/dev/block/platform/msm_sdcc.1/by-name/userdata /storage/sdcard1 ext4 noatime,nosuid,nodev,barrier=1,data=ordered,noauto_da_alloc,nodelalloc,uid=1023,gid=1023,dmask=0007,fmask=0007 defaults
#/dev/block/platform/msm_sdcc.1/by-name/sdcard auto ext4 noatime,nosuid,nodev,barrier=1,data=ordered,noauto_da_alloc,nodelalloc,uid=1023,gid=1023,dmask=0007,fmask=0007 voldmanaged=sdcard1:29,nonremovable,noemulatedsd

# Original Entry of Gummy rom:
#/devices/msm_sdcc.1/mmc_host/mmc0 auto auto uid=1023,gid=1023,fmask=0007,dmask=0007 voldmanaged=sdcard0:29,nonremovable,noemulatedsd
#/devices/msm_sdcc.2/mmc_host auto auto uid=1023,gid=1023,fmask=0007,dmask=0007 voldmanaged=sdcard1:auto,noemulatedsd

# Working with switched sd-cards, Aut0mat3d:
/devices/msm_sdcc.1/mmc_host/mmc0 auto auto uid=1023,gid=1023,fmask=0007,dmask=0007 voldmanaged=sdcard1:15,nonremovable,noemulatedsd
/devices/msm_sdcc.2/mmc_host auto auto uid=1023,gid=1023,fmask=0007,dmask=0007 voldmanaged=sdcard0:auto,nonremovable,noemulatedsd

/devices/platform/xhci-hcd auto vfat defaults voldmanaged=usbdisk:auto