Jump to content

[solved,tutorial updated]Dual boot possibility...


Guest Archer_cn

Recommended Posts

Guest Archer_cn

Hi all, I just wonder if anyone have interest in this.

As we all know, GB has less battery consumption and more smoothness while ICS+ have more features and better looks.

And technically it's possible to have both system install in our phones. I think all need to do is to hack the recovery a little bit and then can install a send rom in internal SDcard.

I hope someone, Romers, developers, anyone ,, can make this happen, 'cause I ( myabe not just me)really like it but I'm a nooob for this..

Search "boot manage" on Play market you can also see apps that serve this purpose(unfortunately G300 not supported).

Finally I manage to do it on my G300. It works, now I have Stock GB & ICS installed

 

Here is a how to tutorial, Please do read ervery detail and do it carefully if you want to proceed.

 

How it works: make internal sd smller so have free space to make 2 new partitons(system&data);, then modify boot.img(init.rc) to change default mount point to new partitions, and flash new boot.img to recovery block..Thus we lost recovery program but boot to new os. There's a way to keep both, but i don't konw how and no time to figure it out. so you can see , default os is not affected, can always start you phone with no problem.

 

 

update:

1. KK doesn't mount internal SD。same in newest recovery using kernel 3.4. 

2.script to switch systems,recovery:

(1) reboot recovery               #reboot to recovery or OS2

(2)dd if=/sdcard/recovery.img of=/dev/block/mmcblk0p16               #flash recovery ( be careful with dd command, make sure you write the correct partition!)

(3)dd if=/sdcard/boot2.img of=/dev/block/mmcblk0p16                    #flash sencond boot image to recovery for OS2 to boot.

(4)reboot oem-1                   # reboot to bootloader(fastboot)mode in case you want to flash something via fastboot.

 

you can save these scripts in gscipt for convenient use.( here assume you have recovery.img & boot2.img under /sdcard)

 

 

Edit: 1. if you don't want to touch internal storage for safety reason, can just do it on external sd( mmcblk1p1).make 3 primary partiton(fat32 first), it shall work too.

        2. second os must be ICS+.

 

 

Ok, Steps

 

1. Backup your internal SD data, because all data on it will be lost

2. boot your phone into recovery, connect phone with PC, and open a CMD window

3. Re-partition internal SD

adb shell
su
fdisk /dev/block/mmcblk0
p

then you should see current internal storage partitions;

post-902214-0-82478900-1395299288_thumb.

 

on G300 the correspondence is

mmcblk0p12-------system

mmcblk0p13-------Data

mmcblk0p15-------boot

mmcblk0p16-------recovery

mmcblk0p19-------internal SD only list the partitions that matters)

 

all we need to change is mmcblkop19!!! don't touch any other partitions

First, we need to delete mmcblkop19,

in CMD window, enter d, then 19

Command (m for help): [6nd
19
 

Now Create a new internal SD partition with smaller size.(it's very necessary to have a internal sd on most ROMs) the size is up to you.

Here I make a 500MB size for internal sd(mmcblk0p19)400M (second)system, and the rest for (second)Data.

 

Notes: 1). fdisk usagem for help d to delete a partiton, n to create new partition, p to print partition info, w to save all changes!

           2). First cylinder should be upper partition's last cylinder+2. ( it should be +1,but here don't know why have to be 2).

Command (m for help): [6np
p

Disk /dev/block/mmcblk0: 3909 MB, 3909091328 bytes
1 heads, 16 sectors/track, 477184 cylinders
Units = cylinders of 16 * 512 = 8192 bytes

              Device Boot      Start         End      Blocks  Id System
/dev/block/mmcblk0p1   *           1           3          20  4d Unknown
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk0p2               3          41         300  45 Unknown
Partition 2 does not end on cylinder boundary
/dev/block/mmcblk0p3              41       16681      133120   c Win95 FAT32 (LB
A)
Partition 3 does not end on cylinder boundary
/dev/block/mmcblk0p4           16681      477184     3684031+  5 Extended
Partition 4 does not end on cylinder boundary
/dev/block/mmcblk0p5           16897       18432       12288  6a Unknown
/dev/block/mmcblk0p6           18433       43008      196608  83 Linux
/dev/block/mmcblk0p7           43009       43520        4096  63 GNU HURD or Sys
V
/dev/block/mmcblk0p8           43521       43904        3072  58 Unknown
/dev/block/mmcblk0p9           44033       44544        4096  46 Unknown
/dev/block/mmcblk0p10          44545       44928        3072  4a Unknown
/dev/block/mmcblk0p11          45057       45440        3072  4b Unknown
/dev/block/mmcblk0p12          45569       94720      393216  83 Linux
/dev/block/mmcblk0p13          94721      193024      786432  83 Linux
/dev/block/mmcblk0p14         193025      193536        4096  47 Unknown
/dev/block/mmcblk0p15         193537      194560        8192  48 Unknown
/dev/block/mmcblk0p16         194561      197120       20480  60 Unknown
/dev/block/mmcblk0p17         197121      197632        4096  6c Unknown
/dev/block/mmcblk0p18         197633      207872       81920  83 Linux

Command (m for help): [6nn
n
First cylinder (16682-477184, default 16682): [6n207874
207874
Last cylinder or +size or +sizeM or +sizeK (207874-477184, default 477184): [6n
+500M
+500M

Command (m for help): [6np
p

Disk /dev/block/mmcblk0: 3909 MB, 3909091328 bytes
1 heads, 16 sectors/track, 477184 cylinders
Units = cylinders of 16 * 512 = 8192 bytes

              Device Boot      Start         End      Blocks  Id System
/dev/block/mmcblk0p1   *           1           3          20  4d Unknown
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk0p2               3          41         300  45 Unknown
Partition 2 does not end on cylinder boundary
/dev/block/mmcblk0p3              41       16681      133120   c Win95 FAT32 (LB
A)
Partition 3 does not end on cylinder boundary
/dev/block/mmcblk0p4           16681      477184     3684031+  5 Extended
Partition 4 does not end on cylinder boundary
/dev/block/mmcblk0p5           16897       18432       12288  6a Unknown
/dev/block/mmcblk0p6           18433       43008      196608  83 Linux
/dev/block/mmcblk0p7           43009       43520        4096  63 GNU HURD or Sys
V
/dev/block/mmcblk0p8           43521       43904        3072  58 Unknown
/dev/block/mmcblk0p9           44033       44544        4096  46 Unknown
/dev/block/mmcblk0p10          44545       44928        3072  4a Unknown
/dev/block/mmcblk0p11          45057       45440        3072  4b Unknown
/dev/block/mmcblk0p12          45569       94720      393216  83 Linux
/dev/block/mmcblk0p13          94721      193024      786432  83 Linux
/dev/block/mmcblk0p14         193025      193536        4096  47 Unknown
/dev/block/mmcblk0p15         193537      194560        8192  48 Unknown
/dev/block/mmcblk0p16         194561      197120       20480  60 Unknown
/dev/block/mmcblk0p17         197121      197632        4096  6c Unknown
/dev/block/mmcblk0p18         197633      207872       81920  83 Linux
/dev/block/mmcblk0p19         207874      268909      488288  83 Linux

Command (m for help): [6nn
n
First cylinder (268911-477184, default 268911): [6n268911
268911
Last cylinder or +size or +sizeM or +sizeK (268911-477184, default 477184): [6n
+400M
+400M

Command (m for help): [6np
p

Disk /dev/block/mmcblk0: 3909 MB, 3909091328 bytes
1 heads, 16 sectors/track, 477184 cylinders
Units = cylinders of 16 * 512 = 8192 bytes

              Device Boot      Start         End      Blocks  Id System
/dev/block/mmcblk0p1   *           1           3          20  4d Unknown
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk0p2               3          41         300  45 Unknown
Partition 2 does not end on cylinder boundary
/dev/block/mmcblk0p3              41       16681      133120   c Win95 FAT32 (LB
A)
Partition 3 does not end on cylinder boundary
/dev/block/mmcblk0p4           16681      477184     3684031+  5 Extended
Partition 4 does not end on cylinder boundary
/dev/block/mmcblk0p5           16897       18432       12288  6a Unknown
/dev/block/mmcblk0p6           18433       43008      196608  83 Linux
/dev/block/mmcblk0p7           43009       43520        4096  63 GNU HURD or Sys
V
/dev/block/mmcblk0p8           43521       43904        3072  58 Unknown
/dev/block/mmcblk0p9           44033       44544        4096  46 Unknown
/dev/block/mmcblk0p10          44545       44928        3072  4a Unknown
/dev/block/mmcblk0p11          45057       45440        3072  4b Unknown
/dev/block/mmcblk0p12          45569       94720      393216  83 Linux
/dev/block/mmcblk0p13          94721      193024      786432  83 Linux
/dev/block/mmcblk0p14         193025      193536        4096  47 Unknown
/dev/block/mmcblk0p15         193537      194560        8192  48 Unknown
/dev/block/mmcblk0p16         194561      197120       20480  60 Unknown
/dev/block/mmcblk0p17         197121      197632        4096  6c Unknown
/dev/block/mmcblk0p18         197633      207872       81920  83 Linux
/dev/block/mmcblk0p19         207874      268909      488288  83 Linux
/dev/block/mmcblk0p20         268911      317739      390632  83 Linux

Command (m for help): [6nn
n
First cylinder (16682-477184, default 16682): [6n317741
317741
Last cylinder or +size or +sizeM or +sizeK (317741-477184, default 477184): [6n

Using default value 477184

Command (m for help): [6np
p

Disk /dev/block/mmcblk0: 3909 MB, 3909091328 bytes
1 heads, 16 sectors/track, 477184 cylinders
Units = cylinders of 16 * 512 = 8192 bytes

              Device Boot      Start         End      Blocks  Id System
/dev/block/mmcblk0p1   *           1           3          20  4d Unknown
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk0p2               3          41         300  45 Unknown
Partition 2 does not end on cylinder boundary
/dev/block/mmcblk0p3              41       16681      133120   c Win95 FAT32 (LB
A)
Partition 3 does not end on cylinder boundary
/dev/block/mmcblk0p4           16681      477184     3684031+  5 Extended
Partition 4 does not end on cylinder boundary
/dev/block/mmcblk0p5           16897       18432       12288  6a Unknown
/dev/block/mmcblk0p6           18433       43008      196608  83 Linux
/dev/block/mmcblk0p7           43009       43520        4096  63 GNU HURD or Sys
V
/dev/block/mmcblk0p8           43521       43904        3072  58 Unknown
/dev/block/mmcblk0p9           44033       44544        4096  46 Unknown
/dev/block/mmcblk0p10          44545       44928        3072  4a Unknown
/dev/block/mmcblk0p11          45057       45440        3072  4b Unknown
/dev/block/mmcblk0p12          45569       94720      393216  83 Linux
/dev/block/mmcblk0p13          94721      193024      786432  83 Linux
/dev/block/mmcblk0p14         193025      193536        4096  47 Unknown
/dev/block/mmcblk0p15         193537      194560        8192  48 Unknown
/dev/block/mmcblk0p16         194561      197120       20480  60 Unknown
/dev/block/mmcblk0p17         197121      197632        4096  6c Unknown
/dev/block/mmcblk0p18         197633      207872       81920  83 Linux
/dev/block/mmcblk0p19         207874      268909      488288  83 Linux
/dev/block/mmcblk0p20         268911      317739      390632  83 Linux
/dev/block/mmcblk0p21         317741      477184     1275552  83 Linux

Command (m for help): [6n

now, last step, save all changes. before you do this ,make sure that no other partitions but old mmcblk0p19 are touched!

Command (m for help): [6nw

4. Format new partitions.

reboot to recovery again.

use adb..

adb shell
# mke2fs -T ext4 -b4096 -m 0 /dev/block/mmcblk0p20
# mke2fs -T ext4 -b4096 -m 0 /dev/block/mmcblk0p21

5. make a new rom for new partitons.

1). we need to edit boot.img. can use android kitchen,unpack boot.img  to edit init.rc, replace all mmcblk0p12 with mmcblk0p20

mmcblk0p13 to mmcblk0p21, then repack boot.img.

2).updater script in a zip rom (META-INF\com\google\android\updater-script)

add these 2 lines to the beginning

unmount("/data");
unmount("/system");

and replacement:

mmcblk0p12 >> mmcblock0p20
mmcblk0p13 >> mmcblk0p21
mmcblk0p15 >> mmcblk0p16

done. repack rom with new boot.img and flash it to second system...Then when you enter recovery, you actually booting the second android os.

Normal reboot will boot into default os.

 

There's a better way to switch os with script , will update later..

 

 

Here is the slimv13 rom I moded to fit new partitions,if you already done the repartition, flash this via recovery and then reboot into recovery, you should see it booting.

Moded ROM Download:

http://www.speedyshare.com/zJkZF/download/B952-slim-v13Moded-2ndOS.zip

Edited by Archer_cn
Link to comment
Share on other sites

Guest Paulzie

Am curious if you get it working though I have no interest in going to GB from ICS. I found ICS (when overclocked and tweaked) performs great. Eg: Slim, Stock plus or MIUI 2.7.6 ROMs.

More of an issue with performance are newer MIUI V5 or JB ROMs. So would be curious on your findings as any success would allow me to keep running my production ICS OS and test newer revisions of those ROMs to see if they've improved performance.

Link to comment
Share on other sites

  • 7 months later...
Guest Archer_cn

Am curious if you get it working though I have no interest in going to GB from ICS. I found ICS (when overclocked and tweaked) performs great. Eg: Slim, Stock plus or MIUI 2.7.6 ROMs.

More of an issue with performance are newer MIUI V5 or JB ROMs. So would be curious on your findings as any success would allow me to keep running my production ICS OS and test newer revisions of those ROMs to see if they've improved performance.

Now I do find a way to do it. just use fdisk command to re-partition internal SD to 2 extra partition as System & Data for 2nd OS. and a little modification to the boot.img and CWM updater-script ,then can install ICS+ rom on internal memory.

Link to comment
Share on other sites

Now I do find a way to do it. just use fdisk command to re-partition internal SD to 2 extra partition as System & Data for 2nd OS. and a little modification to the boot.img and CWM updater-script ,then can install ICS+ rom on internal memory.

 

Any chance of a tutorial/guide?

Link to comment
Share on other sites

Now I do find a way to do it. just use fdisk command to re-partition internal SD to 2 extra partition as System & Data for 2nd OS. and a little modification to the boot.img and CWM updater-script ,then can install ICS+ rom on internal memory.

Lol, couldn't you make a video or something as this is a pretty big find?

Link to comment
Share on other sites

  • 2 weeks later...
Guest Archer_cn

no, I won't post a video, don't have time for that and no interest. But I'll update post with a short version of [how to]

 

yh. or just proove that it's not fake with a video. Seems hard to belive tbh

Link to comment
Share on other sites

Thank you for this tutorial! But is there any way to get recovery back? And can I use KitKat and GB together? If yes, which one should I install as second one?

Edited by Guest
Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...
Guest vahit.lafci

You can boot 2nd os from bootloader instead of recovery i think.

Edit: sorry this isnt possible. Can we contact with boot manager app's developer?

Edited by vahit.lafci
Link to comment
Share on other sites

Guest vahit.lafci

Hi guys i have 8gb class10 sd card. İ flashed system data and cache. İm using cm 10.1 rom is working fast enough. Also i modified TWRP fstab file i can flash zips and using backup restore function. It is awesome :)

Link to comment
Share on other sites

Hi guys i have 8gb class10 sd card. İ flashed system data and cache. İm using cm 10.1 rom is working fast enough. Also i modified TWRP fstab file i can flash zips and using backup restore function. It is awesome :)

So you created new partitions on sdcard insted of internal storage reserved for recovery? So you have 2 systems + recovery too? Can u make simple tutorial?

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.