On Mon, Jul 02, 2001 at 12:27:19AM +0100, Adam Bower wrote:
What I meant to actually say in simple english was that I believe the MBR only stores the current active partition and looks there for the boot record instruction bit.
Perhaps it would help to understand more of the boot process, so here it as to the best of my knowledge.
After doing the power on self test, the BIOS looks round for something to boot. It may have the order hard coded or, more likely, have it configured in the BIOS setup. It examines each device in turn and tries to read the first sector from that device and tests it to see if it is a boot record. A boot record begins with a 8086 jump instruction (and there may be other tests too).
Once a boot record is found, it is loaded into memory and executed - it is, after all, a short machine code program. In the case of the MBR of a hard disk, this program is expected to choose an OS to boot.
The standard MBR (non-LILO) simply checks through the parition table to find the partition marked as active, loads the boot record from the first sector of that partition and executes that. That could be the boot sector part of LILO, or the boot record of any other OS depending on how things have been set up.
A boot record is 512 bytes and even using hand crafted assembler this is not much space to write a clever boot loader like LILO. Instead the boot record part of LILO loads a second stage loader which in turn offers the user interface and loads the selected kernel. LILO finds the second stage loader because the /sbin/lilo program installs a pointer to its place in the file system in the boot record part of LILO. Similarly the /sbin/lilo program generates a map to enable the second stage loader to load kernels without having to understand the filesystem.
So, going back to where this seemed to start, if you install LILO on the MBR and then subsequently blow away the Linux partition, you risk LILO not being able to find the second stage loader and thus not being able to boot anything. Of course if you just delete the Linux partition without overwriting it LILO will continue to work as it still has the disk address of the second stage loader, but this will fail as soon as you install something new on what was the Linux partition (even another copy of Linux).
HTH, Steve.