bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Grub question


From: walt
Subject: Re: Grub question
Date: Tue, 22 Jul 2008 17:26:04 -0700
User-agent: Thunderbird/3.0a2pre (X11; 2008072205)

y_farkash wrote:

walter s wrote:
By default, grub looks for /boot/grub/menu.lst on the boot drive (where
grub resides in the mbr).
But if, for sake of argument, I have grub on the MBR of the first HD (lets
call it hda), and I have hda1 being a Debian partition and hda2 being
whatever, Gentoo, doesn't matter., both of those Grub can read, how does
Grub knows where to look? If both hda1 and hda2 had a /boot/grub/menu.lst?!?

I mean, sure,. I can try and create it, but I am just wondering if anyone
knows...

Sorry, I wasn't clear.  First, I'm still hedging on how grub-install works
because I've never used it.  I've always installed from the grub command
line because that way I'm sure what's happening.  (I could read the info
page about grub-install, I suppose ;o)

As an example I'll show you how I do it:

Recall that grub needs to grok the filesystem where its config files are
stored, including menu.lst of course.

I always make a *small* DOS partition on my boot drive, and then copy
the grub installation files (e.g. e2fs_stage1_5 et al) to /boot/grub/
on the DOS partition.  (This isn't strictly necessary but I like to
keep them on a partition that any OS can read, just in case I can't
boot to linux one sorry day.)

From linux (or whatever OS I'm using to install grub) I start grub so
I can use the grub interactive shell.

From the grub shell I set the 'root' device to my small DOS partition
(usually (hd0,0) just from long habit).  And then I type 'setup (hd0)'
because hd0 is my boot drive and I want grub installed to the mbr of
hd0.

That's it, finished!  When I reboot the machine, grub will by default
look for menu.lst in the (hd0,[DOS partition])/boot/grub/ directory
*because* that was the 'root' partition at the time I installed grub.
That's what determines the default location for menu.lst during grub
installation.  (I think maybe the --boot-directory flag for grub-install
does something similar, but I'm just guessing.)

Now, just to confuse you further, Felix has a good point:  I recall from
decades past (not past enough!) that the ordinary DOS mbr will boot the
partition marked *active*, even if it's (M$ forbid!) not Windows.

If you now install grub to your linux partition, lets say (hd0,5) instead
of (hd0), for example, and then use fdisk to mark that partition 'active',
even the old DOS mbr *should* then start grub running instead of Windows.

Felix, am I remembering all of this correctly?  Is it still true for the
mbr installed by XP or Vista?  (I don't intend to experiment ;o)






reply via email to

[Prev in Thread] Current Thread [Next in Thread]