Jump to content











Photo
- - - - -

How to make GRUB2 and GRUB4DOS coexist on same drive?


  • Please log in to reply
10 replies to this topic

#1 E = mc²

E = mc²
  • Members
  • 5 posts
  • Location:Anywhere

Posted 05 March 2022 - 08:18 AM

I have a Dell XPS 9360. It is currently running Windows 10 Enterprise LTSC. I've read that this ultrabook runs Linux quite well, minus the fingerprint reader not working 100%. After investigating a few distros I've decided to go with Manjaro (a derivative of Arch), due to it having a large selection of packages that are bleeding edge.

When i bought it from Craigslist it was running Windows 11 with UEFI, Secure Boot, and TPM enabled. I've since wiped the disk and configured the BIOS for legacy/CSM boot. Windows is currently running in legacy mode. There are a total of 2 primary partitions, and one extended containing 2 logicals, for Linux. So that leaves one primary slot available.

As of now, I've created the partitions for Linux, but haven't yet installed it. I'm not sure whether to install Linux first then G4D later, or the other way around. If i do Linux first, I can opt to install its' boot files but not the MBR, however I will need a way to chainload it.

This PC has a 500GB Toshiba NVMe, with no additional slots available. If i'm running in legacy mode, only one OS can occupy the MBR. So now you see my issue.

Thanks!

Edit: I'm aware that G4D's bootloader uses 16(?) sectors, I'm not sure how many GRUB2 uses. But i'm certain that both extend past the first sector of the disk.

Edited by E = mc², 05 March 2022 - 08:25 AM.


#2 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 05 March 2022 - 08:49 AM

I think that on a CSM settings grub4dos can be run chainloading grldr.mbr from the Windows 10 BOOTMGR just fine. (in XP it works chainloading grldr, 8/8.1 works with grldr.mbr, cannot remember if 7 works with grldr or with grldr.mbr). .

 

This way you leave the MBR "as is", use the Windows 10 BOOTMGR as "main bootmanager" adding an option to the BCD to boot the grldr or grldr.mbr.

And when you install the Linux you leave the MBR alone.

In practice, bar the added entry in the BCD, the disk MBR (and the 15 sectors after it) remain untouched.

 

You can try adding the grub4dos to the BCD even before and beside creating the Linux partition and installing to it your distro of choice, an usually recommended tool to do that is BOOTICE:

http://reboot.pro/in...ds&showfile=592

 

 

Ony for the record/JFYI, if you want to boot directly to grub4dos (but don't want to change sectors after the MBR) there is also the UMBR that is a single sector file, see here for some info:

http://reboot.pro/in...showtopic=22541

 

:duff:

Wonko



#3 E = mc²

E = mc²
  • Members
  • 5 posts
  • Location:Anywhere

Posted 05 March 2022 - 09:01 AM

i'm not sure i get your meaning. Some bootloader has to occupy the MBR, or elde the BIOS will have nothing to load. The question is, which one?

I just realized that i have another option as well. Which is to install Manjaro with GRUB2 using a core.img that lives in the root partition. This way the MBR shouldnt be touched, and G4D can reside there as the "master bootloader". i'm not sure if Manjaro's install ISO has this option. If not i'll need to let it write the MBR in the conventional way, put the Windows MBR back, then install G4D later. Once Manjaro is booted I can update it and reconfigure GRUB2 to uss core.img. Since i only need to load Windows and Linux, my menu.lst should be simple.

Chaining Linux with Windows bootmgr is doable, but i dont trust Windows to do that.

#4 wimb

wimb

    Platinum Member

  • Developer
  • 3756 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 05 March 2022 - 09:03 AM

UEFI_MULTI will do - see also Manual VHD_WIMBOOT with on page 10

 

How to make Linux VHD for Multi-Boot with Windows using Grub2 and vdiskchain



#5 E = mc²

E = mc²
  • Members
  • 5 posts
  • Location:Anywhere

Posted 05 March 2022 - 09:07 AM

UEFI_MULTI will do - see also Manual VHD_WIMBOOT with on page 10
 
How to make Linux VHD for Multi-Boot with Windows using Grub2 and vdiskchain


I'm not booting in UEFI. And i dont want to put either OS in a VHD. It's just overcomplicated and unnecessary for what i want to do.

#6 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 05 March 2022 - 09:51 AM

I don't understand where grub4dos fits in?

Windows uses bootmgr and Linux uses grub2 - so why is grub4dos wanted or needed?

It is quite easy to load grub4dos from grub2 etc.

https://rmprepusb.co...and-vice-versa/

 



#7 E = mc²

E = mc²
  • Members
  • 5 posts
  • Location:Anywhere

Posted 05 March 2022 - 09:59 AM

I don't understand where grub4dos fits in?

Windows uses bootmgr and Linux uses grub2 - so why is grub4dos wanted or needed?

It is quite easy to load grub4dos from grub2 etc.

https://rmprepusb.co...and-vice-versa/

Your question is akin to asking why humans went to the moon or explore space....because we can and want to. There's no immediate need to do either, plenty of problems here on Earth to deal with.



#8 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 05 March 2022 - 10:03 AM

Sure - but why do you want grub4dos?

Do you want the initial boot menu to be grub4dos

Do you want to be able to run grub4dos from initial grub2 menu

etc.



#9 wimb

wimb

    Platinum Member

  • Developer
  • 3756 posts
  • Interests:Boot and Install from USB
  •  
    Netherlands

Posted 05 March 2022 - 10:39 AM

I'm not booting in UEFI. And i dont want to put either OS in a VHD. It's just overcomplicated and unnecessary for what i want to do.

 

You don't need to use UEFi booting, but UEFI_MULTI makes also the MBR booting with Boot Manager > Grub4dos > Grub2 which is the original question .....

 

Everything is combined in one Tool and you can use the way of booting that you like ...

 

Or for new drive use USB_FORMAT - has MBR booting with Boot Manager > Grub4dos > Grub2



#10 E = mc²

E = mc²
  • Members
  • 5 posts
  • Location:Anywhere

Posted 05 March 2022 - 11:17 AM

You guys are right, there's no need to overcomplicate the situation by adding G4D when not needed. Perhaps it's best to just install Manjaro and let GRUB2 handle everything. I only need to dualboot Linux and Windows, nothing more, so better to keep it simple.

This is a nice forum, lots of useful info here. I'm definitely staying around.

#11 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 05 March 2022 - 11:49 AM

i'm not sure i get your meaning. Some bootloader has to occupy the MBR, or elde the BIOS will have nothing to load. The question is, which one?

No, JFYI, "normally" there is NO bootloader in the MBR.

 

The BIOS booting sequence is "normally":

 

DOS:

BIOS->MBR->PBR of active, primary partition->io.sys (DOS)

 

Windows NT (up to XP):

BIOS->MBR->PBR of active, primary partition->NTLDR->BOOT.INI->choice->Windows (or *whatever* choice chosen)

 

Windows NT (Vista and later, including 10):

BIOS->MBR->PBR of active, primary partition->BOOTMGR->BCD->choice->Windows (or *whatever* choice chosen)

 

The MBR simply contains (in a single sector) some code that chainloads the PBR of the active, primary partition.

 

The PBR contains (in a single sector or on multiple ones, depending on the filesystem) some code that chaionloads either the system file (as is the case for the io.sys of DOS) or a file that is BOTH a (simple) bootmanager AND a bootloader (either NTLDR or BOOTMGR) that is customizable through the respective configuration file (BOOT.INI or BCD).

 

One of the "features" of grub4dos is that (depending on the OS) either grldr or grldr.mbr are chainloadable from an entry in the corresponding configuration file, this allows to add (or remove) grub4dos without touching in any way the MBR or the PBR of the partition/volume.

 

Of course in this case the "main" bootmanager remains the original one (NTLDR or BOOTMGR) and grub4dos becomes the secondary one, with its own configuration file (menu.lst).

 

GRUB2 (AFAIK/AFAICR) has not this "feature" but it can be chainloaded by grub4dos (and in this case would become a tertiary bootmanager, with its own configuration file grub.cfg).

 

Both grub4dos and GRUB2 are not only bootmanagers but also bootloaders (more properly OSloaders) for Linux kernels (and grub4dos - just saying - can also act as osloader for DOS, i.e. can chainload directly io.sys). 

 

:duff:

Wonko






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users