LinuxQuestions.org
Register a domain and help support LQ
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 06-20-2008, 12:56 PM   #1
hpladd
Member
 
Registered: Feb 2003
Distribution: Kubuntu
Posts: 142

Rep: Reputation: 15
GRUB -- 2 menu.lst files ?


I discovered that I have two /boot/grub/menu.lst files. One is on drive a: The other on drive b:

Interesting, the menu.lst file that is read at boot is located on drive b:

However, drive a: is the drive from which the system boots -- according to the bios.

How does the system determine which menu.lst file to reference?

I use Kubuntu Feisty.

Thanks
 
Old 06-20-2008, 01:32 PM   #2
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
The grub portion in the mbr tells where to look in what partition for the menu.lst
 
Old 06-24-2008, 01:21 PM   #3
hpladd
Member
 
Registered: Feb 2003
Distribution: Kubuntu
Posts: 142

Original Poster
Rep: Reputation: 15
Quote:
The grub portion in the mbr tells where to look in what partition for the menu.lst
How is this portion of the MBR updated or edited, I wonder? Clearly the MBR would be binary, so it is not edited directly. Perhaps it happens everytime the menu.lst file is edited/changed?
 
Old 06-24-2008, 01:43 PM   #4
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
You edit the mbr by telling it where to look for the root directory. Say you want it to boot from the first partition of drive a and that is where your menu.lst is in terminal as root type grub and you should get a grub prompt then to change the mbr type

root (hd0,0)
setup (hd0)

Now on boot the mbr will point to sda and the first partition. Grub starts counting from 0 not 1, that is why (hd0,0) means the first hd, first partition.

(hd1,0) means second hd or sdb in most cases and the first partition and of course it you change root you need to tell the mbr and you do that with
setup (hd0)

This man has written numerous articles on grub and if you look at his signature there are several links to his articles

http://www.justlinux.com/forum/showthread.php?t=144294
 
Old 06-24-2008, 02:26 PM   #5
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
Larry is right.

I just show the variety of it below.

We tell Grub where you want to source its system files from by the "root" statememnt.

The "setup" is to link the Grub's system files to the location you desire.

We can play tunes with it.

Say if you want Grub in the 14th partition of your 3rd disk to

(1) able to boot from a floppy,
(2) in the MBR of the 1st disk so that it boots whenever there is no floppy in the drive,
(3) chainloadable in its root partition so that anther operating system can boot it (like Xp, Vista or another Linux)
(4) put into the MBR of the 3rd disk just in case you may need it one day
(5) Boot it up now

You can all them in one go in a Grub shell or a Grup prompt. The latter is needed if you want Item (5). A Grub shell is the one you get it in the Linux terminal by typing "grub". A Grub prompt is the one you get by pressing the "c" key at the booting screen at which time the kernel has not yet been loaded. Many distros drop the Grub prompt and offer you a graphic screen instead.

Code:
root (hd2,13)
setup (fd0)
setup (hd0)
setup (hd2,13)
setup (hd2)
chainloader +1
boot
The partition becomes chainloadable after it has been "setup (hd2,13)"

What Grub does in the "setup" statement is to dump its stage1 (512 byte large) in the specified destination and hard-codes the hard disk address specified in the "root" statement so that it can get back to it.

There is nothing complicated involved. People just don't play around with a boot loader because it is low-tech.

Last edited by saikee; 06-24-2008 at 02:33 PM.
 
  


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
Grub Menu doesn't reflect menu.lst file fatsheep Linux - Software 4 06-11-2007 02:29 PM
GRUB menu.lst/grub.conf file with multiple partitions dasy2k1 Linux - General 1 04-19-2007 09:42 AM
/grub/menu.lst file disappeared but computer still boots (grub) rrrssssss Linux - General 5 04-08-2007 10:02 AM
Grub 0.97 issues on slackware - grub-install is very slow, & updating menu.lst fails dieyouspammer Linux - Software 1 02-27-2006 02:06 PM
need grub menu.lst example pk108 Mandriva 4 12-11-2004 07:45 PM


All times are GMT -5. The time now is 12:03 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration