LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 04-18-2002, 02:02 AM   #1
concoran
Member
 
Registered: Jun 2001
Location: 28N,82W
Distribution: XP,Ubuntu 9
Posts: 473

Rep: Reputation: 30
A GRUB question...


I have two installations of RH72, one in each disk.
Each disk has several partitions. The first RH is in /dev/hda1 and the second in /dev/hdb10.

How do I modify the grub.conf file such that it can boot the second RH i.e one in /dev/hdb10?

I found GRUB documentation rather long, and plead guilty at not reading all of it before posting this question. Hope you folks don't mind.

Thanks in advance,
Ravi
 
Old 04-18-2002, 02:40 AM   #2
5amYan
Member
 
Registered: Apr 2002
Location: The District
Distribution: FreeBSD, OBSD maybe Gentoo and Winblech XP
Posts: 291

Rep: Reputation: 30
What does grub.conf say now?
 
Old 04-18-2002, 02:57 AM   #3
5amYan
Member
 
Registered: Apr 2002
Location: The District
Distribution: FreeBSD, OBSD maybe Gentoo and Winblech XP
Posts: 291

Rep: Reputation: 30
Should be something like

title Red Hat Linux 1
root (hd0,0)
kernel /vmlinuz-yourkernel1 ro root=/dev/hda</1>


so adding something like

title Red Hat Linux 2
root (hd1,9)
kernel /vmlinuz-yourkernel2 ro root=/dev/hdb</2>

#Where
kernel /vmlinuz... #is relative to /boot
#and
ro root=/dev.... #is relative to / (</1>=/ partition for RH1 etc...)
#if they are on the same partition I beleiv eyou must give the full #path to /boot i.e

title...
root (x,x)
kernel /boot/vmlin... ro root=/dev/hdxx

hope this helps
 
Old 04-18-2002, 11:56 AM   #4
concoran
Member
 
Registered: Jun 2001
Location: 28N,82W
Distribution: XP,Ubuntu 9
Posts: 473

Original Poster
Rep: Reputation: 30
My current grub.conf looks like..
--------------------
title RH72 New
root (hd0,0)
kernel /vmlinuz ro root=/dev/hda1

title RH72 Old
root (hd1,10)
kernel /SecondRH/vmlinuz ro root=/dev/hdb10
----------------------------------------------------------
This however, wont boot into second RH, not sure why. I will try again to see if I made any spelling mistakes.

what does 'root (hd0, 0)' specify exactly?
__________________

Below is my harddisk map

HD0 : |<-- hda1 (RH1) -->|<-hda2 (win) ->|<- other partitions ->
HD1 : |<hdb1>|<hdb5>(swap)|<hdb6>|...|<-hdb10->(RH2)|....

From the map above, I want to be able to boot into RH1, Win, RH2.
SO, how should the grub.conf look like?

Thx in advance for all the help..
 
Old 04-18-2002, 12:07 PM   #5
5amYan
Member
 
Registered: Apr 2002
Location: The District
Distribution: FreeBSD, OBSD maybe Gentoo and Winblech XP
Posts: 291

Rep: Reputation: 30
title RH72 Old
root (hd1,10)
kernel /SecondRH/vmlinuz ro root=/dev/hdb10

should probably look like this

title RH72 Old
root (hd1,9) # starts at 0 so 10 is 9 9 is 8 etc
kernel /vmlinuz ro root=/dev/hdb10

If not try

title RH72 Old
root (hd1,9) # starts at 0 so 10 is 9 9 is 8 etc
kernel /boot/vmlinuz ro root=/dev/hdb10 #this line is different
 
Old 04-18-2002, 03:40 PM   #6
concoran
Member
 
Registered: Jun 2001
Location: 28N,82W
Distribution: XP,Ubuntu 9
Posts: 473

Original Poster
Rep: Reputation: 30
Thx for the reply, but got couple of questions again.

if you have to mention "root=/dev/hdb10", then why is
'root (hd0,0)' used at all?. What purpose does it serve?

Secondly, why should that be 'root(hd1,9)? Remember, my hard drive is not linear. It's something like

|<hdb1><hdb5><hdb6><hdb7><hdb8><hdb9><hdb10><hdb11>.

So, it shoud either be 'root(hd1,10) or root(hd1,7)'. What's your opinion?
(I want to try it right now, but don't have access to linux box from here ).
 
Old 04-18-2002, 04:42 PM   #7
5amYan
Member
 
Registered: Apr 2002
Location: The District
Distribution: FreeBSD, OBSD maybe Gentoo and Winblech XP
Posts: 291

Rep: Reputation: 30
why/

Well I try best I can

I'm not an expert on grub. Didn't help write it. But I use it and had to config
hda with OpenBSD, FreeBSD and W2k
hdb with rh7.2

Don't ask!

Quote:
if you have to mention "root=/dev/hdb10", then why is 'root (hd0,0)' used at all?. What purpose does it serve?
I beleive 'root (hd0,0)' is relative to where the kernel is. This isn't OS specific. If windoze were loading there it would still need (hd0,0). If I remember correctly the first time I loaded OBSD I had to specify (hd0,2,c) <<the third partition(where the OBSD kern is) of the second (UFS) partition of the first disk. <<Phew!@
Where as After moving it to the first partition it now works with
title OBSD 3.0
rootnoverify (hd0,0) #map kern w/o linux checks
makeactive #set kern
chainloader +1 # hand off boot process

If I remember FreeBSD used to need
title FBSD 3.2
root (hd0,0) # map kern
kernel /boot/loader # set and hand off

now I use FSBD 4.5 with (I think)
title FBSD 4.5
rootnoverify (hd0,1) # map w/o linux checks
makeactive # set
chainloader +1 #hand off

Whereas in linux
title RH 7.2
root (hd1,0) # map and check but no handing off cuz this is our
kernel /vmlinuz-mykern ro root=/dev/hdb2 #linux loader

#since this is our loader we tell it where to find the kernel. This
#is always relative to /boot. So in the above example we're
#telling grub to load vmlinuz-mykern from the /boot directory as
#read only (ro). to boot to a different kernel simply place it in
#the /boot directory and change grub.conf line
#kernel /vmlinuz-mykern to kernel /vmlinuz-newkern

#the last insrtuction 'root=/dev/hdb2' we tell grub where to find
#the root (/) filesystem. This is generally a different partition
#than /boot. thusly we must tell it where.

#On the occasion that root (/) and /boot are in the same
#partition
#you must define the full path to the kernel. i.e.

kernel /boot/vmlinuz-mykern ro root=/dev/hdxx

For your non linear hd. If 10 doesn't work as 9 and it's the 7th part try 6. hell try all 1>2>3> til it works.

If anyone knows of any errors or has doubts please voice them
and/or correct me please

hope this helps
send a message and/or email I'll gladly send my grub.conf...next time I boot to Linux. Mid project right now.

Last edited by 5amYan; 04-18-2002 at 04:51 PM.
 
Old 04-19-2002, 04:33 AM   #8
linuxcool
LQ Addict
 
Registered: Jun 2001
Posts: 1,183

Rep: Reputation: 47
The root (hd?,?) line is used to tell grub where its stage1 and stage2 boot programs are. The reason you put the root= entry on the kernel line is that the location of the stage1 and stage2 programs can be on a partition that is not the root ' / ' partition. This can happen if you have a separate /boot and root ' / ' partition. Do you have separate /boot and root ' / ' partitions? Could you post the output of these two commands fdisk -l /dev/hda and fdisk -l /dev/hdb?

The reason 5amYan is using root (hd1,9) is because you said that hdb10 is where your second linux is installed. So, hdb10 becomes (hd1,9) in grub.

Your kernel line gives the path to the kernel. Is this, /SecondRH/vmlinuz, the correct path to the second linux's kernel? If it isn't, change it to the correct path.
 
Old 04-19-2002, 01:17 PM   #9
concoran
Member
 
Registered: Jun 2001
Location: 28N,82W
Distribution: XP,Ubuntu 9
Posts: 473

Original Poster
Rep: Reputation: 30
Well, I got it to work, finally!

Since both RH1 and RH2 are 7.2, they use the same default
kernel (as of now). Therefore, I just kept the same kernel
to boot into either of these two. All I had to do was to change
the root directory to point to /dev/hdb10. If worked just fine.

The next goal, now is to get Grub to boot Suse. Hope it works
out well.

Thanks for the replies! I appriciate it.
 
Old 04-20-2002, 04:13 AM   #10
linuxcool
LQ Addict
 
Registered: Jun 2001
Posts: 1,183

Rep: Reputation: 47
You're welcome.
 
Old 04-23-2003, 09:08 PM   #11
concoran
Member
 
Registered: Jun 2001
Location: 28N,82W
Distribution: XP,Ubuntu 9
Posts: 473

Original Poster
Rep: Reputation: 30
Smile There you go, again

Hi There,
I just installed Redhat 9.0, and got Grub to boot into all the existing partitions. However, I don't know how to get Grub to load both QNX and FreeBSD. Any clues??
New partition table is
/dev/hda1 -> QNX
/dev/hda2 -> FreeBSD.

While I am trying to read ( ) lenghty Grub manual , I would appriciate if a quick answer is available.
Thx

Last edited by concoran; 04-23-2003 at 09:12 PM.
 
Old 04-24-2003, 09:52 AM   #12
5amYan
Member
 
Registered: Apr 2002
Location: The District
Distribution: FreeBSD, OBSD maybe Gentoo and Winblech XP
Posts: 291

Rep: Reputation: 30
try

title QNX V.v
rootnoverify (hd0,0) # map w/o linux checks
makeactive # set
chainloader +1 #hand off


title FBSD 4.x
rootnoverify (hd0,1) # map w/o linux checks
makeactive # set
chainloader +1 #hand off
 
Old 04-24-2003, 09:36 PM   #13
concoran
Member
 
Registered: Jun 2001
Location: 28N,82W
Distribution: XP,Ubuntu 9
Posts: 473

Original Poster
Rep: Reputation: 30
Unhappy

Thanks 5amYan, but it didn't work. not sure why
 
Old 04-25-2003, 07:29 PM   #14
concoran
Member
 
Registered: Jun 2001
Location: 28N,82W
Distribution: XP,Ubuntu 9
Posts: 473

Original Poster
Rep: Reputation: 30
Unhappy No Takers yet?

I really really want to boot QNX and FreeBSD using Grub.
 
Old 04-25-2003, 11:40 PM   #15
5amYan
Member
 
Registered: Apr 2002
Location: The District
Distribution: FreeBSD, OBSD maybe Gentoo and Winblech XP
Posts: 291

Rep: Reputation: 30
Quote:
title FBSD 4.x
rootnoverify (hd0,1) # map w/o linux checks
makeactive # set
chainloader +1 #hand off
works you just need to configur the appropriatehd(x,x)
and with some BSDs you need to add a third variable...
ie hd(0,2,c)

Read back through the post...

When you get to the grub screen you can stop it edit the boot commands by hand and write down the answers, boot and the edit grub.conf. It is much less time consuming than booting all the way up and editing grub.conf each try.

I am a little rusty with grub as I have not had a linux partition on any of my puters for quite some time. 6 months at least.

post the disk layout and your grub.conf we see what we can do.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
grub question...? matthewa Linux From Scratch 2 06-06-2005 03:08 PM
Not your regular GRUB question - just a short question for a fried MBR!! ziphem Linux - General 3 01-31-2005 01:51 PM
Grub question? BajaNick Linux - General 4 07-31-2003 11:35 PM
Grub question? BajaNick Linux - General 0 07-30-2003 07:58 PM
GRUB question malbo1 Linux - General 1 02-27-2003 05:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:25 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
Open Source Consulting | Domain Registration