[DualBoot][Tools][Guide]Essentials v2.1 for Berni's method

Search This thread
As of 28/12/2013, I no longer have this phone. My threads will stay open for all who want to assist others. I've had a great time being a member of the O3D community, so thank you all!
For questions, requests or any other remarks, please don't send me PM, I will not answer. Instead, please post properly in the thread, so that anybody can read and benefit or even assist.


02/07/2013:New version 2.1 (fixed compatibility issues with Gingerbread present in v2.0). Switch_ROM in v2 is now a single script. All other scripts integrated into a "Recovery" equivalent. Fixed bug in wipes. Renamed "bin" folder to "img" (seemed more appropriate). Old v1.0 users must delete their existing DualBoot folder. Don't forget to backup your boot1.img and boot2.img from the old "bin" folder.

Our top developer, Berni987654321, developed a method to dual-boot our phones (follow the link to his page and press his "Thanks" button, he deserves it)! Thanks to him we can preserve our stock ROM with full 3D support and at the same time try out modern Jellybean ROMs like CM10, PACman, perhaps even KitKat some day!

However, dual booters were facing two problems:
1. Switching ROMs was cumbersome and time consuming since it required to reboot into recovery, flash a kernel and reboot again to the other ROM.
2. Recovery only backs up and restores the primary ROM. If someone wanted to try out different secondary ROMs, he would have to set them up from scratch every time.
3. Factory Reset and wipes don't work for secondary ROM in Recovery
This is where I've come in. I have written scripts that fill in these gaps.

Download and unzip the file attached and copy the DualBoot folder anywhere in your phone. It is necessary that all files are kept inside the folder and that the path (all directory names) to this folder contains no spaces.

Usage instructions are on the second post.

In order to keep SMS and Call Logs synchronized between the two ROMs, I use SMS Backup +. Naturally, it needs to be installed in both, primary and secondary ROMs.

You can't install just any kernel for your secondary ROM. You can only use one from Berni's page. Still, you can overclock using CM10 modules by Iodak.

Ilie321 and Defcomg have made a working FM radio app for ICS and JB. Attached at the end of this post there is a modified flashable zip that installs the radio straight into a secondary CM10 ROM. Use it after every Nightly upgrade.

For a long time I've wanted to integrate a "Fix Permissions" option into the Dual Boot Tools script but never found the time. Here you can find a wonderful script and run it with Script Manager after your secondary ROM has booted.

!! 3D support for CM10 !!
We may not be able to view in 3D, but we can shoot!
Defcomg has successfully ported ArcCamera to CM10 / 10.1 based ROMs, fixing at the same time orientation problems for all 3rd party cameras (e.g. Instagram). Attached you will find ARC+V30B_LIBS_CM10+_DualBoot.zip which is modified to flash directly to the secondary ROM. You need to flash it after every Nightly upgrade.
Hit Defcomg's "Thanks" button (Original thread)!


Stock ICS v30a Kernel:
If you have already updated your primary ROM to P920 ICS v28b or v30a, you will need the attached "Kernel-ICS-v30a.zip". Download and copy it to your phone. Follow instructions in 2nd post.
IMPORTANT: Official P920 ICS has locked bootloaders, so before you can boot into CM10 you also have to flash Wkpark's v1.25a bootloaders. OS_Hacking's Tool is an easy way to do that.

New CM10.1 Kernel
With the old CM10.1 Kernel, Bluetooth doesn't work. Attached you will find a new BT-fixed 10.1 kernel modified for Dual-Boot!



ADB driver not installing when in recovery!
It has been reported that after installing ICS on the phone, the computer cannot install the ADB driver when phone is in recovery mode, although ADB works normally when in USB Debugging mode.
Solution:
1. Open Device Manager and connect phone in recovery.
2. Right-click on LGE COSMO USB Device (in Other Devices) and select "Update driver software"
3. Select "Browse my computer for driver software"
4. Select "Let me pick from a list..."
5. Select "ADB Interface"
6. Select "Android Platform Sooner Single ADB Interface" and hit "Next"
7. Say "Yes" to the warning and wait for the driver to install
8. You may have to reboot the computer
 

Attachments

  • Kernel-ICS-v30a.zip
    5.8 MB · Views: 716
  • DualBoot_v1.1.zip
    3.8 KB · Views: 180
  • DualBoot_v2.1.zip
    2.3 KB · Views: 336
  • MOD_FM_Radio_3.2.1_CM10-DualBoot_P920_es_en_de_it_sk.zip
    1.8 MB · Views: 192
  • ARC+V30B_LIBS_CM10+_DualBoot.zip
    4.7 MB · Views: 241
  • Kernel_DualBoot_CM10.1_BTfixed.zip
    3.8 MB · Views: 249
Last edited:
Instructions on setting up the ROMs:

In this guide, I will concentrate on how to setup your EXTERNAL SD, because the latest CM10 and CM10.1 kernels modified by Berni expect to find partitions there!

First of all, you need to have ADB installed on your PC and CWM (or other recovery) on your phone. You also need to have unlocked bootloader if you are running ICS. There are other threads that explain how to do all that.

1. BACKUP your EXTERNAL SD card. IT WILL BE ERASED!
2. Download the primary and secondary ROMs of your choice
3. Do the necessary modifications to the secondary ROM as instructed by Berni (Do NOT use Windows Notepad for this. It corrupts the script. Download and use Notepad++ instead).
4. Download the kernels that match your ROMs (as described in Berni's guide).
5. Copy all to your INTERNAL SD (as I said, the external sd will be erased).
6. Boot into recovery, connect to PC via ADB and prepare partitions as instructed by Berni (this is when your card loses all data).
... Detailed Setup Instructions:
Some people reported trouble when trying to partition external SD cards larger than 8GB. So, I rewrote Berni's guide and added a little trick to help.
Follow this guide to partition your EXTERNAL SD card:
1. Turn off your phone. Keep Vol- 3D and Power keys until the LG logo shows. Release all keys. Wait a few sec.
2. You are now in Recovery. Connect your phone to PC with a USB cable, press Windows Start Menu, type:
and hit enter.
3. In the new window that has opened type:
adb shell
cd /dev/block
parted mmcblk1
print
For a 32 GB card, you'll get something like this:
Code:
Model: SD 00000 (sd/mmc)
Disk /dev/block/mmcblk1: 31.4GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start    End       Size      Type      File system   Flags
 1      [b]1049kB   31.4GB[/b]    31.4GB    primary   fat32         lba
Write down the Start and End numbers
For cards larger than 8GB, the End Number is shown in GB. Multiply it by 1000 to cnvert it to MB (31400MB in our example). Make sure you use values in MB and NOT in GB in the commands below.
4. Type
rm 1
mkpartfs primary fat32 1049kB 29400MB ///!!! Instead of 1049kB, type the Start number you wrote down. Instead of 29400, type your End number minus 2000MB !!!
mkpartfs primary ext2 29400MB 30100MB ///!!! Instead of 29400, type the end of your 1st partition. Instead of 30100, type the end of 1st partition plus 700MB !!!
mkpartfs primary ext2 30100MB 31300MB ///!!! Instead of 30100, type the end of your 2nd partition. Instead of 31300, type the end of 2nd partition plus 1200MB !!!
At this point, because not all cards have exactly the same capacity, you need to know exactly how much space you have left. Type:
You get somehing like:
Code:
Model: SD 00000 (sd/mmc)
Disk /dev/block/mmcblk1: 31.4GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start    End       Size      Type       File system  Flags
        32.3kB   1049kB    1016kB    Free Space
 1      1049kB   29.4GB    29.4GB    primary    fat32        lba
 2      29.4GB   30.1GB    700MB     primary    ext2
 3      30.1GB   31.3GB    1200MB    primary    ext2
        31.3GB   31.4GB    [b]87.7MB[/b]    Free Space
Note the size of your last free space (87.7MB here). Anything larger than 67.1MB will be sufficient.
Type:
mkpartfs primary ext2 31300MB 31387.7MB ///!!! 31300MB is the end of 3rd partition. 31387.7MB is the end of 3rd partition plus the remaining free space !!!
print
this time you get:
Code:
Model: SD 00000 (sd/mmc)
Disk /dev/block/mmcblk1: 31.4GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start    End       Size      Type       File system  Flags
 1      1049kB   29.4GB    29.4GB    primary    fat32        lba
 2      29.4GB   30.1GB    700MB     primary    ext2
 3      30.1GB   31.3GB    1200MB    primary    ext2
 4      31.3GB   31.4GB    90MB      primary    ext2
5. Turn off your phone and boot again into recovery.
Type:
adb shell
cd /dev/block
mke2fs -T ext3 mmcblk1p2
mke2fs -T ext3 mmcblk1p3
mke2fs -T ext3 mmcblk1p4
Your new partitions are now ready!

7. Flash the ROMs (you may want to keep your original ROM and flash only the secondary one)
8. Flash your primary kernel and reboot to system.

Rebooting will now load your primary ROM.


Partitioning the easy way!
Instead of step 6, you may put your microSD card to your PC using a Card-Reader. Then you may use MiniTool, EaseUS or other freeware partitioning tool to create your partitions. Shrink your main partition and make three new PRIMARY EXT3 partitions AFTER your main one. The 1st (system2) must be 700MB. The second (data2) at least 1GB (you can make it larger if you like to install lots of apps)! The 3rd one (cache2) should be around 100MB. So, do the math and make sure you have shrunk your fat32 partition according to your needs first. After you're done, eject your card from the PC, put it in your phone and continue to step 7.
Important: If for your own reasons you need to create more than the 4 primary partitions mentioned above, then you must convert your card to GPT (GNU Partitioning Table). Minitool has that option. This is because the default MBR (Master Boot Record) partitioning does not support more than 4 primary partitions on the same medium. This is also how the internal memory of our phones is divided into a large number of partitions (P920: 15, SU760: 17) and they are all primary.


New: Easiest partitioning ever!
A new app, AParted, has appeared on PlayStore. You can use it to create both MBR type (up to 4 primary) and GPT type (up to 128 primary) partitions.


Instructions on ROM switching:

1. Go to Play Store and install SManager
2. Download the attachment from 1st post, unzip it and place the DualBoot folder on your phone (anywhere you like)
3. Unzip your primary kernel, place boot.img into your DualBoot/img folder and rename it to boot1.img
4. Do the same for your secondary kernel, but rename it to boot2.img
5. Run SManager, browse to your DualBoot folder and select "Switch_ROM".
6. Mark favourite and su options and run the script.

Your phone will now reboot to your secondary ROM. Use the same script to go back to your primary ROM.

7 (optional). SManager has a homescreen widget system. It lets you add buttons in your homescreens that will directly run the linked script (it has to be put in favourites first).

Alternatively, you may download Flashify from Play Store and flash your desired Kernel.img from there. The advantage is that you may keep and test different kernels for the same ROM without having to rename them or put them in the IMG folder (less initial setup). The disadvantage is that it requires more clicks to switch every time.



Instructions on Backup/Recovery/Wipe:
These scripts work for EXTERNAL SD ROM installations!

1. For full functionality, you must be on PRIMARY ROM (you can't expect to wipe or restore a running system)!
2. Make sure you have at least 2GB free space on your external SD if you want to make a backup.
3. Inside your DualBoot folder there is a script: "Recovery_Tools". Run the script with SManager (make sure you have the SU and Wlck buttons pressed). For Wlck to work, you must first enable it from SManager settings.
4. You will now enter the Dual Boot Recovery Tools. There are several options. Type the number you want and press enter. All functions are pretty self-explanatory.

It's very important to know that every backup overwrites the previous! The backup is kept in /sdcard/_ExternalSD/ROMs/rom2_backup. If you want to keep more than one backups, you can always rename the folder, but remember to change the name back if you want to restore your ROM.

The "Advanced" option takes you to the "Wipes" menu. For a Factory Reset, you must wipe Data2 and Cache2. For a Full Format, in order to clean-install a new ROM, you may also wipe System2.


Remove Dual Boot - Regain card space:
This is pretty simple:

1. Backup the contents of your SD card.
2. Boot to your primary ROM
3. Go to System Settings/Storage and select Erase SD card.


Case scenario / Easy migration to dual boot:

Say you have already installed CM10 in a single boot setup but you miss the 3D features and you want to restore your good old gingerbread backup or flash the new P920 ICS, but keep your CM10 setup as a secondary ROM in dual boot.
1. Make sure you have at least 4GB free in your external SD.
2. While still in CM10, use SManager to browse to your DualBoot folder, run the "Recovery_Tools" script and select option to "Backup/Migrate ROM1".
(Go fry some bananas cause this will take around 6-7min!)
3. Now backup your external SD to your PC and reboot to recovery.
4. Follow the guide to partition your external SD.
5. Restore your Gingerbread or P920-ICS backup or flash your favorite ROM and reboot into it.
6. Restore your external SD backup from PC.
7. Run the "Recovery_Tools" again and use the "Restore ROM2" option.
(Eat your fried bananas cause this will take another 6-7 min!)

Your original CM10 installation is now relocated to external SD as your secondary ROM. Use my instructions on ROM switching to boot into it.
 
Last edited:

jocazmaj

Senior Member
Jan 23, 2013
220
83
Nis
Wow man, this is awesome!
I'm bussy right now but I'll try it out as soon as i can.
Thanx thanx thanx thanx......
 
  • Like
Reactions: dreccon

Evil Slayer

Senior Member
Mar 28, 2011
307
47
Amman
this is awesome!!thank you so much for this...one of the reasons i don't use dual booting is that the switching process is not efficient
and now its much better..so thank you again :D
 
  • Like
Reactions: dreccon

CarDGee

Member
Jan 23, 2013
42
61
Re: [DualBoot][Tools]Essential tools for Berni's method

Great job mate, you just made my life a lot easyer.
Thanks

Sent from my LG-P920 using xda app-developers app
 
  • Like
Reactions: dreccon
Re: [DualBoot][Tools][Guide]Essentials for Berni's method

Some people experienced trouble partitioning external cards larger than 8GB. Specifically, the 4th partition (cache) wouldn't fit. So, I rewrote Berni's guide on partitioning, adding one extra trick to do the job without problems!

Sent from my 3D phone
 

brajesh.sharma87

Senior Member
Jan 27, 2011
2,092
2,837
Kolkata
Very good bro, just find a way to put script shortcut in powermenu, that would be real cool. I think it can be done by editing android.policy.jar
 
It just occured to me that there is yet another way to easily switch ROMs without using my scripts! Whoever is interested may try it.
This method is ideal for those who use Xbsall's prerooted v28b. That rom comes with milaq' 2nd init recovery which lives in the system partition. The recovery partition remains with stock recovery which is practically useless. So, 1st of all make sure you have wkpark's v1.25a bootloader (a prerequisite to boot into both ICS and CM10). Then flash the secondary boot.img into the recovery partition. This way every "normal reboot" will take you to your primary ROM and every "reboot to recovery" (or pressing vol-down at bootup) will take you to the secondary ROM. To go to milaq's recovery you would press vol-down at normal bootup while keys are flashing or run the dedicated app from android. So, there you have it: a fully functional dual-boot android. Ofcourse, this can apply to any ROM that can be fitted with 2nd init recovery.

Any questions?
 
  • Like
Reactions: VfBStuttgart27

boltthrower56

Senior Member
Oct 27, 2012
450
117
izmir
Hey dreccon , say that i want to keep cm10 as my primary ROM and v28b as my secondary , if you can also include those steps in your main post i'd really appreciate it.

Thank you for this great contribution.
 
Re: [DualBoot][Tools][Guide]Essentials for Berni's method

Hey dreccon , say that i want to keep cm10 as my primary ROM and v28b as my secondary , if you can also include those steps in your main post i'd really appreciate it.

Thank you for this great contribution.

Sorry, can't do that! It's not that it can't be done, but you would need a v28b kernel modified to look for the system partitions in the SD card. I don't know how to do this. Berni does! That's why all the modified kernels are on his page and not here!

What you can do right now is to migrate your existing CM10 to the card. I've written instructions on 1st post.

Sent from my dual-booting ICS/JB O3D!
 

boltthrower56

Senior Member
Oct 27, 2012
450
117
izmir
Sorry, can't do that! It's not that it can't be done, but you would need a v28b kernel modified to look for the system partitions in the SD card. I don't know how to do this. Berni does! That's why all the modified kernels are on his page and not here!

What you can do right now is to migrate your existing CM10 to the card. I've written instructions on 1st post.

Sent from my dual-booting ICS/JB O3D!

Allright , thanks anyway...
I'll pm bernie and ask about modifying the kernel.
I already did a little research about it , i think i can do it easily , i just need someone to point me out to the right direction.
 

infernum

Senior Member
Jun 4, 2008
88
18
ADB can not get started with the recovery, I tested with CMW and TRWP (terminal), any ideas?
 
ADB can not get started with the recovery, I tested with CMW and TRWP (terminal), any ideas?

Are you using ICS as your primary ROM? It seems that there is a driver problem in ICS. I'm using v28b and my computer can't install drivers when I connect phone in recovery, although everything works perfect when it's booted in Android. All I can tell you is to try updated drivers (the link has been posted in v30a thread. If it still doesn't work, you'll have to use TWRP console instead of ADB. If this is your case you'll need further instructions cause the commands in TWRP console are a little different than ADB.

Sent from my dual-booting ICS/JB O3D!
 

boltthrower56

Senior Member
Oct 27, 2012
450
117
izmir
Are you using ICS as your primary ROM? It seems that there is a driver problem in ICS. I'm using v28b and my computer can't install drivers when I connect phone in recovery, although everything works perfect when it's booted in Android. All I can tell you is to try updated drivers (the link has been posted in v30a thread. If it still doesn't work, you'll have to use TWRP console instead of ADB. If this is your case you'll need further instructions cause the commands in TWRP console are a little different than ADB.

Sent from my dual-booting ICS/JB O3D!

I can get into adb from fastboot , recovery and debugging with defcomg super light ROM ?

Sent from my LG-P920 using xda premium
 

Top Liked Posts

  • There are no posts matching your filters.
  • 32
    As of 28/12/2013, I no longer have this phone. My threads will stay open for all who want to assist others. I've had a great time being a member of the O3D community, so thank you all!
    For questions, requests or any other remarks, please don't send me PM, I will not answer. Instead, please post properly in the thread, so that anybody can read and benefit or even assist.


    02/07/2013:New version 2.1 (fixed compatibility issues with Gingerbread present in v2.0). Switch_ROM in v2 is now a single script. All other scripts integrated into a "Recovery" equivalent. Fixed bug in wipes. Renamed "bin" folder to "img" (seemed more appropriate). Old v1.0 users must delete their existing DualBoot folder. Don't forget to backup your boot1.img and boot2.img from the old "bin" folder.

    Our top developer, Berni987654321, developed a method to dual-boot our phones (follow the link to his page and press his "Thanks" button, he deserves it)! Thanks to him we can preserve our stock ROM with full 3D support and at the same time try out modern Jellybean ROMs like CM10, PACman, perhaps even KitKat some day!

    However, dual booters were facing two problems:
    1. Switching ROMs was cumbersome and time consuming since it required to reboot into recovery, flash a kernel and reboot again to the other ROM.
    2. Recovery only backs up and restores the primary ROM. If someone wanted to try out different secondary ROMs, he would have to set them up from scratch every time.
    3. Factory Reset and wipes don't work for secondary ROM in Recovery
    This is where I've come in. I have written scripts that fill in these gaps.

    Download and unzip the file attached and copy the DualBoot folder anywhere in your phone. It is necessary that all files are kept inside the folder and that the path (all directory names) to this folder contains no spaces.

    Usage instructions are on the second post.

    In order to keep SMS and Call Logs synchronized between the two ROMs, I use SMS Backup +. Naturally, it needs to be installed in both, primary and secondary ROMs.

    You can't install just any kernel for your secondary ROM. You can only use one from Berni's page. Still, you can overclock using CM10 modules by Iodak.

    Ilie321 and Defcomg have made a working FM radio app for ICS and JB. Attached at the end of this post there is a modified flashable zip that installs the radio straight into a secondary CM10 ROM. Use it after every Nightly upgrade.

    For a long time I've wanted to integrate a "Fix Permissions" option into the Dual Boot Tools script but never found the time. Here you can find a wonderful script and run it with Script Manager after your secondary ROM has booted.

    !! 3D support for CM10 !!
    We may not be able to view in 3D, but we can shoot!
    Defcomg has successfully ported ArcCamera to CM10 / 10.1 based ROMs, fixing at the same time orientation problems for all 3rd party cameras (e.g. Instagram). Attached you will find ARC+V30B_LIBS_CM10+_DualBoot.zip which is modified to flash directly to the secondary ROM. You need to flash it after every Nightly upgrade.
    Hit Defcomg's "Thanks" button (Original thread)!


    Stock ICS v30a Kernel:
    If you have already updated your primary ROM to P920 ICS v28b or v30a, you will need the attached "Kernel-ICS-v30a.zip". Download and copy it to your phone. Follow instructions in 2nd post.
    IMPORTANT: Official P920 ICS has locked bootloaders, so before you can boot into CM10 you also have to flash Wkpark's v1.25a bootloaders. OS_Hacking's Tool is an easy way to do that.

    New CM10.1 Kernel
    With the old CM10.1 Kernel, Bluetooth doesn't work. Attached you will find a new BT-fixed 10.1 kernel modified for Dual-Boot!



    ADB driver not installing when in recovery!
    It has been reported that after installing ICS on the phone, the computer cannot install the ADB driver when phone is in recovery mode, although ADB works normally when in USB Debugging mode.
    Solution:
    1. Open Device Manager and connect phone in recovery.
    2. Right-click on LGE COSMO USB Device (in Other Devices) and select "Update driver software"
    3. Select "Browse my computer for driver software"
    4. Select "Let me pick from a list..."
    5. Select "ADB Interface"
    6. Select "Android Platform Sooner Single ADB Interface" and hit "Next"
    7. Say "Yes" to the warning and wait for the driver to install
    8. You may have to reboot the computer
    14
    Instructions on setting up the ROMs:

    In this guide, I will concentrate on how to setup your EXTERNAL SD, because the latest CM10 and CM10.1 kernels modified by Berni expect to find partitions there!

    First of all, you need to have ADB installed on your PC and CWM (or other recovery) on your phone. You also need to have unlocked bootloader if you are running ICS. There are other threads that explain how to do all that.

    1. BACKUP your EXTERNAL SD card. IT WILL BE ERASED!
    2. Download the primary and secondary ROMs of your choice
    3. Do the necessary modifications to the secondary ROM as instructed by Berni (Do NOT use Windows Notepad for this. It corrupts the script. Download and use Notepad++ instead).
    4. Download the kernels that match your ROMs (as described in Berni's guide).
    5. Copy all to your INTERNAL SD (as I said, the external sd will be erased).
    6. Boot into recovery, connect to PC via ADB and prepare partitions as instructed by Berni (this is when your card loses all data).
    ... Detailed Setup Instructions:
    Some people reported trouble when trying to partition external SD cards larger than 8GB. So, I rewrote Berni's guide and added a little trick to help.
    Follow this guide to partition your EXTERNAL SD card:
    1. Turn off your phone. Keep Vol- 3D and Power keys until the LG logo shows. Release all keys. Wait a few sec.
    2. You are now in Recovery. Connect your phone to PC with a USB cable, press Windows Start Menu, type:
    and hit enter.
    3. In the new window that has opened type:
    adb shell
    cd /dev/block
    parted mmcblk1
    print
    For a 32 GB card, you'll get something like this:
    Code:
    Model: SD 00000 (sd/mmc)
    Disk /dev/block/mmcblk1: 31.4GB
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos
    
    Number  Start    End       Size      Type      File system   Flags
     1      [b]1049kB   31.4GB[/b]    31.4GB    primary   fat32         lba
    Write down the Start and End numbers
    For cards larger than 8GB, the End Number is shown in GB. Multiply it by 1000 to cnvert it to MB (31400MB in our example). Make sure you use values in MB and NOT in GB in the commands below.
    4. Type
    rm 1
    mkpartfs primary fat32 1049kB 29400MB ///!!! Instead of 1049kB, type the Start number you wrote down. Instead of 29400, type your End number minus 2000MB !!!
    mkpartfs primary ext2 29400MB 30100MB ///!!! Instead of 29400, type the end of your 1st partition. Instead of 30100, type the end of 1st partition plus 700MB !!!
    mkpartfs primary ext2 30100MB 31300MB ///!!! Instead of 30100, type the end of your 2nd partition. Instead of 31300, type the end of 2nd partition plus 1200MB !!!
    At this point, because not all cards have exactly the same capacity, you need to know exactly how much space you have left. Type:
    You get somehing like:
    Code:
    Model: SD 00000 (sd/mmc)
    Disk /dev/block/mmcblk1: 31.4GB
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos
    
    Number  Start    End       Size      Type       File system  Flags
            32.3kB   1049kB    1016kB    Free Space
     1      1049kB   29.4GB    29.4GB    primary    fat32        lba
     2      29.4GB   30.1GB    700MB     primary    ext2
     3      30.1GB   31.3GB    1200MB    primary    ext2
            31.3GB   31.4GB    [b]87.7MB[/b]    Free Space
    Note the size of your last free space (87.7MB here). Anything larger than 67.1MB will be sufficient.
    Type:
    mkpartfs primary ext2 31300MB 31387.7MB ///!!! 31300MB is the end of 3rd partition. 31387.7MB is the end of 3rd partition plus the remaining free space !!!
    print
    this time you get:
    Code:
    Model: SD 00000 (sd/mmc)
    Disk /dev/block/mmcblk1: 31.4GB
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos
    
    Number  Start    End       Size      Type       File system  Flags
     1      1049kB   29.4GB    29.4GB    primary    fat32        lba
     2      29.4GB   30.1GB    700MB     primary    ext2
     3      30.1GB   31.3GB    1200MB    primary    ext2
     4      31.3GB   31.4GB    90MB      primary    ext2
    5. Turn off your phone and boot again into recovery.
    Type:
    adb shell
    cd /dev/block
    mke2fs -T ext3 mmcblk1p2
    mke2fs -T ext3 mmcblk1p3
    mke2fs -T ext3 mmcblk1p4
    Your new partitions are now ready!

    7. Flash the ROMs (you may want to keep your original ROM and flash only the secondary one)
    8. Flash your primary kernel and reboot to system.

    Rebooting will now load your primary ROM.


    Partitioning the easy way!
    Instead of step 6, you may put your microSD card to your PC using a Card-Reader. Then you may use MiniTool, EaseUS or other freeware partitioning tool to create your partitions. Shrink your main partition and make three new PRIMARY EXT3 partitions AFTER your main one. The 1st (system2) must be 700MB. The second (data2) at least 1GB (you can make it larger if you like to install lots of apps)! The 3rd one (cache2) should be around 100MB. So, do the math and make sure you have shrunk your fat32 partition according to your needs first. After you're done, eject your card from the PC, put it in your phone and continue to step 7.
    Important: If for your own reasons you need to create more than the 4 primary partitions mentioned above, then you must convert your card to GPT (GNU Partitioning Table). Minitool has that option. This is because the default MBR (Master Boot Record) partitioning does not support more than 4 primary partitions on the same medium. This is also how the internal memory of our phones is divided into a large number of partitions (P920: 15, SU760: 17) and they are all primary.


    New: Easiest partitioning ever!
    A new app, AParted, has appeared on PlayStore. You can use it to create both MBR type (up to 4 primary) and GPT type (up to 128 primary) partitions.


    Instructions on ROM switching:

    1. Go to Play Store and install SManager
    2. Download the attachment from 1st post, unzip it and place the DualBoot folder on your phone (anywhere you like)
    3. Unzip your primary kernel, place boot.img into your DualBoot/img folder and rename it to boot1.img
    4. Do the same for your secondary kernel, but rename it to boot2.img
    5. Run SManager, browse to your DualBoot folder and select "Switch_ROM".
    6. Mark favourite and su options and run the script.

    Your phone will now reboot to your secondary ROM. Use the same script to go back to your primary ROM.

    7 (optional). SManager has a homescreen widget system. It lets you add buttons in your homescreens that will directly run the linked script (it has to be put in favourites first).

    Alternatively, you may download Flashify from Play Store and flash your desired Kernel.img from there. The advantage is that you may keep and test different kernels for the same ROM without having to rename them or put them in the IMG folder (less initial setup). The disadvantage is that it requires more clicks to switch every time.



    Instructions on Backup/Recovery/Wipe:
    These scripts work for EXTERNAL SD ROM installations!

    1. For full functionality, you must be on PRIMARY ROM (you can't expect to wipe or restore a running system)!
    2. Make sure you have at least 2GB free space on your external SD if you want to make a backup.
    3. Inside your DualBoot folder there is a script: "Recovery_Tools". Run the script with SManager (make sure you have the SU and Wlck buttons pressed). For Wlck to work, you must first enable it from SManager settings.
    4. You will now enter the Dual Boot Recovery Tools. There are several options. Type the number you want and press enter. All functions are pretty self-explanatory.

    It's very important to know that every backup overwrites the previous! The backup is kept in /sdcard/_ExternalSD/ROMs/rom2_backup. If you want to keep more than one backups, you can always rename the folder, but remember to change the name back if you want to restore your ROM.

    The "Advanced" option takes you to the "Wipes" menu. For a Factory Reset, you must wipe Data2 and Cache2. For a Full Format, in order to clean-install a new ROM, you may also wipe System2.


    Remove Dual Boot - Regain card space:
    This is pretty simple:

    1. Backup the contents of your SD card.
    2. Boot to your primary ROM
    3. Go to System Settings/Storage and select Erase SD card.


    Case scenario / Easy migration to dual boot:

    Say you have already installed CM10 in a single boot setup but you miss the 3D features and you want to restore your good old gingerbread backup or flash the new P920 ICS, but keep your CM10 setup as a secondary ROM in dual boot.
    1. Make sure you have at least 4GB free in your external SD.
    2. While still in CM10, use SManager to browse to your DualBoot folder, run the "Recovery_Tools" script and select option to "Backup/Migrate ROM1".
    (Go fry some bananas cause this will take around 6-7min!)
    3. Now backup your external SD to your PC and reboot to recovery.
    4. Follow the guide to partition your external SD.
    5. Restore your Gingerbread or P920-ICS backup or flash your favorite ROM and reboot into it.
    6. Restore your external SD backup from PC.
    7. Run the "Recovery_Tools" again and use the "Restore ROM2" option.
    (Eat your fried bananas cause this will take another 6-7 min!)

    Your original CM10 installation is now relocated to external SD as your secondary ROM. Use my instructions on ROM switching to boot into it.
    3
    [NEW] Dual Boot BT-Fixed CM10.1 Kernel

    I just uploaded a new Dual Boot CM10.1 Kernel. It's the one with working Bluetooth. I can't test it on all CM10.1 based variants, but it should work fine. Please report if you have any problems.
    3
    Good news: New app on PlayStore that can manage GPT partitions right from your phone!

    Sent from the 3rd dimension!
    3
    Updated op

    UPDATED SCRIPTS + TWO NEW SCRIPTS
    I wanted to do this for a long time but never found the time. I have finally managed to update 1st and 2nd posts. My new scripts work no matter where in your phone you place their folder and there are two new scripts to Factory Reset or completely Format your ROM2 installation.

    Please read the instructions again because some things have changed regarding folder tree.