Mike McCarty wrote:
Jim Cornette wrote:
Mike McCarty wrote:
The BIOS does NOT search the partition table for an active partition.
It is the code in the MBR which does that. All the BIOS looks for
is the first physical sector on the physical volume having the BOOT
RECORD signature (AA55) in the last two bytes. The BIOS accesses the
disc in a physical manner (LBA translation aside). It knows nothing
about partitions. Indeed, there are more than one way of partitioning
discs, and the "traditional" method is not the only one. Anyway, if
the BIOS finds the BR signature in the first physical sector, then it
simply loads it to 0000:7C00 (IIRC) and jumps to it. [NB: The processors
all reset to REAL mode, so this is not a selector address, but a
segmented address.]
I wiped out a disk that did have win2k on it. I removed all of the
partitions and set up 4 partitions. The first two were 100 MB partitions
which I dedicated one for each installation that I was making. I made
partition 1 active and then created an lvm for the first installation on
partition 3. Afterwards, I toggled the active flag on partition 1 to off
and toggled partition 2 to active. I created a separate lvm for the
second installation on partition 4. (setup a /boot on /dev/hda1 for
installation 1 and a /boot partition on /dev/hda2 for the second
installation. For the lvm content, I just made a swap system and a /
system for each of the two installations. For the seperate lvms for each
installation, I made different vg and lv names for the swap and / for
each installation)
Anyway, toggling either partition 1 or partition 2 to active would allow
the desired installation to boot. The only drawback would be that you
need to toggle the currently active partition to inactive followed by
making the new desired partition active.
So you are saying above that the MBR has the default code to search for
the active partition. The BIOS does not know about active partitions
without instruction from the MBR. Now if I took a brand new disk with
nothing on it, partitioned as described above and toggled the active
partition, it would just come up confused without some OS writing
information into the MBR?
It works if you wanted to simply toggle active partitions instead of
chainloading installations. Grub has to be putting some information in
the partitions for this to work. So you should be able to add entries
within grub in order to chainload either installation and forget about
adding grub to the MBR.
By the way, selecting advanced options during installation allows you to
choose where you want to install grub. Otherwise, it defaults to
installing grub into the MBR.
Mike
So if I want to install grub onto partition 2 of my first drive and
have no Grub installed into the MBR, the BIOS will not start loading
whatever is in the first sector of my second partition?
I repeat: The BIOS looks at the absolute first sector on the disc,
and if it ends with the BOOT RECORD marker AA55, then it loads it
to location 0000:7C00 and jumps to that location. If it does not
find the marker, then it looks at the next device in the list of
bootable devices. This is true for both floppy disc drives and
for fixed disc drives. What it does for CDROM and FLASH drives I dunno,
not having delved into that.
So the technology is still a little primitive? Sort of like needing to
access a specific address for the 8086 and MFM drives? (low level
formatting anyway)
I guess BIOS is less capable than I supposed. No technical research on
my part. I understand that going to the absolute first sector of the
disk, grabbing information from the MBR (whatever it may contain) and
getting information from the MBR as to where to shoot from next if it
stores active partition information within it would work.
I have not tried to load grub into a partition and then make the
partition active. I thought that I read that someone else was loading
grub from a partition.
That can be done. It just isn't done by the BIOS.
OK, I'll buy that.
I do it, for example.
My machine has the Windows XP Boot in the MBR. That bootstrap
looks for the XP Boot Manager, which has the capability to load GRUB.
In this case, not from the BR of another partition (although it is
installed there, too, and that's where I got it from) but from a file
in the XP file system. GRUB then loads stage 2, gets its config file
from the Linux partition, and allows me to boot one of several revisions
of FC. I also have some GRUB boot floppies, which are nice to have
for emergency situations. I believe that GRUB can also be installed
on a CDROM, though I have not done that.
I experienced messed up windows installations too many times to rely on
installing a file to load grub via the XP bootloader. I rely on XP
booting from the grub installed in the MBR. XP is of course on the
active partition 1 and knows how to boot without the MBR being effected
as well.
I changed the active partition for the other OS and the OS which was
on the active partition booted. When I changed the active partition to
the other "other" OS, the secondary OS booted. I assumed that grub
loaded in a similar way as the other OS to Load the Linux OS with the
information grub puts into the selected partition.
GRUB gets loaded by whatever loads it. If it is in the MBR, then the
BIOS loads it. If it is elsewhere, then something else loads it.
The BIOS has no concept of partitions. GRUB is not an OS. It is an OS
loader.
I knew grub was not an OS itself and simply locates the intended kernel
to load.
I want to try to run two different Linux
distributions and be able to toggle the active partition in my
experimenting. (Grub installed in the selected partition, no grub in
the MBR)
That is possible. It is even possible to chain load GRUB from GRUB.
I hope I'm not being overly terse. I have on occasion posted a
description of the full bootstrap process from start to finish.
Thanks for the explanation. The end result is the same. I guess my main
error was on thinking BIOS did this vs. information within the BR when
nothing is intentionally installed to the MBR.
Jim
Mike
--
No act of kindness, no matter how small, is ever wasted.
-- Aesop