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
 
LinkBack Search this Thread
Old 06-29-2006, 08:06 AM   #1
dinisco
LQ Newbie
 
Registered: May 2006
Posts: 9

Rep: Reputation: 0
changing grub configfile location


I'm multibooting the 32bit and 64bit versions of redhat and fedora using grub. Grub gets installed to the mbr and looks for grub.conf in the /boot partition of the last OS I install. In other words, if I install the boot partition of rhel_32bit on /dev/sda1, then install the boot partition of rhel_64bit on /dev/sda6, grub only recognizes changes made to the grub.conf that resides on /dev/sda6 (or (hd0,5) in grub terms).

My question is, what is the best way to view and change the config file grub looks for? I was able to change it from /dev/sda6 (hd0,5) to /dev/sda1 (hd0,0) by installing (or re-installing) from the grub shell...

install (hd0,0)/boot/grub/stage1 d (hd0) (hd0,0)/boot/grub/stage2 p (hd0,0)/boot/grub/grub.conf

Is there a better way to do this? Is there a way to view the current config file grub reads? Is there an alternative to the interactive shell so some of this stuff can be scripted (grubby and grub-install don't seem to have the options)?

Thanks
 
Old 06-29-2006, 10:32 AM   #2
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware, Cross Linux from Scratch, Gentoo
Posts: 2,640
Blog Entries: 1

Rep: Reputation: 194Reputation: 194
This is the GRUB manual that might help.

The configuration file that GRUB uses is called grub.conf or menu.lst. Often times menu.lst is a link to grub.conf. It is found in /boot/grub You can view it in vi, vim, nano, gedit, kedit, etc., etc., ad naseum.

When I install subsequent distributions, I choose not to install the bootloader (GRUB or LILO). I then edit the existing grub.conf to add the new distribution. If you uncomment the hiddenmenu line in grub.conf, you will be presented a choice of distributions when you boot.
 
Old 06-29-2006, 02:35 PM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: back to Arch
Posts: 16,659

Rep: Reputation: 425Reputation: 425Reputation: 425Reputation: 425Reputation: 425
If I am not mistaken....

The location of the menu.lst file has to be hard-coded into GRUB. This file helps tell GRUB where to go for it's next steps. If there were another file to tell GRUB where to find menu.lst, then where would THAT file go?

Somebody must have figured out what bytes to change, but I've never seen it.
 
Old 07-06-2006, 06:36 AM   #4
dinisco
LQ Newbie
 
Registered: May 2006
Posts: 9

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

I ended up creating a small partition, installing grub on the mbr, and installing /boot to the small partition. I copied the contents of /boot to the root filesystem and remounted /boot as /boot_common. Then I linked /boot/grub/grub.conf (root filesystem) to /boot_common/grub/grub.conf.

I had to modify grub.conf because technically my initrd and vmlinuz were not under a separate boot partition and were now on hd0,1 not hd0,0.

I chose bootloader --location=partition for my subsequent installs (I could have chosen "none", but that didn't create a grub.conf for that particular install). Then I appended grub.conf from each installation to /boot_common/grub/grub.conf. I also had to mount /boot_common on each new OS. This gave me the ability to edit grub.conf from all OS's.

Not very elegant, but it seems to be working.
 
  


Reply

Tags
boot, grub, mbr, 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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing location of /etc/fstab? Aeiri Linux - Software 1 11-23-2004 04:36 PM
changing the temp location? fred22 Linux - Newbie 4 06-30-2004 10:15 AM
grub not loading configfile orinjus Fedora - Installation 1 06-22-2004 04:02 AM
Changing boot location podollb Linux - Hardware 8 10-15-2003 02:48 AM
changing hard drive location thelight1 Linux - Hardware 3 10-12-2003 06:20 AM


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