LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 06-09-2009, 04:27 PM   #1
milomak
Member
 
Registered: May 2009
Posts: 90

Rep: Reputation: 17
grub2 - multiple OSes


I am currently running Debian Sid with Grub2 as my main OS. What is happening is that grub2 is picking up the Debian kernels, but not Gentoo nor Windows?

I tried to edit the /boot/grub/grub.cfg but on an update-grub2 those entries would be deleted. I then noticed the file actually says not to edit it.

I have had a look at the files in /etc/grub.d/ but they do not help me in sorting out how I would add an entry like the below permanently

Code:
menuentry "Gentoo" {
set root=hd(0,6)
chainloader +1
}
In desperation I even tried adding the below to /boot/grub/grub.cfg

Code:
### BEGIN /etc/grub.d/50_personal ###
### END /etc/grub.d/50_personal ###
And then setting that file as follows (and ran chmod a+x):
Code:
debian:/etc/grub.d# cat 50_personal 
echo 'menuentry "Gentoo Linux" {' >> /boot/grub/grub.cfg
echo '	set root=(hd0,6)' >> /boot/grub/grub.cfg
echo '	chainloader +1' >> /boot/grub/grub.cfg
echo '}' >> /boot/grub/grub.cfg
I originally tried it without the echo commands.

Last edited by milomak; 06-10-2009 at 02:31 PM.
 
Old 06-09-2009, 08:03 PM   #2
aus9
Guru
 
Registered: Oct 2003
Posts: 5,056

Rep: Reputation: Disabled
hi

try running update-grub with root powers and recheck your grub.cfg....this runs all scripts you have modded in /etc/grub,d/

I assume you know how to make backups if not...you may need to read the rest of my wiki from the link below.

----

if no joy you can edit manually as a last resort

http://www.sidux.com/index.php?modul...tag=Grub2chain
 
Old 06-10-2009, 02:31 PM   #3
milomak
Member
 
Registered: May 2009
Posts: 90

Original Poster
Rep: Reputation: 17
The /etc/grub.d/50_personal should look like this
Code:
#!/bin/sh
cat << EOF
menuentry "Gentoo Linux" {
  set root=(hd0,11)
  chainloader +1
}
EOF
 
Old 06-12-2009, 08:00 PM   #4
aus9
Guru
 
Registered: Oct 2003
Posts: 5,056

Rep: Reputation: Disabled
hi

I have only played with some stuff in vbox as I have only one system partition and if I change distros...it will overwrite there.

I am wondering if you have tried something easier?....to use the os prober function...I am now thinking it needs to find bootable partitions.

2) If you have the time to test, run a live cd and run gparted or some other partition tool and mod your Gentoo partition to make it bootable.
then boot back into sid or whatever your grub2 is on...and run update-grub...(after making a backup of course)...and see if the script for os prober worked and grub.cfg has changed?

3) if you feel like doing this....and it is confirmed....I will edit my wiki and give you credit.

regards

EDIT

4) if not gparted...fdisk /dev/sdX...x likely to be a
press m for help and a is the bootable command

Last edited by aus9; 06-12-2009 at 08:07 PM.
 
Old 06-17-2009, 03:09 PM   #5
milomak
Member
 
Registered: May 2009
Posts: 90

Original Poster
Rep: Reputation: 17
I normally run multiple OSes with one designated as my main OS (for the last 3-4 years this has been Debian). Every other OS I intsall I then install grub to that partition. I do this so when I change kernels and the like the grub for that distro does its business without issue.

So in the Debian grub, I need to have entries that point to the partition of the other OSes using chainloader. I used osprober a couple of times but it didn't pick up all my OSes.
 
Old 06-17-2009, 05:56 PM   #6
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Is "set" a valid grub command? Normally you'd just have "root (hd0,0)" or similar, no "=" no set. Could be a grub2 thing.
 
Old 06-17-2009, 07:39 PM   #7
aus9
Guru
 
Registered: Oct 2003
Posts: 5,056

Rep: Reputation: Disabled
billymayday

yep other than my link to the chainloader....set stuff other examples of set and = are shown here

http://www.sidux.com/index.php?modul...a&tag=Grub2cfg

http://www.sidux.com/index.php?modul...a&tag=grub2bak

this is because grub2 is configured by scripts.

Last edited by aus9; 06-17-2009 at 07:43 PM.
 
Old 06-17-2009, 07:51 PM   #8
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Makes sense - wasn't sure, but I thought it worth raising just in case.
 
  


Reply

Tags
grub2, multiboot


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Trying to fix boot loader with multiple OSes 81bones Linux - Hardware 7 02-02-2009 06:45 PM
Multiple OSes Millenniumman Linux - General 25 09-05-2008 12:01 PM
Organized Install/Boot of Multiple Linux OSes bardanes Linux - Software 5 10-24-2004 05:15 AM
Multiple OSes Solaris, BSD Linux sovietpower Linux - Newbie 6 09-25-2004 05:57 PM
Sharing printers over multiple OSes mopron Linux - General 0 05-07-2002 09:03 PM


All times are GMT -5. The time now is 07:20 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration