• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!
  • Fill out your device list and let everyone know which phones you have!    Edit Your Device Inventory

[GUIDE]How To Dual Boot Two Roms almost ANY Device

Status
Not open for further replies.
Search This thread

<JohnCarter>

Senior Member
Jun 1, 2012
761
1,770
Ranchi
Ever wanted to try a new rom without having to waste our time on making backups then trying the rom and then again restoring it, and if another rom pleases you at the moment , you'll have to perform the same drill again and again ... Well Now NO MORE of this frustrating business.

Here i present you my very own method of Dual Booting almost ANY two roms you like on YOUR device.
But make sure to try at your risk.. as per DoomLord many devices can be hardbricked too.

Do Not use this method
on newer (post 2012) qualcomm chipsets the TA and Bootloader, reside on similar partitions... if u screw with these partitions device gets HARD BRICKED!



As the partition maps vary from device to device it may not work for you and you may get your device hard bricked!
Also your device must use older bootloader bypass based kernels i.e boot.img format and has SD-card slots for this method to work !!

Before we begin here's what Dual Booting means :
- Dual booting is the process through which you can switch between any two or more roms without the need of wiping data or making backups before flashing ,all you need to do is switch between the roms ,meanwhile all the apps you've insatlled remain intact in their specific rom.

for ex- If you are using cm10 and you have installed a lot of apps, and you want to test other rom ,but you don't want the fuss of backing up then flashing.. This dual booting method is for you !!​

So to begin with make sure you meet the following prerequisites :
  • Your Device which can run android :p
  • an class 6 or above SD-Card
  • an Os on the PC to make partitions on the SD-card
  • ubuntu for kernel specific changes
  • notepad ++
  • ConCentRation

If you meet all the above requirements you are good to go ;)

Now to Before we get our hand in the filth remember : You need to have and an SD-Card that's class 6 or above because we would be using it extensively , and slow cards may not keep up

SO LET'S ROLL :

In this method [/CENTER]
Primary Rom = The rom which is modded and remains on the Sd-ext partitons
Secondary Rom = any rom you wish (any android version for ex- cm9 , cm10.1 and even stock !) [ make sure that the secondary rom doesn't use sd-ext partitions]​

I would be dividing the process in tow steps : 1) Kernel level changes and 2)SD-card and Rom level changes

1- Kernel Level Changes :
Get the source of any kernel for your device (if you don't know what's kernel compilation you can go to xda-university to learn it.)

-Now open the defconfig file (usually present in : "arch/arm/config" -folder)
-Search for LBDAF and then change the line consisting it as follows :
Code:
CONFIG_LBDAF=y
and now compile the kernel
This is done so that our Primary Rom can support multiple SD-ext partitons
-Now grab the boot.img of your Primary Rom , unpack it using any tool of your convenience(Google : chanpionwimmer's kernel tools -- i use it ) now open the ramdisk part , then open init.rc
-Search for the rom's mounting functions it will be like:
Code:
mount yaffs2 [email protected] /system
mount yaffs2 [email protected] /system ro remount
it will vary from device to device.. proceed only if you know the correct mount points for your device.. otherwise you WILL hardbrick your device

-Now replace the following lines from the mounting functions to this Make sure you know the correct mount points of your device :
Code:
# Mount SD-SYSTEM
    wait /dev/block/mmcblk0p2
    wait /dev/block/mmcblk0p2
    wait /dev/block/mmcblk0p2
    wait /dev/block/mmcblk0p2
mount ext4 /dev/block/mmcblk0p2 /system
mount ext4 /dev/block/mmcblk0p2 /system ro remount

# Mount SD-DATA
    wait /dev/block/mmcblk0p3
    wait /dev/block/mmcblk0p3
    wait /dev/block/mmcblk0p3
    wait /dev/block/mmcblk0p3
    mount ext4 /dev/block/mmcblk0p3 /data nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue

# Mount SD-CACHE
    wait /dev/block/mmcblk0p4
    wait /dev/block/mmcblk0p4
    wait /dev/block/mmcblk0p4
    wait /dev/block/mmcblk0p4
    mount ext4 /dev/block/mmcblk0p4 /cache nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue

-Now recompile the kernel and you are good to go

more in the 2nd post ..​
 
Last edited:

<JohnCarter>

Senior Member
Jun 1, 2012
761
1,770
Ranchi
Here now comes the SD-Card and Rom level changes :

YOU MUST USE ATLEAST CLASS 6 OR ABOVE SDCARD WITH MINIMUM 8GB CAPACITY

First you need 3 EXT4 partitions on SD-card, using minitool partition wizard
1) around 400 MB - SD-SYSTEM (ext4)
2) around 1 GB (or can be less) - SD-DATA(ext4 format),
3)around 75MB (can be less) SD-CACHE(ext4 format) (refer to the screenshot):
dual_zps2a02cd36.jpg


Rom level changes :

Get the updater-script of your Primary rom and find for these lines (Will differ from device to device - but basically the format is same )
Code:
format("yaffs2", "MTD", "system", "0", "/system");
mount("yaffs2", "MTD", "system", "/system");
package_extract_dir("system", "/system");

Now replace it with :
Code:
run_program("/sbin/busybox", "mount", "-t", "auto", "/dev/block/mmcblk0p2", "/system");
run_program("/sbin/busybox", "rm", "-rf", "/system/*");
package_extract_dir("system", "/system");

-what we are doing here is extracting the sustem files to the sd-ext partition we just created earlier

save it and replace this updater-script in the original Primary rom and also replace the boot.img with the one you made earlier.

That's it.If you have followed the guide correctly you can Dual boot any Rom on your device

Now flash the primary rom first.. and then any rom you choose as the secondary rom (PROVIDED IT DOESN"T USE SD-Ext partitions..) and flash it

REMEMBER DO NOT wipe data before installing the secondary rom
If you want to change your secondary rom DO NOT WIPE DATA instead goto recovery -
if in CWM or philz -go to mounts and storage and format system , data and cache

For Switching roms :
-put the boot.img of primary rom in the root of your sd-card(not in any directory) reanme it primary.img
-put the boot.img of secondary rom in the root of your sd-card(not in any directory) reanme it sec.img
-get terminal emulator app
-type
Code:
 su
flash_image boot /sdcard/primary.img (or secondary.img)


But STOP here are some restrictions of this method :

You must make sure your device uses boot.img format and you know your device's correct mount points !! if you do it wrong you WILL hard brick your device !!

1. For The secondary rom you CANNOT use scripts like int2ext, etc.
2. Also you CANNOT use pll2 OC method in Secondary ROM
3. The edited cm10beta 6 (primary rom) is clocked at 600mhz, so NO chances of burnt nand.
4. You can choose ANY rom as secondary ROM provided it does not violate the first 2 clauses, that is, it should not use sd-ext partitions
5. The process is only for people having class 6 or higher sd card.

PS : This has taken a lot of effort and time so please don't go on commenting "This is useless" , "i don't like it" ,etc. If you don't like it, you are free to leave.
 
Last edited:

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,191
39,699
Pune
...
-Now grab the boot.img of your Primary Rom , unpack it using any tool of your convenience(Google : chanpionwimmer's kernel tools -- i use it ) now open the ramdisk part , then open init.rc
-Search for the rom's mounting functions it will be like:
Code:
mount yaffs2 [email protected] /system
mount yaffs2 [email protected] /system ro remount
it can vary from device to device..
-Now replace the following lines from the mounting functions to this :
Code:
# Mount SD-SYSTEM
    wait /dev/block/mmcblk0p2
    wait /dev/block/mmcblk0p2
    wait /dev/block/mmcblk0p2
    wait /dev/block/mmcblk0p2
mount ext4 /dev/block/mmcblk0p2 /system
mount ext4 /dev/block/mmcblk0p2 /system ro remount

# Mount SD-DATA
    wait /dev/block/mmcblk0p3
    wait /dev/block/mmcblk0p3
    wait /dev/block/mmcblk0p3
    wait /dev/block/mmcblk0p3
    mount ext4 /dev/block/mmcblk0p3 /data nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue

# Mount SD-CACHE
    wait /dev/block/mmcblk0p4
    wait /dev/block/mmcblk0p4
    wait /dev/block/mmcblk0p4
    wait /dev/block/mmcblk0p4
    mount ext4 /dev/block/mmcblk0p4 /cache nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue

..


PLEASE DONT POST INCORRECT INFORMATION!

the partition maps vary from device to device!

on newer (post 2012) qualcomm chipsets the TA and Bootloader, reside on similar partitions... if u screw with these partitions device gets HARD BRICKED!


also not all devices use standard boot.img format...

if u were able to get it to work on a particular device atleast test it out on 8-10 different devices from different vendors and different platforms before posting such threads...
 

-NickHalden-

Senior Member
Apr 19, 2012
1,028
2,059
Gotham
techgeekal.com
PLEASE DONT POST INCORRECT INFORMATION!

the partition maps vary from device to device!

on newer (post 2012) qualcomm chipsets the TA and Bootloader, reside on similar partitions... if u screw with these partitions device gets HARD BRICKED!


also not all devices use standard boot.img format...

if u were able to get it to work on a particular device atleast test it out on 8-10 different devices from different vendors and different platforms before posting such threads...

I truly second that. The information on this thread is valid only for some devices. You can seriously screw a number of devices.
 

<JohnCarter>

Senior Member
Jun 1, 2012
761
1,770
Ranchi
PLEASE DONT POST INCORRECT INFORMATION!

the partition maps vary from device to device!

on newer (post 2012) qualcomm chipsets the TA and Bootloader, reside on similar partitions... if u screw with these partitions device gets HARD BRICKED!


also not all devices use standard boot.img format...

if u were able to get it to work on a particular device atleast test it out on 8-10 different devices from different vendors and different platforms before posting such threads...

Ok thanks for the info... i'll give a caution for not using this method on newer devices
 
Status
Not open for further replies.

Top Liked Posts

  • There are no posts matching your filters.
  • 6
    Ever wanted to try a new rom without having to waste our time on making backups then trying the rom and then again restoring it, and if another rom pleases you at the moment , you'll have to perform the same drill again and again ... Well Now NO MORE of this frustrating business.

    Here i present you my very own method of Dual Booting almost ANY two roms you like on YOUR device.
    But make sure to try at your risk.. as per DoomLord many devices can be hardbricked too.

    Do Not use this method
    on newer (post 2012) qualcomm chipsets the TA and Bootloader, reside on similar partitions... if u screw with these partitions device gets HARD BRICKED!



    As the partition maps vary from device to device it may not work for you and you may get your device hard bricked!
    Also your device must use older bootloader bypass based kernels i.e boot.img format and has SD-card slots for this method to work !!

    Before we begin here's what Dual Booting means :
    - Dual booting is the process through which you can switch between any two or more roms without the need of wiping data or making backups before flashing ,all you need to do is switch between the roms ,meanwhile all the apps you've insatlled remain intact in their specific rom.

    for ex- If you are using cm10 and you have installed a lot of apps, and you want to test other rom ,but you don't want the fuss of backing up then flashing.. This dual booting method is for you !!​

    So to begin with make sure you meet the following prerequisites :
    • Your Device which can run android :p
    • an class 6 or above SD-Card
    • an Os on the PC to make partitions on the SD-card
    • ubuntu for kernel specific changes
    • notepad ++
    • ConCentRation

    If you meet all the above requirements you are good to go ;)

    Now to Before we get our hand in the filth remember : You need to have and an SD-Card that's class 6 or above because we would be using it extensively , and slow cards may not keep up

    SO LET'S ROLL :

    In this method [/CENTER]
    Primary Rom = The rom which is modded and remains on the Sd-ext partitons
    Secondary Rom = any rom you wish (any android version for ex- cm9 , cm10.1 and even stock !) [ make sure that the secondary rom doesn't use sd-ext partitions]​

    I would be dividing the process in tow steps : 1) Kernel level changes and 2)SD-card and Rom level changes

    1- Kernel Level Changes :
    Get the source of any kernel for your device (if you don't know what's kernel compilation you can go to xda-university to learn it.)

    -Now open the defconfig file (usually present in : "arch/arm/config" -folder)
    -Search for LBDAF and then change the line consisting it as follows :
    Code:
    CONFIG_LBDAF=y
    and now compile the kernel
    This is done so that our Primary Rom can support multiple SD-ext partitons
    -Now grab the boot.img of your Primary Rom , unpack it using any tool of your convenience(Google : chanpionwimmer's kernel tools -- i use it ) now open the ramdisk part , then open init.rc
    -Search for the rom's mounting functions it will be like:
    Code:
    mount yaffs2 [email protected] /system
    mount yaffs2 [email protected] /system ro remount
    it will vary from device to device.. proceed only if you know the correct mount points for your device.. otherwise you WILL hardbrick your device

    -Now replace the following lines from the mounting functions to this Make sure you know the correct mount points of your device :
    Code:
    # Mount SD-SYSTEM
        wait /dev/block/mmcblk0p2
        wait /dev/block/mmcblk0p2
        wait /dev/block/mmcblk0p2
        wait /dev/block/mmcblk0p2
    mount ext4 /dev/block/mmcblk0p2 /system
    mount ext4 /dev/block/mmcblk0p2 /system ro remount
    
    # Mount SD-DATA
        wait /dev/block/mmcblk0p3
        wait /dev/block/mmcblk0p3
        wait /dev/block/mmcblk0p3
        wait /dev/block/mmcblk0p3
        mount ext4 /dev/block/mmcblk0p3 /data nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue
    
    # Mount SD-CACHE
        wait /dev/block/mmcblk0p4
        wait /dev/block/mmcblk0p4
        wait /dev/block/mmcblk0p4
        wait /dev/block/mmcblk0p4
        mount ext4 /dev/block/mmcblk0p4 /cache nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue

    -Now recompile the kernel and you are good to go

    more in the 2nd post ..​
    4
    ...
    -Now grab the boot.img of your Primary Rom , unpack it using any tool of your convenience(Google : chanpionwimmer's kernel tools -- i use it ) now open the ramdisk part , then open init.rc
    -Search for the rom's mounting functions it will be like:
    Code:
    mount yaffs2 [email protected] /system
    mount yaffs2 [email protected] /system ro remount
    it can vary from device to device..
    -Now replace the following lines from the mounting functions to this :
    Code:
    # Mount SD-SYSTEM
        wait /dev/block/mmcblk0p2
        wait /dev/block/mmcblk0p2
        wait /dev/block/mmcblk0p2
        wait /dev/block/mmcblk0p2
    mount ext4 /dev/block/mmcblk0p2 /system
    mount ext4 /dev/block/mmcblk0p2 /system ro remount
    
    # Mount SD-DATA
        wait /dev/block/mmcblk0p3
        wait /dev/block/mmcblk0p3
        wait /dev/block/mmcblk0p3
        wait /dev/block/mmcblk0p3
        mount ext4 /dev/block/mmcblk0p3 /data nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue
    
    # Mount SD-CACHE
        wait /dev/block/mmcblk0p4
        wait /dev/block/mmcblk0p4
        wait /dev/block/mmcblk0p4
        wait /dev/block/mmcblk0p4
        mount ext4 /dev/block/mmcblk0p4 /cache nosuid nodev noatime nodiratime barrier=0 data=ordered commit=15 noauto_da_alloc nouser_xattr errors=continue

    ..


    PLEASE DONT POST INCORRECT INFORMATION!

    the partition maps vary from device to device!

    on newer (post 2012) qualcomm chipsets the TA and Bootloader, reside on similar partitions... if u screw with these partitions device gets HARD BRICKED!


    also not all devices use standard boot.img format...

    if u were able to get it to work on a particular device atleast test it out on 8-10 different devices from different vendors and different platforms before posting such threads...
    2
    Here now comes the SD-Card and Rom level changes :

    YOU MUST USE ATLEAST CLASS 6 OR ABOVE SDCARD WITH MINIMUM 8GB CAPACITY

    First you need 3 EXT4 partitions on SD-card, using minitool partition wizard
    1) around 400 MB - SD-SYSTEM (ext4)
    2) around 1 GB (or can be less) - SD-DATA(ext4 format),
    3)around 75MB (can be less) SD-CACHE(ext4 format) (refer to the screenshot):
    dual_zps2a02cd36.jpg


    Rom level changes :

    Get the updater-script of your Primary rom and find for these lines (Will differ from device to device - but basically the format is same )
    Code:
    format("yaffs2", "MTD", "system", "0", "/system");
    mount("yaffs2", "MTD", "system", "/system");
    package_extract_dir("system", "/system");

    Now replace it with :
    Code:
    run_program("/sbin/busybox", "mount", "-t", "auto", "/dev/block/mmcblk0p2", "/system");
    run_program("/sbin/busybox", "rm", "-rf", "/system/*");
    package_extract_dir("system", "/system");

    -what we are doing here is extracting the sustem files to the sd-ext partition we just created earlier

    save it and replace this updater-script in the original Primary rom and also replace the boot.img with the one you made earlier.

    That's it.If you have followed the guide correctly you can Dual boot any Rom on your device

    Now flash the primary rom first.. and then any rom you choose as the secondary rom (PROVIDED IT DOESN"T USE SD-Ext partitions..) and flash it

    REMEMBER DO NOT wipe data before installing the secondary rom
    If you want to change your secondary rom DO NOT WIPE DATA instead goto recovery -
    if in CWM or philz -go to mounts and storage and format system , data and cache

    For Switching roms :
    -put the boot.img of primary rom in the root of your sd-card(not in any directory) reanme it primary.img
    -put the boot.img of secondary rom in the root of your sd-card(not in any directory) reanme it sec.img
    -get terminal emulator app
    -type
    Code:
     su
    flash_image boot /sdcard/primary.img (or secondary.img)


    But STOP here are some restrictions of this method :

    You must make sure your device uses boot.img format and you know your device's correct mount points !! if you do it wrong you WILL hard brick your device !!

    1. For The secondary rom you CANNOT use scripts like int2ext, etc.
    2. Also you CANNOT use pll2 OC method in Secondary ROM
    3. The edited cm10beta 6 (primary rom) is clocked at 600mhz, so NO chances of burnt nand.
    4. You can choose ANY rom as secondary ROM provided it does not violate the first 2 clauses, that is, it should not use sd-ext partitions
    5. The process is only for people having class 6 or higher sd card.

    PS : This has taken a lot of effort and time so please don't go on commenting "This is useless" , "i don't like it" ,etc. If you don't like it, you are free to leave.