[Galaxy Tab 2 7" Android Development] ketut.kumajaya:
GALAXY TAB 2 DUAL BOOT PROJECT

FOR NOW I FORBID ANYONE ELSE REUSE THIS STILL IN DEVELOPMENT DUAL BOOT PROJECT FOR HIS/HER OWN GALAXY TAB 2 PROJECT!

METHOD I:

I assume you're using CM/CM based 10.1 ROM. We will try to convert your primary ROM as a secondary ROM for test purpose:

Flash blackhawk's NEXT kernel over CWM, CWM Touch, TWRP, or Philz Touch recovery on your primary ROM

Boot your device, select "Boot Normally" on NEXT Boot Menu

Over "adb shell" or Terminal Emulator, we will create 117585*4=470340=470.34MB system.img for a secondary ROM:

su
mkdir -p /data/media/.secondrom
busybox dd if=/dev/zero of=/data/media/.secondrom/system.img bs=4k count=117585
mke2fs -T ext4 -b 4096 -m 0 -J size=4 -O ^resize_inode,^ext_attr,^huge_file,^has_journal -F /data/media/.secondrom/system.img
tune2fs -c 0 -i 0 /data/media/.secondrom/system.img
mkdir -p /data/local/tmp/system
busybox mount -t ext4 -o loop /data/media/.secondrom/system.img /data/local/tmp/system/
busybox cp -a /system/* /data/local/tmp/system/
sync
busybox umount -d /data/local/tmp/system

Format HIDDEN partition /dev/block/mmcblk0p11, we will use it as the secondary /cache partition:

mke2fs -T ext4 -b 4096 -m 0 -J size=16 -O ^resize_inode,^ext_attr,^huge_file /dev/block/mmcblk0p11
tune2fs -c 0 -i 0 /dev/block/mmcblk0p11

Reboot your device. NEXT automatically detects the presence of system.img and display a different option, select "Boot Secondary".

METHOD II:

Use PhilZ Touch 5.03.0 - blackhawk NEXT tool companion:

Flash blackhawk's NEXT kernel over CWM, CWM Touch, TWRP, or Philz Touch recovery on your primary ROM

Flash PhilZ Touch 5.03.0 P31xx repack: http://xdaforums.com/showthread.php?t=2202667 over CWM, CWM Touch, TWRP, or older Philz Touch recovery

Reboot into recovery, select "Recovery" (or "Primary Recovery" if your 2nd ROM already exist) when recovery boot menu appear

Flash blackhawk's NEXT tool, this is AROMA based flashable zip. You can use this tool to create and delete 2nd ROM system image. For Sammy/Sammy based ROM you need ~2.3GB internal storage free space and ~1.4521GB for CM/CM based ROM. I prepare ~1GB free space for user data

Reboot into recovery. PhilZ Touch automatically detects the presence of system.img, select "Secondary Recovery"

Go to "PhilZ Settings - GUI Preferences", set "Menu Height" to 16. Go to "Change Menu Colors - Change Menu Text Color", set menu color to different color. Save PhilZ Touch settings. This step to ensure the Primary and Secondary recovery have different view, so you will not go wrong for example flashing CM nightly to the 1st Sammy ROM :( Big thanks [MENTION=4666971]Phil3759[/MENTION]

Back to PhilZ Touch main menu, go to "Mounts and Storage". Try to mount and umount /system partition, if no error it's ready to flash your 2nd ROM

Flash CM/CM based ROM or Sammy/Sammy based ROM (depend on your system.img size). I mean Sammy ROM in flashable zip

You can use PhilZ Touch's Secondary Recovery to format 2nd ROM's /system partition, format 2nd ROM's /cache partition, clear 2nd ROM user data, 2nd ROM factory data reset. You can flash CM/CM based ROM, update it to the latest nightly, etc

Reflash blackhawk's NEXT kernel, this latest step very important or you will lost your dual boot environment or totally fail to boot if your 1st ROM is Sammy/Sammy based ROM

If all goes well, easy dual booting/easy switch between has successfully brought to your Galaxy Tab 2 by me :cool: So what the NEXT? Don't be shy to hit my Thanks button :laugh:

Dual Boot FAQ: http://xdaforums.com/showpost.php?p=27385922&postcount=7

FAQ #1-#3, #8-#13, #15, #17, #18, #20, #23, #25, applies here as well.

Thanks to:

1. [MENTION=289089]gokhanmoral[/MENTION] for some kernel patch and ramdisk http://xdaforums.com/showthread.php?t=1709686

2. [MENTION=4179740]droidphile[/MENTION] for dual boot related guide http://xdaforums.com/showthread.php?t=1709686

3. [MENTION=402300]amarullz[/MENTION] for AROMA http://xdaforums.com/showthread.php?t=1461712

4. [MENTION=4666971]Phil3759[/MENTION] for PhilZ Touch recovery http://xdaforums.com/showthread.php?t=2202667