LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 03-17-2003, 11:09 PM   #1
correro
Member
 
Registered: Oct 2002
Distribution: RedHat 8.0
Posts: 140

Rep: Reputation: 15
GRUB. Which config file do I modify?


I'm tempted to draw the conclusion that the configuration of a Linux system is pretty complicated, and even confusing. For one thing, the configutation files for one application/service seem to be located in several places.

Take GRUB. There is "/boot/grub/grub.conf", and there is "/etc/sysconfig/grub". Which file do I modify if I wish to mount my Linux disk onto another machine?
 
Old 03-17-2003, 11:20 PM   #2
MasterC
Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
.conf usually means it's the configuration file. So you would normally edit the app.conf file to edit the configuration, such is the case with grup:
/boot/grub/grub.conf



Cool
 
Old 03-17-2003, 11:45 PM   #3
correro
Member
 
Registered: Oct 2002
Distribution: RedHat 8.0
Posts: 140

Original Poster
Rep: Reputation: 15
What if there is inconsistency between "/boot/grub/grub.conf" and "/etc/sysconfig/grub", regarding, say, where GRUB is located? Would it still work it out?
 
Old 03-17-2003, 11:53 PM   #4
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
Don't worry about /etc/sysconfig/grub. You should only have to edit /boot/grub/grub.conf .
 
Old 03-18-2003, 12:08 AM   #5
MasterC
Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
Quote:
Originally posted by correro
What if there is inconsistency between "/boot/grub/grub.conf" and "/etc/sysconfig/grub", regarding, say, where GRUB is located? Would it still work it out?
Could you be more specific? If you mean:

/etc/sysconfig/grub is a text file that reads:
#Grub location:
/usr/local/bin/grub

And
/boot/grub/grub.conf reads:
#Grub location
/usr/bin/grub

Then look to see which one exists. Most likely both won't. If both do, try:
ps -ax
And see which one is running (if any).

Obviously this won't be true with grub, but I am just using the example of the file in question

I think the confusion is where grub is and where grub.conf is. Grub is going to be the actual binary file, or something along those lines. grub.conf is simply the configuration file that you edit for grub to use/look at when it is called.

HTH

Cool
 
Old 03-18-2003, 12:47 AM   #6
correro
Member
 
Registered: Oct 2002
Distribution: RedHat 8.0
Posts: 140

Original Poster
Rep: Reputation: 15
Can the executable of the boot loader GRUB be located in "/sbin"?

This does not seem to make sense, because on that stage "/sbin" is not supposed to have been mounted.
 
Old 03-18-2003, 01:16 AM   #7
MasterC
Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
Well GRUB actually is a bit complicated like that. I'm not nearly correct in this, but here's a simple idea on how it works:
Grub places a small file, containing very little in the MBR. Everything it actually needs to boot linux is on the hd of the linux partition. Everything it needs to boot win is on the win partition. It basically just contains symlinks, not much else. This is why you don't need to run grub after making changes to ensure they are fed to the MBR.

Bad, bad example, but works for simplicity's sake. For more info on how grub works, or just more accurate info, check out some of the links on google.com/linux It's actually quite interesting.



Cool
 
Old 03-18-2003, 01:26 AM   #8
correro
Member
 
Registered: Oct 2002
Distribution: RedHat 8.0
Posts: 140

Original Poster
Rep: Reputation: 15
Let's cite an example to illustrate the point.

Suppose I first install Windows on hda; then I install Linux on hdb.

The system boots and comes to GRUB interface, where I select which OS to boot into.

If I understand it correctly, the boot process is
BIOS (on motherboard)
-> MBR (on first sector on hda)
-> GRUB (don't know where)

So the question is, where is GRUB actually located? On hda or hdb? And where specifically?
 
Old 03-18-2003, 01:33 AM   #9
MasterC
Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
GRUB is located on hdb. However, you don't need grub to boot win, just need to tell your BIOS where win is (the small file grub placed on the MBR does this), then win will boot win.

Grub points to win, win in turn then boots. Grub points to linux, which then in turn points to your grub executable and boots.

It really does seem very confusing if you don't know how grub works, or how boot loaders work (not that I am an expert, I've just read quite a bit on how grub and bootloaders in general work). Really, I suggest at least checking out this how-to (doesn't really explain alot, but should give you a small idea, check out www.google.com/linux and search on grub for more info, if you are really interested it's worth the read):
http://www.tldp.org/HOWTO/Linux+Win9x+Grub-HOWTO/



Cool
 
Old 03-18-2003, 01:58 AM   #10
correro
Member
 
Registered: Oct 2002
Distribution: RedHat 8.0
Posts: 140

Original Poster
Rep: Reputation: 15
I'm starting to get the picture. Thanks for your patience, MasterC.

To follow up with the previous example, if GRUB is on hdb, and then I change the Linux disk to master (therefore hdb becomes hda), or change it to secondary master (hdb becomes hdc), will it still boot?
 
Old 03-18-2003, 02:01 AM   #11
MasterC
Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
Good question, I don't think so though. It's pointing to the specific device, notice in grub.conf which device. I don't think it would boot in that case, but stranger things have happened.

Like I said though, I am far from a boot loader expert, just read a lot of pages on boot loading, grub, and lilo.

Oh, and anytime, these are the kinds of questions that intrigue me (I was supposed to go to bed an hour ago )

Cool
 
Old 03-18-2003, 02:18 AM   #12
correro
Member
 
Registered: Oct 2002
Distribution: RedHat 8.0
Posts: 140

Original Poster
Rep: Reputation: 15
Suppose my objective is take hdb (Linux disk) off from current machine, and mount it on another machine as hda.

I take the following steps:

(1) While it is running on current machine, I manually change all mentions of "hdb" to "hda" in "/boot/grub/grub.conf" and "/etc/sysconfig/grub".

(2) I shutdown the machine, remove hdb, change the jumpber to master, and mount it in the primary IDE bus of the new machine.

You think this would work?

No need to reply now, MasterC. You deserve a good sleep :-)
 
Old 03-18-2003, 05:44 AM   #13
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967
that will be what you want eventually but (i would assume) that you don't want to change anything until AFTER you swap the device. swap the drive over and when you go to boot change the command you actually use to boot with (press e) replacing any hd1's with hd0 and then boot it and it should boot fine. once you're comfortable with that then change the configuration file permanently.

i've actually only been on grub a short time myself and havne't tried swapping a drive though so you *might* need to reinstall grub again into the bootloader so that it will know where to look for the grub.conf.
 
Old 03-18-2003, 11:05 AM   #14
jglen490
Member
 
Registered: Apr 2002
Location: The next brick house on the right.
Distribution: Kubuntu 8.04
Posts: 668

Rep: Reputation: 31
Getting back to the original question, there is one rule that is universally applicable to Grub. ALWAYS edit /boot/grub/menu.lst. There may be other files that are linked to this file, and there may be distros that make use of a link to this file. But the only consistent, certain method of effecting changes in Grub behavior is to edit /boot/grub/menu.lst.

Why is that different from Lilo (/etc/lilo.conf)? Because Linux is not a monolithic, monopolistic set of software, there are bound to be differences. Yes, there are standards that many distros have chosen to subscribe to, but there are also multiple (sometimes) competing standards that will someday be settled, but for now just aren't.

There are also differences in how some software creators view some standards. For instance, one could make a case that since Grub actually (at least initially) runs outside Linux, it is really not a Linux configurable item and therefore doesn't have to be in /etc, and infact makes more sense to be in /boot. I don't know that the GNU folks have chosen that as their rationale, but it could make some sense.

These differences can be confusing, that much is true, but for the most part, such differences are the exception rather than the rule.
 
Old 03-18-2003, 11:11 AM   #15
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967
well menu.lst is deprecated now, and the docs suggest linking grub.conf to menu.lst for backwards compatability, you shouldn't need it at all now.
 
  


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 config file not there linuxmandrake Mandriva 1 05-28-2005 03:13 PM
Help! Modify my grub file for triple boot? thegreatnorth Fedora 1 01-03-2004 01:09 PM
I want change mail header info, which config file i should modify? exper Linux - Software 2 12-05-2003 07:46 AM
GRUB config file me23 Linux - Newbie 3 07-17-2003 01:02 PM
modify file access & modify timestamps i2itstud Linux - General 1 05-20-2003 04:34 AM


All times are GMT -5. The time now is 12:32 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