LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 10-01-2012, 05:35 PM   #1
cOde13
LQ Newbie
 
Registered: Sep 2012
Location: /home/
Distribution: CentOS, RHEL, Ubuntu, Fedora, WindowsXP
Posts: 13

Rep: Reputation: 0
Unhappy Problem Booting Multiple Linux


Hello,

I'm trying to configure multiple Linux booting in one PC.

Here's output of "fdisk -l"

Code:
Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1        2040    16386268+   c  W95 FAT32 (LBA)
/dev/hda2            2041        7361    42740932+   f  W95 Ext'd (LBA)
/dev/hda3            7362        9730    19021824   83  Linux
/dev/hda5            2041        2693     5245191   83  Linux
/dev/hda6            2694        4733    16386268+  83  Linux 
/dev/hda7            4734        4929     1574338+  82  Linux swap / Solaris
/dev/hda8            4930        7361    19535008+  83  Linux
I've installed RHEL5 on /dev/hda6 & it's Grub on /dev/hda5 (/boot).
I want to add other Linuxes on other partitions & boot them using RHEL5's grub.
So, I've installed Fedora_16 on /dev/hda3, without installing it's grub.
Then added some "chainloader +1" rules in /etc/grub.conf:
Quote:
title Red Hat Enterprise Linux Server (2.6.18-8.el5)
root (hd0,4)
kernel /vmlinuz-2.6.18-8.el5 ro root=LABEL=/1 rhgb quiet
initrd /initrd-2.6.18-8.el5.img
title Windows
rootnoverify (hd0,0)
chainloader +1
title Fedora_16 (Verne)
root (hd0,2)
chainloader +1
But grub can't boot Fedora.

How to solve this?


Thanks.
 
Old 10-01-2012, 06:11 PM   #2
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 14.04
Posts: 1,337

Rep: Reputation: 42
might help

grub can write its own grub.cfg Make sure all partitions are mounted

In a terminal do:

sudo update-grub (takes a while, especially as you have a lot of partitions)

I am no expert, but I've never seen chainloader +1 in a Linux grub.cfg entry, except for Windows.
Typical entry for Fedora, which you can find in (Fedora partition) /boot/grub2/grub.cfg

menuentry 'Fedora (3.5.2-1.fc17.x86_64)' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-710cdbf5-48ff-484d-b1f8-9a143a78dbec' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos6'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6 --hint='hd0,msdos6' 710cdbf5-48ff-484d-b1f8-9a143a78dbec
else
search --no-floppy --fs-uuid --set=root 710cdbf5-48ff-484d-b1f8-9a143a78dbec
fi
echo 'Loading Fedora (3.5.2-1.fc17.x86_64)'
linux /boot/vmlinuz-3.5.2-1.fc17.x86_64 root=UUID=710cdbf5-48ff-484d-b1f8-9a143a78dbec ro rd.md=0 rd.lvm=0 rd.dm=0 SYSFONT=True KEYTABLE=us rd.luks=0 LANG=en_US.UTF-8 rhgb quiet
echo 'Loading initial ramdisk ...'
initrd /boot/initramfs-3.5.2-1.fc17.x86_64.img
}

The problem I see for you is: I have Ubuntu and Fedora. Ubuntu has 'control' of grub at boot. So if it adds a kernel, it does update-grub, which overwrites past entries. I don't usually have both partitions mounted, so it does not find Fedora. After a kernel update, I need to a) mount the Fedora partition b) run sudo update-grub

I would like to know how to automate this. For you it is even more important.
 
Old 10-01-2012, 06:24 PM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Gentoo
Posts: 15,366
Blog Entries: 2

Rep: Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981
RHEL 5 uses Grub, not Grub2, so your script won't work here, Pedroski.

@cOde13: If you want to chainload a Linux system you must install its bootloader to its root partition. Chainloading means that one bootloader starts the next one, which of course can't work if you don't have one installed.
 
1 members found this post helpful.
Old 10-01-2012, 07:00 PM   #4
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 14.04
Posts: 1,337

Rep: Reputation: 42
I did mention I am no expert! It is not my script, it comes with Linux. I could not write that.

But: I could chainload Fedora from the Ubuntu boot grub.cfg??? Point it at (Fedora partition)/boot/grub2/grub.cfg or how??

Can you tell me what the entry should look like?? That would save me updating Ubuntu grub.cfg every time.
 
Old 10-01-2012, 07:13 PM   #5
cOde13
LQ Newbie
 
Registered: Sep 2012
Location: /home/
Distribution: CentOS, RHEL, Ubuntu, Fedora, WindowsXP
Posts: 13

Original Poster
Rep: Reputation: 0
Thanks for your replies.

Quote:
Originally Posted by TobiSGD View Post
.........
@cOde13: If you want to chainload a Linux system you must install its bootloader to its root partition. Chainloading means that one bootloader starts the next one, which of course can't work if you don't have one installed.
It asked me to install Grub in /dev/hda ; can't recall if it asked for installing on particular partition. But I'll try and post here the result.
Is it possible to install Fedora's Grub to it's root partition using "linux rescue"? or, I need to reinstall Fedora?
 
Old 10-01-2012, 07:36 PM   #6
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Gentoo
Posts: 15,366
Blog Entries: 2

Rep: Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981
Quote:
Originally Posted by Pedroski View Post
I did mention I am no expert! It is not my script, it comes with Linux. I could not write that.

But: I could chainload Fedora from the Ubuntu boot grub.cfg??? Point it at (Fedora partition)/boot/grub2/grub.cfg or how??

Can you tell me what the entry should look like?? That would save me updating Ubuntu grub.cfg every time.
To chainload Fedora you have to install the bootlaoder to fedoras root partition. You don't point it to Fedoras boot config, but to the partition, where Fedoras Grub takes over, reading the config. Since I haven't used Grub (and especially Grub2) for a long tme I can't help you with the config.
 
Old 10-01-2012, 07:44 PM   #7
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 14.04
Posts: 1,337

Rep: Reputation: 42
Thanks, I'll work on that.
 
Old 10-01-2012, 08:27 PM   #8
cOde13
LQ Newbie
 
Registered: Sep 2012
Location: /home/
Distribution: CentOS, RHEL, Ubuntu, Fedora, WindowsXP
Posts: 13

Original Poster
Rep: Reputation: 0
Okay I've find it.

Thanks everyone.
 
Old 10-01-2012, 08:27 PM   #9
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Gentoo
Posts: 15,366
Blog Entries: 2

Rep: Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981
Nice to hear that it works. Please mark this thread as solved using the thread tools at the top of the thread.
 
Old 10-01-2012, 09:17 PM   #10
wolsonjr
LQ Newbie
 
Registered: Aug 2007
Distribution: Deb, Mint, Slack, LFS, Fedora, Ubuntu(LXDE)
Posts: 20

Rep: Reputation: 2
Not necessarily applicable to this case but - I've normally run 4 to 5 different systems at a time, usually with Deb as prime and Deb grub booting all, no chain except Win. With earlier versions of update-grub, it would create an incorrect entry for Fedora because the boot img file in Fedora was a different name format and unrecognized, causing a boot entry with no img file. Had to manually add it to grub.cfg.
I suspect this would not be the case with only Red Hat and Fedora since I ASSUME they would have the same construction and a Red Hat grub should correctly handle a Fedora construct.
 
Old 10-01-2012, 09:55 PM   #11
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 14.04
Posts: 1,337

Rep: Reputation: 42
Then you will have the same problem as me: update the Deb kernel, and you will wipe out your grub.cfg entries, unless you have all partitions mounted at the time. Why would you do that?

Seems to me chainloading is a good idea for multiple boot systems. Just gotta figure out how to formulate the entries in grub.cfg and the problem of the bootloader. I'm sure I told Fedora not to install the boot loader, as that would wipe out my Ubuntu grub.

Hmmm, need to think about this!
 
Old 10-02-2012, 07:06 AM   #12
wolsonjr
LQ Newbie
 
Registered: Aug 2007
Distribution: Deb, Mint, Slack, LFS, Fedora, Ubuntu(LXDE)
Posts: 20

Rep: Reputation: 2
No, that is not the case. When the new Deb kernel installs and updates grub.cfg, it reads the entire disk for OS's and adds them. They don't have to be mounted. The only problem is when it doesn't properly recognize the particular set-up and this is pretty much solved now.
Also, with more current grub installs, if you need to do anything special or manual, you can sudo edit /etc/grub.d/40_custom and add any menu entry you like. When grub updates, it will add anything it finds there to grub.cfg. This could specific boot items or even just a message/reminder to yourself.
 
Old 10-02-2012, 07:15 AM   #13
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Gentoo
Posts: 15,366
Blog Entries: 2

Rep: Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981Reputation: 3981
Now I remember why I rather use Lilo instead.
 
Old 10-02-2012, 07:37 AM   #14
Pedroski
Senior Member
 
Registered: Jan 2002
Location: Nanjing, China
Distribution: Ubuntu 14.04
Posts: 1,337

Rep: Reputation: 42
You're lucky! If my Fedora partition is not mounted, Ubuntu does not see it. Actually, I've never had it mounted during a kernel update. Next time I'll try.
 
Old 10-02-2012, 07:50 AM   #15
exsencon
Member
 
Registered: Feb 2008
Location: Belgium
Distribution: Ubuntu,LinuxMint,Slackware,Sabayon,Slax
Posts: 68

Rep: Reputation: 22
Yes, I am with TobiSGD on this. In order to multiboot Linux you put one Linux Grub (or Lilo) in the MBR and any other Linux you want to multiboot, you'll have to put its bootloader IN HIS OWN ROOT PARTITION otherwise poor grub can't recognize the linux you want to boot when you start your system. I have a multiboot system with 12 Linux,Opensolaris, PCBSD and WINXP with that simple system and everything is working like a charm.Simple system, simple solution.
 
  


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
Booting Multiple Linux OS's Will__E Linux - General 7 04-30-2012 10:25 AM
[SOLVED] booting multiple Linux distros faizlo Linux - Software 2 04-24-2012 09:18 PM
Windows + Multiple Linux Distro booting Mawos Linux - General 4 08-03-2005 09:57 AM
Tired of trying to rectify the problem with multiple linux booting!!:confused: Azzath Fedora 2 03-16-2005 04:28 AM
Problem with Lilo.conf booting multiple OS's sanfran49 Linux - Software 2 02-11-2004 03:37 PM


All times are GMT -5. The time now is 06:24 AM.

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