LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-10-2018, 07:48 PM   #1
Malibyte
Member
 
Registered: Dec 2001
Location: California, USA
Distribution: Ubuntu, Debian
Posts: 128

Rep: Reputation: 15
Question Need to chainload Clover bootloader on GPT drive from GRUB2 on MBR drive


Hi all -
This has been driving me nuts for a while.
I have a quad-boot system with Ubuntu 16.04, Windows 10, and (LOL) DOS 6.22 on the first SSD (MBR), and Mac OS on the second SSD (GPT). The first drive has the GRUB2 bootloader (MBR), the second has Clover (EFI).

Right now, I have to hit the F12 key immediately after firing up the machine and scroll through about 25 options in the BIOS boot list to boot Clover -> MacOS.

I need to be able to chainload Clover from Grub (preferably) or vice-versa (though I'd much rather use Grub as my primary bootloader).

I have tried several different ways to do this without success. One post (forum.manjaro.org/t/boot-clover-from-grub/39597/5) indicates that it is possible...but when I use the same script as part of /etc/grub.d/40_custom (changing the disk UUID to the appropriate one, of course), I get:

"error: invalid signature."

Here is the file I'm using:


#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.

menuentry "MacOS" {
insmod fat
insmod part_gpt
insmod chain
insmod search_fs_uuid
search --fs-uuid --no-floppy --set=root 67E3-17ED
chainloader /EFI/CLOVER/CLOVERX64.efi
chainloader +1
}
menuentry "MS-DOS 6.22" {
set root='(hd0,1)'
chainloader +1
}


The CLOVERX64.efi file is present there, no typos in the filename above.
DOS boots without a problem.

Is there *any* way to do this?? Can't easily convert the other three OS to EFI (Linux would be significantly easier than the other two; I would guess DOS would be impossible).

Thanks!

Last edited by Malibyte; 04-10-2018 at 07:50 PM.
 
Old 04-10-2018, 08:02 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 18,490

Rep: Reputation: 3099Reputation: 3099Reputation: 3099Reputation: 3099Reputation: 3099Reputation: 3099Reputation: 3099Reputation: 3099Reputation: 3099Reputation: 3099Reputation: 3099
I have similar (Win10 on MBR, linux's on gpt in my case), and was never able to reconcile it. I don't recall if I tried chainloading, but pretty sure I would have. I'm such an infrequent user of Win10 I don't care about having to pull up the boot list in need, so I just left it as-is.
As for your long list, get efibootmgr in Ubuntu and prune it of old entries (they are in NVRAM on the motherboard).
 
Old 04-10-2018, 08:27 PM   #3
Malibyte
Member
 
Registered: Dec 2001
Location: California, USA
Distribution: Ubuntu, Debian
Posts: 128

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by syg00 View Post
I have similar (Win10 on MBR, linux's on gpt in my case), and was never able to reconcile it. I don't recall if I tried chainloading, but pretty sure I would have. I'm such an infrequent user of Win10 I don't care about having to pull up the boot list in need, so I just left it as-is.
As for your long list, get efibootmgr in Ubuntu and prune it of old entries (they are in NVRAM on the motherboard).
Bummer....I'm hoping that newer versions of Grub2 can do this (or perhaps, vice-versa: Clover chainloading Grub2 on the MBR drive).

Tried efibootmgr, but I figured it wouldn't work since the Linux root/boot partition is on the MBR drive.

[rcs@yoda: ~]$ sudo efibootmgr
efibootmgr: EFI variables are not supported on this system.

Thanks for the come-back, though!
 
Old 04-10-2018, 08:31 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 18,490

Rep: Reputation: 3099Reputation: 3099Reputation: 3099Reputation: 3099Reputation: 3099Reputation: 3099Reputation: 3099Reputation: 3099Reputation: 3099Reputation: 3099Reputation: 3099
Try booting the Ubuntu liveCD in EFI mode - I'm actually surprised Ubuntu allowed you to do that, but it's been years since I tried installing it.
 
Old 04-11-2018, 01:54 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 19,514

Rep: Reputation: 3017Reputation: 3017Reputation: 3017Reputation: 3017Reputation: 3017Reputation: 3017Reputation: 3017Reputation: 3017Reputation: 3017Reputation: 3017Reputation: 3017
https://unix.stackexchange.com/quest...on-this-system for the "EFI variables are not supported"

A uefi bios should be able to boot to a mbr or gpt I'd think. Almost every search for this ends up with windows a no however linux questions answer qualified yes. The problem is goofy uefi coding. https://superuser.com/questions/9315...in-native-uefi

Then there is a hybrid mbr deal.

I'd still suspect that if you are forced for some reason to boot to a gpt disk because of uefi then grub could then find any available /boot to then continue or load directly. Still worry about goofy bios.

Last edited by jefro; 04-11-2018 at 02:10 PM.
 
Old 04-12-2018, 09:03 AM   #6
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 8,905

Rep: Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859
I have an EFI laptop with several Linux systems on it. I also have an external Legacy/MBR drive with only Lubuntu 14.04 on it. I booted Lubuntu and did an update-grub and the output did show the Linux systems on the internal EFI drive. I booted Lubuntu and from its menu, selected the systems on the EFI drive and they both booted without any problem. The menuentries on the Lubuntu grub.cfg file all point to the kernel/initrd files on the partition the system is on in the internal EFI drive and make no reference to the EFI partition. They also detect that it is a GPT partition. Might be that it is a MAC, never used one.
 
Old 04-13-2018, 09:34 AM   #7
colorpurple21859
Senior Member
 
Registered: Jan 2008
Location: florida panhandle
Distribution: slackware64-current, fedora, ubuntu, others
Posts: 3,928

Rep: Reputation: 660Reputation: 660Reputation: 660Reputation: 660Reputation: 660Reputation: 660
The problem seams to be that you booting Ubuntu in legacy mode on an efi system. Grub-x86-64efi needs to be install to allow booting and chainloading in efi mode
what is the ouput of
Code:
fdisk -l
and the content of your esp partitions

Last edited by colorpurple21859; 04-13-2018 at 10:15 AM.
 
Old 04-14-2018, 02:56 AM   #8
Malibyte
Member
 
Registered: Dec 2001
Location: California, USA
Distribution: Ubuntu, Debian
Posts: 128

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by colorpurple21859 View Post
The problem seams to be that you booting Ubuntu in legacy mode on an efi system. Grub-x86-64efi needs to be install to allow booting and chainloading in efi mode
what is the ouput of
Code:
fdisk -l
and the content of your esp partitions
Yes, that is true. Trying to boot Grub2 from my legacy setup into the Clover EFI bootloader on the EFI drive to boot MacOS, and directly from Grub for the legacy OSes. The BIOS settings allow both legacy and UEFI. Any way to install Grub with EFI capability (Grub-x86-64efi, with the ability to boot both types) while not having to convert my legacy setup to EFI?

I would be willing to go the other way (Use Clover as the primary bootloader); it is supposedly able to see and boot legacy partitions, but it doesn't give me an entry for the Linux root/boot partition or the Windows boot partition. However, I'd much rather use Grub as the primary if possible.

Thanks!

Code:
[rcs@yoda: ~]$ fdisk -l
Disk /dev/sda: 477 GiB, 512110190592 bytes, 1000215216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x00042f5a

Device     Boot     Start       End   Sectors  Size Id Type
/dev/sda1            2048    522239    520192  254M  6 FAT16
/dev/sda2          522240 419952639 419430400  200G af HFS / HFS+
/dev/sda3  *    419952640 839383039 419430400  200G  7 HPFS/NTFS/exFAT
/dev/sda4       839383040 973600767 134217728   64G 83 Linux


Disk /dev/sdb: 477 GiB, 512110190592 bytes, 1000215216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 90C55244-159B-461A-AAE9-561ADB68D07A

Device         Start       End   Sectors   Size Type
/dev/sdb1         40    409639    409600   200M EFI System
/dev/sdb2     411648 536281087 535869440 255.5G Apple HFS/HFS+
/dev/sdb3  536543232 537812991   1269760   620M Apple HFS/HFS+
/dev/sdb4  538075136 642934783 104859648    50G Apple HFS/HFS+


Disk /dev/sdc: 2.7 TiB, 3000592982016 bytes, 5860533168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 64602EEE-CA0F-4C50-8846-E343B6D836A1

Device          Start        End    Sectors  Size Type
/dev/sdc1        2048   67110911   67108864   32G Linux filesystem
/dev/sdc2    67110912  486541311  419430400  200G Linux filesystem
/dev/sdc3   486541312  905971711  419430400  200G Microsoft basic data
/dev/sdc4   905971712 1325402111  419430400  200G Apple HFS/HFS+
/dev/sdc5  1325402112 1392510975   67108864   32G Linux swap
/dev/sdc6  1392510976 3539994623 2147483648    1T Linux filesystem
/dev/sdc7  3539994624 5687478271 2147483648    1T Linux filesystem
/dev/sdc8  5687478272 5687543807      65536   32M Microsoft basic data
/dev/sdc9  5687543808 5687730175     186368   91M Microsoft basic data
/dev/sdc10 5687730176 5687975935     245760  120M Microsoft basic data
Code:
[rcs@yoda: ~]$ sudo mount /dev/sdb1 /mnt/efi
[sudo] password for rcs: 
[rcs@yoda: ~]$ ls -lFa /mnt/efi
total 6
drwxr-xr-x 5 root root  512 Dec 31  1969 ./
drwxr-xr-x 7 root root 4096 Apr  9 01:47 ../
drwxr-xr-x 5 root root  512 Apr  3 23:29 EFI/
drwxr-xr-x 4 root root  512 Apr  4 11:33 .Spotlight-V100/
drwxr-xr-x 3 root root  512 Apr  3 23:29 .Trashes/

[rcs@yoda: ~]$ ls -lFa /mnt/efi/EFI
total 6
drwxr-xr-x  5 root root  512 Apr  3 23:29 ./
drwxr-xr-x  5 root root  512 Dec 31  1969 ../
drwxr-xr-x  5 root root  512 Apr  3 23:29 APPLE/
drwxr-xr-x  2 root root  512 Apr  4 11:33 BOOT/
drwxr-xr-x 11 root root 1024 Apr  9 02:01 CLOVER/
-rwxr-xr-x  1 root root 2283 Apr  4 11:33 Clover_Install_Log.txt*

[rcs@yoda: ~]$ ls -lFa /mnt/efi/EFI/CLOVER/
total 780
drwxr-xr-x 11 root root   1024 Apr  9 02:01 ./
drwxr-xr-x  5 root root    512 Apr  3 23:29 ../
drwxr-xr-x  5 root root    512 Apr  4 11:33 ACPI/
-rwxr-xr-x  1 root root 737728 Feb  9 05:45 CLOVERX64.efi*
-rwxr-xr-x  1 root root   4096 Apr 10 00:52 ._config.plist*
-rwxr-xr-x  1 root root  24509 Apr 10 00:52 config.plist*
-rwxr-xr-x  1 root root  24510 Apr  9 01:54 config.plist.bak*
drwxr-xr-x  2 root root    512 Apr  4 11:33 doc/
drwxr-xr-x  2 root root   1024 Apr  4 19:18 drivers64UEFI/
drwxr-xr-x 11 root root    512 Apr  4 11:33 kexts/
drwxr-xr-x  2 root root    512 Apr  4 11:33 misc/
drwxr-xr-x  3 root root    512 Apr  4 11:33 OEM/
drwxr-xr-x  2 root root    512 Apr  4 11:33 ROM/
drwxr-xr-x  4 root root   1024 Apr  4 11:33 themes/
drwxr-xr-x  2 root root    512 Apr  4 11:33 tools/
 
Old 04-14-2018, 01:57 PM   #9
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 8,905

Rep: Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859
If you look at my previous post (#6) where I explained using Grub2 on a Legacy/MBR drive with Lubuntu 14.04 to boot Linux systems on a different EFI/GPT haard drive, it was no problem. I have windows 10 on the EFI drive and I played around with various options trying to boot windows 10 from the Legacy/MBR drive with no success so I would agree with the comment in post 2. The error I got was:

Quote:
error: invalid signature
I notice in your initial post, the menuentry does not include a set root line for Grub which per your output in the last post, should be:

Quote:
set root='hd1,gpt1'
Don't think you need the chainloader +1 at the end either as you have a prior chainloader line.

Good luck with it and post back if you resolve the issue as I'm sure there are people who would appreciate it.

Last edited by yancek; 04-14-2018 at 01:59 PM.
 
Old 04-14-2018, 03:03 PM   #10
Malibyte
Member
 
Registered: Dec 2001
Location: California, USA
Distribution: Ubuntu, Debian
Posts: 128

Original Poster
Rep: Reputation: 15
@yancek -

Thanks - but I had tried that before (set root='hd1, gpt1') and it didn't work; I then tried setting the root partition bu UUID, as above. Neither alone works, nor both together.
 
Old 04-14-2018, 04:01 PM   #11
colorpurple21859
Senior Member
 
Registered: Jan 2008
Location: florida panhandle
Distribution: slackware64-current, fedora, ubuntu, others
Posts: 3,928

Rep: Reputation: 660Reputation: 660Reputation: 660Reputation: 660Reputation: 660Reputation: 660
This is the only way I know to do it, but it involves booting ubuntu in efi mode.
boot into your ubuntu installaion
edit your fstab to add a mount point for /dev/sdb1 partition at /boot/efi (not necessary but may prevent problems with updates in the future)
Code:
apt-get install grub-efi
mkdir /boot/efi
mount /dev/sdb1 /boot/efi
grub-install --target=x86_64-efi
you will get a message about not being able to register efi, but a ubuntu boot entry will be created on your esp partition.
The from your bios firmware screen you should be able to pick up the ubuntu entry to boot and add as the primary bootloader. If you can't make the ubuntu efi bootloader from your setup screen as your primary bootloader then once you boot back into ubuntu using the ubuntu grubefi loader, make sure your in efi mode by checking to see if you have /sys/firmware/efi/ the rerun
Code:
grub-install

Last edited by colorpurple21859; 04-14-2018 at 04:09 PM.
 
Old 04-14-2018, 08:01 PM   #12
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 8,905

Rep: Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859Reputation: 1859
Quote:
Thanks - but I had tried that before (set root='hd1, gpt1') and it didn't work
No surprise really. I think you would have better luck using an EFI bootloader to boot MBR. Don't know anything about Clover.
 
Old 04-16-2018, 06:33 AM   #13
colorpurple21859
Senior Member
 
Registered: Jan 2008
Location: florida panhandle
Distribution: slackware64-current, fedora, ubuntu, others
Posts: 3,928

Rep: Reputation: 660Reputation: 660Reputation: 660Reputation: 660Reputation: 660Reputation: 660
Another option is to use refind bootloader. It has a configuration file that can be edited to suit your needs, per this post https://askubuntu.com/questions/9233...google_rich_qa My post #11 still wouldn't allow you to boot your dos partition.

Last edited by colorpurple21859; 04-16-2018 at 06:40 AM.
 
Old 04-26-2018, 01:59 PM   #14
Malibyte
Member
 
Registered: Dec 2001
Location: California, USA
Distribution: Ubuntu, Debian
Posts: 128

Original Poster
Rep: Reputation: 15
Finally got this to work, in a way, by caving in and repartitioning the Linux/Windows drive to GPT, then used free version of Macrium Reflect to make Windows bootable, then converted GRUB2 to EFI (https://askubuntu.com/questions/9133...to-uefi/913423).

Clover can chainload Grub, so I can now boot MacOS and also chainload Grub from Clover; Linux and Windows boot from Grub. So, problem solved.

Conclusion: Can't mix MBR and EFI drives and easily boot from both. Have to convert both to EFI.

No longer booting the DOS partition, but am running it in a VM under Virtualbox. Can't boot DOS from EFI.

Thanks all for your help!

Last edited by Malibyte; 04-26-2018 at 02:08 PM.
 
Old 04-26-2018, 03:25 PM   #15
_roman_
Member
 
Registered: Dec 2017
Location: _Austro_Bavaria_
Distribution: gentoo / linux mint
Posts: 433

Rep: Reputation: 29
quote: Clover EFI bootloader
Boot OS X, Windows, and Linux on Mac or PC with UEFI or BIOS firmware

I hope you are aware of that you can use any bootloader to boot your operating systems.

Chainloading is the way to go for SypwareXp and such.

Also pay attention that some newbie distros like linux mint, overwrite relevant areas of the boot sections without asking the user during ordinary updates, aka running the linux mint package manager.

quote: Clover can chainload Grub, so I can now boot MacOS and also chainload Grub from Clover; Linux and Windows boot from Grub. So, problem solved.

You can just use clover to do the job and leave grub out.

--

uefi bios needs gpt partiton table. which was a requirement / is a requirement with boxes shipped with windows 10 and such.
ordinary mbr partition table = old bios as we all know
of course you can enable compatibly mode in uefi for old mbr behaviour

Last edited by _roman_; 04-26-2018 at 03:28 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to install grub2 on the first section of a partition and then how to chainload to this grub2 bootloader? centguy Linux - Software 9 09-14-2017 11:03 AM
Install Linux to SATA drive but GRUB2 on to USB thumb drive Quija Linux - General 2 11-22-2011 07:40 PM
[SOLVED] Slackware 13.37 - gdisk choices, MBR, GPT or Blank GPT CFet Slackware - Installation 3 04-01-2011 05:46 PM
grub1 floppy chainload grub2 pavel989 Linux - General 3 02-02-2010 11:58 AM
mbr bootloader problem with external hard drive andaanma Linux - Software 4 10-25-2006 02:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration