• 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

[Official] Dual Boot Patcher [Mi Max 2 / Oxygen]

Search This thread

Kapil Tapsi

Senior Member
Sep 16, 2014
570
1,501
New Delhi
logo.png

DUAL BOOT PATCHER​

DualBootPatcher is an open-source app that allows multiple ROMs to be installed on a single Android device. It does its best to work with existing code and does not require explicit support from ROMs. This will allow any number of ROMs to be installed at the same time. It works by patching the secondary ROM's installation scripts and boot image to load the ROM files from an alternate location (/system/multiboot, /cache/multiboot, and /data/multiboot). Because of the way this is implemented, no changes to the primary ROM are necessary.

Warning: This method requires one time factory reset.

How to use the patcher
Android
Download the patcher apk and run it. Tap "Patch Zip File" from the navigation drawer and choose the file you want to patch.

Windows (GUI)
Double click DualBootPatcher.exe and choose the file you want to patch.

--------

After patching the zip file, a new file, like some_rom_data-slot.zip file will be created. For example,

Lineage-14.1-oxygen.zip

After patching would create a new
Lineage-14.1-oxygen_data-slot.zip
If you want to root secondary rom, then download Magisk 12.zip given below(Do not use other version, you can update that later from magisk manager app) and patch it like you did with rom

Instructions for dual booting
Before doing anything, download the Dual Boot Patcher.apk from the download section below.

The patcher offers several locations for installing ROMs:
Primary: This is normally used for installing a zip to the primary ROM. It is not required, but is strongly recommended because it has code to prevent the zip from inadvertently affecting other ROMs.
Secondary: Secondary is the first multiboot installation location. It installs to the system partition. This is a good spot for installing a second ROM because it doesn't take any space away from the internal storage.
Multi-slots: There are 3 multislots: multi-slot-1, multi-slot-2, multi-slot-3. These install to the cache partition. This is specifically for devices, like the Galaxy S4, that have a massive cache partition.
Data-slots: There can be an unlimited number of data slots. These install to the data partition and eat up space on the internal storage. This is useful for devices where the system partition is nearly full and the cache partition is tiny. These slots are named "data-slot-[id]", where "id" is something you provide in the app.
Extsd-slots: There can be an unlimited number of extsd slots. These install to the external SD card, which is useful as it keeps the ROMs off of the internal storage. Note that the ROM's data files are still stored on the data partition.

Now Let's Start

1) Boot into recovery
2) Make a backup of /system /data /boot on SD Card (it's important to make it on sd card!)
3) Wipe internal storage (it will erase all of your data including photos, music etc on internal storage. So make sure you moved them or made their backup)
4) Restore your backup and boot to your ROM
5) Install Dual Boot Patcher.
6) Install patched rom as secondary on /system or on /data partition - it's your choice. There is lot of space for 3 roms in /system.
If you want to root secondary ROM and flash patched magiskv12.
7) Select your secondary ROM in ROM list and reboot.

Steps to be followed on Secondary Rom
8) Install Dual Boot Patcher.
9) Install MagiskManager.apk (see attachment)
10) Open Magisk Manager
11) Go to Modules-> press "+" button -> search for Magisk_v15.3.zip -> hold your finger on it -> press "Open". Wait for installation end. Now press close button. Don't restart
12) Open Dual Boot Patcher -> confirm for change current kernel
13) Reboot and voila! You have fully working secondary ROM with Magisk!

FAQ's (FAQ)
Do I need to wipe again for third or next rom?
No, wiping is only required for one time, you can flash as many roms(your device can handle) after that.

Switch the ROM if something doesn't work properly?
You can flash the DualBootUtilities zip from recovery. It will provide a menu interface that allows switching to the various ROMs.

If you have TWRP, you can also switch manually by tapping Install -> Images (bottom right) -> Go to /sdcard/MultiBoot/[Your ROM]/ -> flash boot.img.

Wipe /cache, /data, /system, or dalvik-cache?
The easiest way is to do it from the app while booted in another ROM. Just go to "Roms" in the navigation drawer, tap the 3 dots options menu for the ROM you want to wipe, and tap "Wipe ROM".

NOTE: Don't use the recovery's built-in wiping abilities as that may delete non-primary ROMs!

Update the primary ROM?
Patch the zip for primary and flash it. The "primary" installation target is designed so that other ROMs won't be affected when you want to flash something for the primary ROM.

Update a non-primary ROM?
Patch and flash the zip exactly like how you did it the first time.
Flash a mod or custom kernel for the primary ROM?
Patch it for primary before flashing. If the zip does not wipe /cache, it is also safe to flash it directly.
Flash a mod or custom kernel for a non-primary ROM?
Just patch and flash it

Note:
You must always select 'Data-slots' as installation location for secondary roms on Redmi Note 4x. You can also use 'Extsd-slots' if you want to install on external storage.
If your using MIUI (Multirom, Xiaomi.eu, etc), you may need to enable documents app by going to Settings> Installed Apps before trying to patch any file in DBP.
Don't use official MIUI as primary rom.
If you're not able to boot, your phone vibrates 5 times and then reboot to TWRP after installing secondary rom, it might be that your data partition is encrypted. To fix this follow the instructions below:
First backup all your data including Internal Storage, then boot to TWRP>WIPE>FORMAT DATA then type 'yes' and tap enter. Now reboot and retry DBP.

Source/Credits:
https://dbp.noobdev.io
@chenxiaolong
@bad_request (Thanks for the XDA Post And Guide)
@mario_R (For step by step guide and errors.)
Downloads: https://dbp.noobdev.io/downloads/ and Download latest files

~ Hit Thanks button below if I helped you ~
 

Attachments

  • MagiskManager.apk
    2.3 MB · Views: 422
  • Magisk-v12.0.zip
    6.2 MB · Views: 392
  • Magisk-v15.3.zip
    5.8 MB · Views: 322
Last edited:

Mgphyo126

Member
Jan 27, 2016
23
5
I just tried last 5 days. When I choose second rom and reboot, it goes into recovery. Can't boot up second rom. Renew primary rom,wipe data and try dbp again and again. But not successed. Now my primary rom is Los 14.1 and trying second rom as miui global dev rom 8.1.11. Please help me.
 
Last edited:

drmuruga

Senior Member
Oct 9, 2015
964
241
sivakasi
...which is an issue pertaining to the RR custom rom and has nothing to do with this multi boot tool ;)

Yes , this tool working great , my problem is known to roms .
Patch roms and files in data slot not secondary slot in which is only one room can boot as secondary. Data slot for multiple roms flashing. And I never update ramdisk which leads to boot into recovery instead of system .
 

mario_R

Senior Member
Mar 28, 2014
399
477
25
I just tried last 5 days. When I choose second rom and reboot, it goes into recovery. Can't boot up second rom. Renew primary rom,wipe data and try dbp again and again. But not successed. Now my primary rom is Los 14.1 and trying second rom as miui global dev rom 8.1.11. Please help me.

Anyone?
 

kalawy

Senior Member
May 18, 2013
190
35
28
alexandria
when patching the primary rom (update ramdisk)it reboots to recovery after the vibrations
didn't install any secondery roms -- yet
primary : MIUI globeROM 7.12.21
app version : 9.3.0.r327.gb3914310-snapshot
if it's relevant > i have magisk 15.3 --magisk edits the boot.img > may the issue be related to that ? was i supposed to remove magisk before? magisk in not the problem > i tried with original boot,img with supersu
edit : also i remember formatting the data before flashing this rom .. wil i have to reformat ?! >>>>> seems that miui encrypts the data with every flash !!
edit 2: i skipped ramdisk update for the primary rom and flashed a secondery rom in /system -- so .. is it the format issue ? if i format now will i have to reformat everytime i flash a rom ?? bcoz i clearly remember formatting before installing this primary rom
edit3 : problem solved with formating data again !!
 
Last edited:

kalawy

Senior Member
May 18, 2013
190
35
28
alexandria
DON'T set lock screen !!
you will end up locked away from your primary rom

----------
in my case the primary was globerom and secondary was lineage os
---------
if you already locked from your rom you can boot twrp and open terminal and write

cd data/system
rm *.key

and reboot
 
Last edited:
  • Like
Reactions: ddubz

mario_R

Senior Member
Mar 28, 2014
399
477
25
when patching the primary rom (update ramdisk)it reboots to recovery after the vibrations
didn't install any secondery roms -- yet
primary : MIUI globeROM 7.12.21
app version : 9.3.0.r327.gb3914310-snapshot
if it's relevant > i have magisk 15.3 --magisk edits the boot.img > may the issue be related to that ? was i supposed to remove magisk before? magisk in not the problem > i tried with original boot,img with supersu
edit : also i remember formatting the data before flashing this rom .. wil i have to reformat ?! >>>>> seems that miui encrypts the data with every flash !!
edit 2: i skipped ramdisk update for the primary rom and flashed a secondery rom in /system -- so .. is it the format issue ? if i format now will i have to reformat everytime i flash a rom ?? bcoz i clearly remember formatting before installing this primary rom
edit3 : problem solved with formating data again !!

Good that you solved it. But for your knowledge and to any user: updating RAMDISK is not necessary. It's necessary only for "App sharing" feature, but I don't recommend it because it causes sometimes bootloops on secondary ROM. Even even creator of DualBoot patcher said it may be unstable.

If you want to root secondary rom, then download latest magisk and patch it like you did with rom
Thanks for mention me in your thread, but remove that line, it will cause bootloop. First you need to patch Magisk_v12.zip and install it, then install latest Magisk_v15.3.zip as a module in MagiskManager. Like I wrote in my guide
 
Last edited:
  • Like
Reactions: kalawy

kalawy

Senior Member
May 18, 2013
190
35
28
alexandria
Good that you solved it. But for your knowledge and to any user: updating RAMDISK is not necessary. It's necessary only for "App sharing" feature, but I don't recommend it because it causes sometimes bootloops on secondary ROM. Even even creator of DualBoot patcher said it may be unstable.
I figured that out ... the hard way :crying:
 

Kapil Tapsi

Senior Member
Sep 16, 2014
570
1,501
New Delhi
Good that you solved it. But for your knowledge and to any user: updating RAMDISK is not necessary. It's necessary only for "App sharing" feature, but I don't recommend it because it causes sometimes bootloops on secondary ROM. Even even creator of DualBoot patcher said it may be unstable.


Thanks for mention me in your thread, but remove that line, it will cause bootloop. First you need to patch Magisk_v12.zip and install it, then install latest Magisk_v15.3.zip as a module in MagiskManager. Like I wrote in my guide

Thanks mario_R for the guide and trick. I did it hassle free as I already had my internal decrypted. But I noticed some people having problem with installation.
 

kalawy

Senior Member
May 18, 2013
190
35
28
alexandria
it worked and the 2nd rom booted correctly then i added magisk 15.3 and set kernel .. the next boot the phone boots to the primary rom and stuck at bootanimation
when checking from recovery it appears that data partition cant be read and twrp asks for password

i managed to format and restore a backup
but what exactly caused this ??
 

Top Liked Posts

  • There are no posts matching your filters.
  • 20
    logo.png

    DUAL BOOT PATCHER​

    DualBootPatcher is an open-source app that allows multiple ROMs to be installed on a single Android device. It does its best to work with existing code and does not require explicit support from ROMs. This will allow any number of ROMs to be installed at the same time. It works by patching the secondary ROM's installation scripts and boot image to load the ROM files from an alternate location (/system/multiboot, /cache/multiboot, and /data/multiboot). Because of the way this is implemented, no changes to the primary ROM are necessary.

    Warning: This method requires one time factory reset.

    How to use the patcher
    Android
    Download the patcher apk and run it. Tap "Patch Zip File" from the navigation drawer and choose the file you want to patch.

    Windows (GUI)
    Double click DualBootPatcher.exe and choose the file you want to patch.

    --------

    After patching the zip file, a new file, like some_rom_data-slot.zip file will be created. For example,

    Lineage-14.1-oxygen.zip

    After patching would create a new
    Lineage-14.1-oxygen_data-slot.zip
    If you want to root secondary rom, then download Magisk 12.zip given below(Do not use other version, you can update that later from magisk manager app) and patch it like you did with rom

    Instructions for dual booting
    Before doing anything, download the Dual Boot Patcher.apk from the download section below.

    The patcher offers several locations for installing ROMs:
    Primary: This is normally used for installing a zip to the primary ROM. It is not required, but is strongly recommended because it has code to prevent the zip from inadvertently affecting other ROMs.
    Secondary: Secondary is the first multiboot installation location. It installs to the system partition. This is a good spot for installing a second ROM because it doesn't take any space away from the internal storage.
    Multi-slots: There are 3 multislots: multi-slot-1, multi-slot-2, multi-slot-3. These install to the cache partition. This is specifically for devices, like the Galaxy S4, that have a massive cache partition.
    Data-slots: There can be an unlimited number of data slots. These install to the data partition and eat up space on the internal storage. This is useful for devices where the system partition is nearly full and the cache partition is tiny. These slots are named "data-slot-[id]", where "id" is something you provide in the app.
    Extsd-slots: There can be an unlimited number of extsd slots. These install to the external SD card, which is useful as it keeps the ROMs off of the internal storage. Note that the ROM's data files are still stored on the data partition.

    Now Let's Start

    1) Boot into recovery
    2) Make a backup of /system /data /boot on SD Card (it's important to make it on sd card!)
    3) Wipe internal storage (it will erase all of your data including photos, music etc on internal storage. So make sure you moved them or made their backup)
    4) Restore your backup and boot to your ROM
    5) Install Dual Boot Patcher.
    6) Install patched rom as secondary on /system or on /data partition - it's your choice. There is lot of space for 3 roms in /system.
    If you want to root secondary ROM and flash patched magiskv12.
    7) Select your secondary ROM in ROM list and reboot.

    Steps to be followed on Secondary Rom
    8) Install Dual Boot Patcher.
    9) Install MagiskManager.apk (see attachment)
    10) Open Magisk Manager
    11) Go to Modules-> press "+" button -> search for Magisk_v15.3.zip -> hold your finger on it -> press "Open". Wait for installation end. Now press close button. Don't restart
    12) Open Dual Boot Patcher -> confirm for change current kernel
    13) Reboot and voila! You have fully working secondary ROM with Magisk!

    FAQ's (FAQ)
    Do I need to wipe again for third or next rom?
    No, wiping is only required for one time, you can flash as many roms(your device can handle) after that.

    Switch the ROM if something doesn't work properly?
    You can flash the DualBootUtilities zip from recovery. It will provide a menu interface that allows switching to the various ROMs.

    If you have TWRP, you can also switch manually by tapping Install -> Images (bottom right) -> Go to /sdcard/MultiBoot/[Your ROM]/ -> flash boot.img.

    Wipe /cache, /data, /system, or dalvik-cache?
    The easiest way is to do it from the app while booted in another ROM. Just go to "Roms" in the navigation drawer, tap the 3 dots options menu for the ROM you want to wipe, and tap "Wipe ROM".

    NOTE: Don't use the recovery's built-in wiping abilities as that may delete non-primary ROMs!

    Update the primary ROM?
    Patch the zip for primary and flash it. The "primary" installation target is designed so that other ROMs won't be affected when you want to flash something for the primary ROM.

    Update a non-primary ROM?
    Patch and flash the zip exactly like how you did it the first time.
    Flash a mod or custom kernel for the primary ROM?
    Patch it for primary before flashing. If the zip does not wipe /cache, it is also safe to flash it directly.
    Flash a mod or custom kernel for a non-primary ROM?
    Just patch and flash it

    Note:
    You must always select 'Data-slots' as installation location for secondary roms on Redmi Note 4x. You can also use 'Extsd-slots' if you want to install on external storage.
    If your using MIUI (Multirom, Xiaomi.eu, etc), you may need to enable documents app by going to Settings> Installed Apps before trying to patch any file in DBP.
    Don't use official MIUI as primary rom.
    If you're not able to boot, your phone vibrates 5 times and then reboot to TWRP after installing secondary rom, it might be that your data partition is encrypted. To fix this follow the instructions below:
    First backup all your data including Internal Storage, then boot to TWRP>WIPE>FORMAT DATA then type 'yes' and tap enter. Now reboot and retry DBP.

    Source/Credits:
    https://dbp.noobdev.io
    @chenxiaolong
    @bad_request (Thanks for the XDA Post And Guide)
    @mario_R (For step by step guide and errors.)
    Downloads: https://dbp.noobdev.io/downloads/ and Download latest files

    ~ Hit Thanks button below if I helped you ~
    3
    app share have a high chance of breaking secondery rom

    updating RAMDISK is not necessary. It's necessary only for "App sharing" feature, but I don't recommend it because it causes sometimes bootloops on secondary ROM. Even even creator of DualBoot patcher said it may be unstable.

    as already mentioned by @mario_R .

    I think I should remove that step as many of us are facing the same problem
    3
    Good that you solved it. But for your knowledge and to any user: updating RAMDISK is not necessary. It's necessary only for "App sharing" feature, but I don't recommend it because it causes sometimes bootloops on secondary ROM. Even even creator of DualBoot patcher said it may be unstable.


    Thanks for mention me in your thread, but remove that line, it will cause bootloop. First you need to patch Magisk_v12.zip and install it, then install latest Magisk_v15.3.zip as a module in MagiskManager. Like I wrote in my guide

    Thanks mario_R for the guide and trick. I did it hassle free as I already had my internal decrypted. But I noticed some people having problem with installation.