bug-grub
[Top][All Lists]
Advanced

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

Re: during boot, how does grub decide from which disk to load the grub.c


From: John Lumby
Subject: Re: during boot, how does grub decide from which disk to load the grub.config?
Date: Sat, 26 Mar 2005 12:56:41 -0500

Peter Jones <address@hidden> wrote

On Sat, 2005-03-19 at 19:30 -0500, John Lumby wrote:

> What actually determines from which hd* grub will load its grub.config?

Grub's device map and the BIOS are really the only parts that matter.
What happens is this:

1) you decide to install grub
2) you put "(hd0) /dev/hda" in /boot/grub/device.map
3) you run the grub shell, and in it you do:
 a) root (hd0,1)
    This tells it that the device to look for files on is what
    grub calls "(hd0)", and the FS is on the first partition.
 b) setup (hd0)
    This  [...]

Thanks Peter ...   But I didn't say setup (hd0), I said setup (hd1).
With your example, both disks (source for the stage files and target for setup) are one and the same, and of course when you eventually come to boot from this one disk, grub gets its configuration from this one disk.

I tried to apply your explanation to my case but the conclusion I come to is that, after I've moved my target disk over to hd0 to boot from it, it should get its configuration from this disk during boot. But it doesn't, it gets it from hd1.

I wonder if you would be so kind as to work through what happens when source is hd0, setup is to hd1, then shutdown, switch disks around physically and boot again.

The reason I really don't want to use the same disk for source and target during setup is that this disk is brand new and although I have copied some files onto it, it has never run a successful boot. Somehow I feel it's safer to use an existing, established, disk as root when doing setup to a new disk.

6) you boot the box up, it loads the boot sector from the disk bios
   chooses, and the boot block that's there says to look for stage2
   on the first bios disk.

This step is the crux of the question I asked. But what I'm asking is - what are the rules governing this step? On my PC, as far as I know, BIOS *always* chooses what I call /dev/hda (hd0) as boot disk - How would bios ever decide otherwise? Only if I go into the BIOS menu and change something, right? So it boots from hd0. And then according to what you say, it should go to then first disk, which is hd0. But it doesn't, that is my point - in my case, after booting hd0 (which as hd1 when it was setup), it goes to hd1 for its config file. Now, you said stage 2, but I'm asking about the grub.config. Maybe it looks for stage 2 on hd0, but the question in my subject line is, how does it decide from which disk to load the config?

John






reply via email to

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