[LG Optimus L3 II, L5 II, L7 II, L9 II] Varcain:
Since CM 10 port alpha release for this phone gets closer I thought it would be a good idea to give you guys some guide on how to prepare your SD cards for dual boot. By sacrificing some sdcard space and speed of secondary boot ROM (my CM port in this case, external SD cards are significantly slower than internal EMMCs) you can have the option to try out or just use my CM port without having to replace your stock ROM (yes, flashing my CM ROM will not affect your stock rom/data in any way if you do it according to my guides).

You can do this stuff directly from your phone via ADB shell once you root and install busybox on it. You will have to reformat the SD card so back up any data you don't want to lose from it. Also, this guide assumes 32GB sdcard, if you have some other size read comments after instructions.

Partition scheme I am using currently looks like this:

Partition 1 (mmcblk1p1) - FAT filesystem, your usual "external storage" thing.

Partition 2 (mmcblk1p2) - EXT4 filesystem, System partition (this is where ROM goes to)

Partition 3 (mmcblk1p3) - EXT4 filesystem, Cache partition (from what I see this is for dalvik cache and some logs)

Partition 4 (mmcblk1p4) - EXT4 filesystem, Data partition (this will be your "internal memory")

First you need to unmount external sd card (settings->storage->Unmount external sd card). To repartition mmc according to this scheme issue the following from the ADB console:

$ su

# fdisk /dev/block/mmcblk1

Then from the fdisk command interface enter the following (in parentheses are comments, don't type them in :P):

u (this changes unit display to sectors, more convenient to analyse than cylinders, should return "Changing display/entry units to sectors")

p (this will print list of partitions on the sdcard, most likely it will contain only one partition)

d (this will enter partition delete mode)

enter (just press enter, if you have more partitions it will ask you for a number between 1-4)

p (check the list and ensure partition list is empty, if it's not then delete with "d" command from previous steps)

n (new partition mode)

p (primary)

1 (partition number 1)

enter (default first sector is OK so just press enter)

+15000M

n (next partition)

p

2 (partition number 2)

enter (default first sector ok again)

+1000M

n

p

3 (partition number 3)

enter

+1000M

n

p (this will autoselect partition 4 since we can have up to 4 primary partitions)

enter

enter (this will allocate all remaning sectors to the last partition)

t (change partition's system id)

1 (partition 1)

c (this sets Win95 FAT32 (LBA))

p (print partition list and compare with my example printout from below)

If everything is ok type one last command from the command interface:

w (this writes the partition table and exits)

Now that partitioning is done we need to create filesystems:

# mkfs.vfat /dev/block/mmcblk1p1

# mke2fs -T ext4 /dev/block/mmcblk1p2

# mke2fs -T ext4 /dev/block/mmcblk1p3

# mke2fs -T ext4 /dev/block/mmcblk1p4

Done! You will have to wait for my ROM release now.

If you have different size SD card:

When you create partitions with fdisk at some point you enter partition size (like +15000M) from the command interface. For smaller sd cards you will have to reduce this number for partition 1 (for example if you have 8GB card then +2000M looks good). The rule of thumb is to keep system partition large enough for possible updates (hence +1000M, 1GB), cache to 1GB as well just to be sure. The remaining space is to be divided between FAT partition and data partition. The less space you assign to data partition the less apps you will be able to install (moving to external SD card doesn't work in my port yet). Feel free to experiment.

One important note: do

NOT

use fdisk or any filesystem utility like mkfs/mke2fs on block device mmcblk0. If you mess up internal emmc partitions you will end up with a bricked phone. External sd card is labeled /dev/block/mmcblk1 in our phone and use only this label. Be very careful when you type these commands to not accidentally type /dev/block/mmcblk0 instead of /dev/block/mmcblk1!