Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Gentoo and GRUB2
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
ONEEYEMAN
Advocate
Advocate


Joined: 01 Mar 2005
Posts: 2773

PostPosted: Sun Jan 04, 2015 6:03 am    Post subject: Gentoo and GRUB2 Reply with quote

Hi, ALL,
Does GRUB2 supports chainloading?

I modified /etc/grub.d/40_custom and added following:

Code:

igor@IgorDellGentoo ~ $ cat /etc/grub.d/40_custom
#!/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 "Solaris" {
  set root=(hd0,5)
  chainloader +1
}


Then I ran "grub2-mkconfig -o /boot/grub/grub.cfg" and rebooted.

Trying to boot Solaris fails with the error "Incorrect parameter".

My hard drive is split by half. Gentoo is installed according to the Handbook as EFI scheme and then Solaris 11 is installed on the rest of the hard drive. Then I had to reinstall Gentoo's GRUB2 in order to boot in Linux. Apparently Solaris's GRUB2 overwrote the MBR as Gentoo's GRUB2 did install something into MBR and not everything to that one small GRUB partition I had to create following Handbook.

So any idea on how to make the Gentoo's GRUB2 install without touching an MBR so that the MBR would be occupied by Solaris' GRUB2?

Or maybe this error is about something else?

Thank you.
Back to top
View user's profile Send private message
Marlo
Veteran
Veteran


Joined: 26 Jul 2003
Posts: 1428

PostPosted: Sun Jan 04, 2015 8:59 am    Post subject: Reply with quote

Hi,
Have you ever tried os-prober? If not, do it.

grz
Ma
_________________
Thank you for your attention, interest and support.
------------------------------------------------------------------
http://radio.garden/
Back to top
View user's profile Send private message
tclover
Guru
Guru


Joined: 10 Apr 2011
Posts: 516

PostPosted: Sun Jan 04, 2015 9:44 am    Post subject: It does. Reply with quote

[Of course] It does. Did you ever bother to read the documentation first? I am asking because it seems to not be the case.
There is a sub-article of GRUB2 main article on the subject at hand on the wiki. RTFMing is required.
_________________
home/:mkinitramfs-ll/:supervision/:e-gtk-theme/:overlay/
Back to top
View user's profile Send private message
ONEEYEMAN
Advocate
Advocate


Joined: 01 Mar 2005
Posts: 2773

PostPosted: Sun Jan 04, 2015 7:02 pm    Post subject: Re: It does. Reply with quote

tclover wrote:

[Of course] It does. Did you ever bother to read the documentation first? I am asking because it seems to not be the case.
There is a sub-article of GRUB2 main article on the subject at hand on the wiki. RTFMing is required.

Thank you for pointing out the chainloader sub-article. Didn't notice it.

So I changed the GRUB2 configuration file 40_custom to look like:

Code:

insmod zfs
insmod chain
chainloader (hd0, 5)+1


Now IIUC, Solaris' GRUB2 needs to be installed on the Solaris partition and Gentoo GRUB2 can be left untouched. Is this true?
In the past I worked with GRUB-legacy and Windows, so I need some help here. ;-)

Now I have another question.
In the Handbook it says:

Quote:

Next, install the necessary GRUB2 files in /boot/grub/. Assuming the first disk (the one where the system boots from) is /dev/sda, the following command will do this:
Code:
 
grub2-install /dev/sda



Now, I'm using GPT scheme, so during Gentoo install where the GRUB2 will end up? /dev/sda1 (BIOS boot partition), /dev/sda2 (which is /boot) or MBR?

I just need some clarification as Handbook is not clear on this, especially for GPT setup.

Thank you.
Back to top
View user's profile Send private message
tclover
Guru
Guru


Joined: 10 Apr 2011
Posts: 516

PostPosted: Sun Jan 04, 2015 8:05 pm    Post subject: Re: It does. Reply with quote

ONEEYEMAN wrote:
So I changed the GRUB2 configuration file 40_custom to look like:

Code:

insmod zfs
insmod chain
chainloader (hd0, 5)+1


Now IIUC, Solaris' GRUB2 needs to be installed on the Solaris partition and Gentoo GRUB2 can be left untouched. Is this true?
In the past I worked with GRUB-legacy and Windows, so I need some help here. ;-)


This will work only if GRUB2 is installed in BIOS/MBR variant and require having an extra bootloader installed on that partition. So, GPT partionned would be the trouble maker... and would require going to hybrid MBR/GPT route.

Now, there is a part_sun & part_sunpc GRUB2 module... maybe you can load Solaris kernel with it, but I am not familiar with Solaris or any derivative of it. And this would be simple if supported by GRUB2, and would not require an extra boot loader.

ONEEYEMAN wrote:
Now I have another question.
In the Handbook it says:

Quote:

Next, install the necessary GRUB2 files in /boot/grub/. Assuming the first disk (the one where the system boots from) is /dev/sda, the following command will do this:
Code:
 
grub2-install /dev/sda



Now, I'm using GPT scheme, so during Gentoo install where the GRUB2 will end up? /dev/sda1 (BIOS boot partition), /dev/sda2 (which is /boot) or MBR?

I just need some clarification as Handbook is not clear on this, especially for GPT setup.

Thank you.


This depends on having [U]EFI or not. Refer to GRUB2 main article for the piratical steps... Without EFI, the bootloader will end up in special partition (0xEF02) which should be present. Or else, you will need a (0xEF00) EFI partion (vfat) for UEFI.
And this could be trouble if GRUB2 does not support loading Solaris kernel as stated above.
_________________
home/:mkinitramfs-ll/:supervision/:e-gtk-theme/:overlay/
Back to top
View user's profile Send private message
ONEEYEMAN
Advocate
Advocate


Joined: 01 Mar 2005
Posts: 2773

PostPosted: Mon Jan 05, 2015 5:37 am    Post subject: Re: It does. Reply with quote

tclover wrote:

ONEEYEMAN wrote:

So I changed the GRUB2 configuration file 40_custom to look like:

Code:

insmod zfs
insmod chain
chainloader (hd0, 5)+1


Now IIUC, Solaris' GRUB2 needs to be installed on the Solaris partition and Gentoo GRUB2 can be left untouched. Is this true?
In the past I worked with GRUB-legacy and Windows, so I need some help here. ;-)


This will work only if GRUB2 is installed in BIOS/MBR variant and require having an extra bootloader installed on that partition. So, GPT partionned would be the trouble maker... and would require going to hybrid MBR/GPT route.

Now, there is a part_sun & part_sunpc GRUB2 module... maybe you can load Solaris kernel with it, but I am not familiar with Solaris or any derivative of it. And this would be simple if supported by GRUB2, and would not require an extra boot loader.

Do you mean I can try to load Solaris kernel directly without chainloading?
It may be possible since zfs module is available...

But I guess for that I need to re-install Solaris GRUB2 to see how it loads the system, right? And then copy it over to the Gentoo GRUB2 configuration.

tclover wrote:

ONEEYEMAN wrote:

Now I have another question.
In the Handbook it says:

Quote:

Next, install the necessary GRUB2 files in /boot/grub/. Assuming the first disk (the one where the system boots from) is /dev/sda, the following command will do this:
Code:
 
grub2-install /dev/sda



Now, I'm using GPT scheme, so during Gentoo install where the GRUB2 will end up? /dev/sda1 (BIOS boot partition), /dev/sda2 (which is /boot) or MBR?

I just need some clarification as Handbook is not clear on this, especially for GPT setup.

Thank you.


This depends on having [U]EFI or not. Refer to GRUB2 main article for the piratical steps... Without EFI, the bootloader will end up in special partition (0xEF02) which should be present. Or else, you will need a (0xEF00) EFI partion (vfat) for UEFI.
And this could be trouble if GRUB2 does not support loading Solaris kernel as stated above.


Are you talking about that special partition that is referenced in the Handbook as the bootloader partition (not the /boot one)?

Thank you.
Back to top
View user's profile Send private message
tclover
Guru
Guru


Joined: 10 Apr 2011
Posts: 516

PostPosted: Mon Jan 05, 2015 12:35 pm    Post subject: Re: It does. Reply with quote

ONEEYEMAN wrote:
Do you mean I can try to load Solaris kernel directly without chainloading?
It may be possible since zfs module is available...

But I guess for that I need to re-install Solaris GRUB2 to see how it loads the system, right? And then copy it over to the Gentoo GRUB2 configuration.


Yes because there is support for zfs and sunOS type partitions scheme. Try searching for GRUB2+Solaris in the intertubes to see if it's doable. So, you won't need chainloading which is trouble in this case if you have GPT[+EFI] & a single drive to boot from. [If Solaris is installed in another disk, this would be easy.] I don't think chainloading different boot loaders on the same disk with GPT is possible without hybrid MBR/GPT because of the way GRUB2 is installed in a GPT disk. And I'm not even sure it would be doable with hybrid MBR/GPT.

ONEEYEMAN wrote:

Are you talking about that special partition that is referenced in the Handbook as the bootloader partition (not the /boot one)?

Thank you.


Yes, which is a 0xEF02 partition if no [U]EFI or 0xEF00 partition with [U]EFI. This is where comes the trouble for chainloading on the same disk.
_________________
home/:mkinitramfs-ll/:supervision/:e-gtk-theme/:overlay/
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum