A slight modification of the last boot process is replacing the normal MBR with a utility called BOOTACTV, which prompts for the partition to boot from. This utility requires that a non-DOS-compatible copy of the boot sector be written, so you should use it only when Linux will be the dominant operating system and LILO is not booting the other operating systems properly.

When in place, the Master Boot Record holds a copy of BOOTACTV. When booted, BOOTACTV enables you to choose which operating system to boot. BOOTACTV can then read a boot sector from a partition to load that operating system. When the MBR holds BOOTACTV, you can’t use the MBR as you normally would with other operating systems, such as DOS or OS/2. You can, though, replace BOOTACT with a normal MBR.

To install BOOTACTV, follow these steps:

1. Boot Linux as usual. Make sure you have a boot floppy disk in case of problems.

2. Copy your existing Master Boot Record to a floppy disk in case of problems. The command to copy the MBR from the main drive (/dev/hda) to a floppy disk using 512 character blocks (the default) is
dd if=/dev/hda of=/fd/MBR bs=512 count=1
3. Use the setup or LILO installation program to copy LILO into the boot sector of the Linux partition (not the Master Boot Record).

4. Install BOOTACTV into the Master Boot Record. The BOOTACTV utility is usually called bootactv.bin and should be in the current directory when you install it into the MBR with the command
dd if=bootactv.bin of=/dev/hda bs=446 count=1
5. Reboot the machine to boot BOOTACTV from the Master Boot Record.

Your machine should load BOOTACTV and allow you to boot any other operating system on a partition. If Linux or another operating system does not boot, use your boot floppy disk to start Linux. If only Linux doesn’t boot, the boot sector LILO for the Linux partition is not working and can be rewritten using the setup or LILO configuration utilities. If none of the partitions boot, remove BOOTACTV by replacing the old Master Boot Record with the command

dd if=/fd/MBR of=/dev/hda bs=446 count=1

You can also reinstall the Master Boot Record from within DOS, if you have a DOS boot floppy disk. When in DOS, issue the command

fdisk /mbr

If you don’t want to alter your Master Boot Record but have more than one partition dedicated to Linux, you can install BOOTACTV on one of the partition’s boot sectors and use the fdisk utility to toggle the active partition. However, if the hard disk is repartitioned or the filesystems are altered in size, the boot sector will have to be rewritten. To write BOOTACTV to the fourth primary hard disk partition, for example, copy the existing MBR to the partition’s boot sector, and then install BOOTACTV with the following commands:
dd if=/dev/hda of=/dev/hda4 bs=512 count=1
dd if=bootactv.bin of=/dev/hda4 bs=446 count=1

Installing DOS and Linux

Most Linux installations coexist with DOS and use the DOS Master Boot Record. In this case, the MBR is read and the active partition (set by fdisk) is booted automatically. This installation method is one of the safest because no changes to the DOS-installed Master Boot Record are performed, and it is easy to remove or reconfigure partitions at any time without worrying about compatibility with the MBR.

Later versions of DOS (6.00 or higher) will overwrite an existing MBR if they are installed after Linux. If this happens, you won’t be able to boot Linux from the MBR, although DOS will boot. You can fix the problem by running LILO again or by making the Linux partition active.

You can change the active partition at any time using the fdisk utility or the Linux utility activate. The setup program within Linux can usually change the boot partition, too. Only one partition on a hard disk can be active at a time. Some operating systems, including Linux, let you change your mind about which operating system to boot after the active partition has been read, assuming a delay was built into the boot process. Linux, for example, can display the boot prompt and wait for a reply or a timeout to occur before starting to boot Linux.

To use this type of approach for Linux, install LILO into the boot sector of the Linux partition. To make it bootable, run fdisk and set that partition number as the active partition. Rebooting the machine will boot into the active partition. When Linux is replaced or removed, the boot sector of the new operating system will overwrite the Linux partition’s boot sector, requiring no changes to the MBR.

Using BOOTLIN

With the Linux BOOTLIN configuration, which is also a common method of installation, the Master Boot Record does not change. During the boot process, the Master Boot Record is read, and then a decision about which operating system to load is made. This decision is usually based on a user prompt. Essentially, this boot process is the same as a normal DOS boot except the program BOOTLIN is invoked in either the CONFIG.SYS or AUTOEXEC.BAT files. This program can then execute a program that lets you choose the operating system to load. The program BOOT.SYS, for example, may be used to present a menu that enables you to choose between a Linux and DOS boot.

To install BOOTLIN in your DOS partition, follow these steps:

1. Boot Linux. Make sure you have a boot floppy disk in case of problems.

2. Place a copy of the Linux kernel in your DOS partition either through DOS or with one of the Linux Mtools. You only have to copy the kernel file into the home directory (or any subdirectory) of the DOS partition. You can even do this step from the floppy disk.

3. Copy BOOT.SYS and BOOTLIN.SYS to the DOS partition, using the same process you used to copy the Linux kernel.

4. Add both the BOOT.SYS and BOOTLIN.SYS files to your CONFIG.SYS file.

5. Make sure DOS is the active partition, and reboot the machine.

When DOS starts, the BOOT device driver should give you the option of booting DOS or Linux. If you have problems, remove the BOOT.SYS and BOOTLIN.SYS files from the CONFIG.SYS file and you are back to normal.

Using the BOOT.SYS program has a useful advantage in that no boot sectors are altered to support several operating systems. As a result, loading and removing operating systems from a hard disk is easier. You can use both the Master Boot Record with active partition and BOOT.SYS approaches so that the hard disk starts to boot whichever operating system has the active flag, and then pauses and waits for confirmation from the user (or a timeout to occur). In this case, no changes to the Master Boot Record need to be made.