grub question [Solved]

Installer Issues via Installer -- Not for global upgrades or upgrading individual packages -- ONLY ISSUES WITH INSTALLATION OF THE OS -- Can't get Sabayon installed, than post here, otherwise use correct forums

Moderator: Moderators

grub question [Solved]

Postby apiaio » Thu Jan 20, 2011 19:50

Hi there!
After installation SL I edited grub.conf, because of dualboot. Up to now I used LILO and command /sbin/lilo
overwites MBR. I do not know how to do that when using grub. Following Gentoo Handbook I used comman
Code: Select all
grub-install
but
-bash:grub-install: command not found
was the response.
Thanks
Last edited by apiaio on Fri Jan 21, 2011 16:01, edited 1 time in total.
apiaio
Growing Hen
 
Posts: 115
Joined: Thu Jul 30, 2009 19:44

Re: grub question

Postby micia » Thu Jan 20, 2011 19:55

Hi!

check out:
(as root)
Code: Select all
grub2-install --help


[Edit]
by the way, if you need to edit the configuration of GRUB2, you have to edit:
/etc/default/grub
and use:
make a backup of the existing /boot/grub/grub.cfg before executing this command
(as root)
Code: Select all
grub-mkconfig -o /boot/grub/grub.cfg

to update /boot/grub/grub.cfg since now the GRUB configuration is stored in that file.

there should be no need of using grub2-install directly in this situation.
[Edit end]

the guide that you are using now is probably intended for GRUB prior to version 2.
micia
Sagely Hen
 
Posts: 2718
Joined: Wed Nov 26, 2008 16:41

Re: grub question

Postby apiaio » Thu Jan 20, 2011 20:27

I have installed grub-1.98.I used
grub-mkconfig -o /boot/grub/grub.cfg
but nothing has changed after reboot
apiaio
Growing Hen
 
Posts: 115
Joined: Thu Jul 30, 2009 19:44

Re: grub question

Postby joost » Thu Jan 20, 2011 21:03

You most likely want to run:
Code: Select all
grub2-install


That will install grub2 to MBR. If you haven't done this already, generate a grub.cnf file:
Code: Select all
grub-mkconfig -o /boot/grub/grub.cfg


fyi grub2 doesn't use grub.conf anymore.
joost
Sagely Hen
 
Posts: 2566
Joined: Fri Nov 17, 2006 12:11
Location: The Netherlands

Re: grub question

Postby apiaio » Thu Jan 20, 2011 21:15

joost wrote:
fyi grub2 doesn't use grub.conf anymore.
In which config file I can set the boot conditions after installing grub2?
E.g. I will start windows from sdb1. AFAIK I will need to use something like that
Code: Select all
...
title Windows
root (hd1,0)
map (hd1) (hd0)
map (hd0) (hd1)
...
apiaio
Growing Hen
 
Posts: 115
Joined: Thu Jul 30, 2009 19:44

Re: grub question

Postby joost » Thu Jan 20, 2011 21:30

No idea how that works with grub2.
joost
Sagely Hen
 
Posts: 2566
Joined: Fri Nov 17, 2006 12:11
Location: The Netherlands

Re: grub question

Postby Fitzcarraldo » Fri Jan 21, 2011 9:59

GRUB 2 uses the package sys-boot/os-prober to find out which other OSs are installed. In my case it generates automatically the following section within the /boot/grub/grub.cfg file when I run the grub-mkconfig -o /boot/grub/grub.cfg command:

Code: Select all
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows 7 (loader) (on /dev/sda1)" {
        insmod ntfs
        set root='(hd0,1)'
        search --no-floppy --fs-uuid --set a6863e9f863e7043
        chainloader +1
}
menuentry "Windows 7 (loader) (on /dev/sda2)" {
        insmod ntfs
        set root='(hd0,2)'
        search --no-floppy --fs-uuid --set a2243da8243d7ff9
        chainloader +1
}
### END /etc/grub.d/30_os-prober ###

So it detects automatically my two Windows partitions. If you run the aforementioned grub-mkconfig command it should automatically detect your Windows partition on /dev/sdb1 if you have sys-boot/os-prober installed (if you don't have it installed, it does nothing).

You can also disable automatic probing by adding the line GRUB_DISABLE_OS_PROBER=true to the file /etc/default/grub before running the aforementioned grub-mkconfig command.

You can override the automatic os-prober by instead editing the /etc/grub.d/40_custom file before running the aforementioned grub-mkconfig command. See the example for a Windows partition on the second drive, given in Section 3.2.1 of the Gentoo Wiki article on GRUB 2.

Look in /boot/grub/grub.cfg after running the aforementioned grub-mkconfig command to check if everything worked. If not edit the input files mentioned above and re-run the command.

(Strictly speaking, you are not supposed to edit the /boot/grub/grub.cfg file. However, in practice many people do. Your choice, but be aware that whatever edits you do to that file directly could be overwritten if either you or something else -- such as an Entropy kernel upgrade -- runs the grub-mkconfig command.)
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7981
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: grub question

Postby joost » Fri Jan 21, 2011 10:22

The problem is that you need to remap the drives because Windows needs to be on the first harddrive otherwise it will fail to boot. Not sure how mapping is done in grub2 and if it still is needed (or grub2 does that automagic)
joost
Sagely Hen
 
Posts: 2566
Joined: Fri Nov 17, 2006 12:11
Location: The Netherlands

Re: grub question

Postby Fitzcarraldo » Fri Jan 21, 2011 10:57

See remapping example in /etc/grub.d/40_custom file in Section 3.2.1 of the Gentoo Wiki article on GRUB 2 that I linked to.
User avatar
Fitzcarraldo
Sagely Hen
 
Posts: 7981
Joined: Sat Mar 10, 2007 5:40
Location: United Kingdom

Re: grub question

Postby joost » Fri Jan 21, 2011 11:01

Ah there we go. :D
joost
Sagely Hen
 
Posts: 2566
Joined: Fri Nov 17, 2006 12:11
Location: The Netherlands

Next

Return to Installer Issues - Calamares **Not for Package Manager Stuff**

Who is online

Users browsing this forum: No registered users and 3 guests