[Gllug] Installing grub from a recovery CD
Mike Brodbelt
mike at coruscant.demon.co.uk
Sun Feb 27 12:41:10 UTC 2005
On Thu, 2005-02-24 at 18:00 +0000, John Winters wrote:
> On Thu, 2005-02-24 at 17:19 +0000, Ben Fitzgerald wrote:
> > On Thu, Feb 24, 2005 at 04:47:05PM +0000, John Winters wrote:
> > > On Thu, 2005-02-24 at 08:32 +0000, Tethys wrote:
> > > > John Winters writes:
> > > >
> > <snip>
> > >
> > > Perhaps they do it because you've got to have *something* in the MBR,
> > > and if Linux is the only OS on the box you won't have the MS-DOS boot
> > > loader there?
> >
> > Is this correct? I thought that if you mark a partition as bootable
> > in your drive partition table (which IIRC is in the first 512 bytes)
> > then your bios will try to boot the first sector in that?
>
> My understanding is that all your BIOS will do is load and boot
> whatever's in the MBR.
Indeed - the BIOS loads the first sector of the first hard disk (or the
first floppy disk if set up that way) into memory at 0000:7C00 (the CPU
is still running in real mode at this point), and then passes control to
it. What resides in that sector can be anything, so what happens next is
entirely down to your bootloader software. On a DOS/Windows system, the
MBR contains the partition table, and a small program that scans that
looking for an entry with the "bootable" flag set. It then uses BIOS Int
13h calls to load the boot sector for that partition and pass control to
that.
Installing LILO or Grub in the MBR replaces that program, but does not
touch the partition table itself - Linux systems typically use the DOS
partition table, unlike the BSDs.
> This historically would be the MS-DOS boot
> loader, which is the thing which then selects and boots the first
> partition marked as active. If you're using something more
> sophisticated in the MBR (e.g. LILO or Grub) then the "active" partition
> is irrelevant. (Although I believe some versions of Windows can get
> upset if they think they're running from a non-active partition.)
Yes - it's wise to set the partition table entry containing the Windows
C: drive to be active.
> > > This is what puts me off grub - the documentation is *still* very poor,
> > > and in particular it uses terms like "root directory" to mean something
> > > different from what it usually means, *without first saying what the
> > > re-definition is*.
However, the first time the machine doesn't boot cause something bad
happened, and you can just go to a grub command prompt and tell it what
the root partition is, where the kernel is, and then boot it, all
without the pain you'd have had to go through under LILO, it's all worth
it. Grub's idea of the root partition is "the one containing the kernel
image".
Mike.
--
Gllug mailing list - Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug
More information about the GLLUG
mailing list