WebAppendix-1 MULBOOT Multi-booting a PC

Multibooting means installing two or more operating systems on one computer. At boot time you use a menu (or some other mechanism) to specify which one of the installed operating systems you want to use for this session.

First we explain how to set up a multiboot system. Then, we give you some background information. If you have a recent system, and are using recent versions of Linux, installing multiboot is almost trivial and you might not need to bother with the background details. But read through them first before you start, because …

Warning: the boot mechanism is intricately tied in to low-level hardware details of your machine. It is affected by:

If you’re unlucky, everything will conspire against you and make installation hard. What we cover below is a representative example using fairly modern hardware, but you may need to look up some of the references in the Notes in some circumstances. See the Categorized List of HOWTOs reference below for pointers to further information.

Setting up a multiboot system

Our example installs four operating systems on the machine:

a. Windows-98

b. Windows-NT 4.0

c. Windows-2000

d. Linux

If you don’t need all these, omit any you don’t want. We haven’t tested an installation with Windows-XP but would expect it to work equally well. (The Notes below give you pointers on how to install DOS or Windows-9x with Linux.)

Installation Procedure

0. Partition your disk

Because of Windows install problems you may find it best to allocate the first partition, then install the first operating system, then allocate the second partition and install the second operating system, and so on. (If you’re using Debian for partitioning, it only takes a couple of minutes to boot the install system and run the partition tool, so this need not add much time to your job.)

1. Install Windows-98

There are three things to watch out for in the install, two now, and one when you install Linux:

Hazard-a: When you allocate a disk partition for Win-2K, ensure you leave enough free space for Linux to use later.

Hazard-b: if you have an old BIOS that limits the amount of accessible disk, the partitions that your later operating systems will boot from must fall within the BIOS limit.

2. Install Windows-NT 4.0

The NT boot loader automatically constructs a menu that lets you choose NT or 98 at boot time.

3. Install Windows 2000

Your Windows boot-time menu now lets you choose 2000, NT or 98.

4. Install Linux

Hazard-c: if you’re using RedHat Linux, make sure you don’t select the installation option that zaps all the existing partitions.

The Linux GRUB or Lilo menu lets you choose RedHat or the Windows stuff. If you choose Windows, you get the Windows boot loader menu as in step-3 above.

This works so easily and so well because the Linux boot loaders neatly handle booting non-Linux operating systems by "chain loading" – calling the other operating system’s own boot loader in turn. (RedHat 8 uses the GRUB boot loader by default, and Debian 3.0 uses Lilo.)

Why multiboot?

On test machines we use multibooting extensively. Sometimes we need a particular version of Windows, e.g. when we’re checking out how a Windows-98 client machine interacts with a domain controller running Windows-2000. At other times we might want Linux, e.g. when trying out a new bind DNS server. By having all the different operating systems on each of our test machines, we cut down on the total number of machines we need, but can still build almost any network configuration we need.

On a production machine, if you use one operating system all the time and only need to use a different one occasionally, multibooting saves the cost of a separate machine. Typical examples are:

Background information on multibooting

1. GRUB –Grand Unified Bootloader: this is a wonderful piece of software and is both flexible and easy to use. GRUB is the default on RedHat version 8.0.

2. LILO – "Linux Loader": older than GRUB and a little more difficult to set up. LILO is standard on Debian, at least up to version 3.0r1 ("Woody"). (A disadvantage of LILO is that when you upgrade your system to a new version of Linux, or install a new kernel, you have to repeat certain steps manually. Read your Lilo manpage for details.)

Tip: a rule-of-thumb when installing multiple operating systems on a single machine is to install them in order of age – oldest ones first and the most recent last.

Disk partitioning

To complicate matters further, partitioning inherits a lot of weirdness from DOS. (DOS is prehistoric and was the first operating system for PCs.) If you want 1, 2, 3, or 4 partitions on your disk, you can use the simplest partition type – primary partitions: you divide the space in the ratio you want between the partitions you allocate. If you want more than four partitions, you can only allocate a max. of three primary partitions, and the next partition must be specified as an extended partition. Then, within this extended partition, you can define as many logical partitions as you want, each one using some of the total space you allocated to the extended partition in the first place. (Loosely, the extended partition is a bit like a container, which holds the logical partitions.) You can only have one extended partition, and you can’t use it directly for data – you have to allocate logical partitions to use the space.

Warning: We’ve found that the Windows-98 partitioning tool isn’t robust. It has on occasion created partitions that overlap: your system seems to work for a while, but using one operating system can corrupt parts of another. Yuk!!!

Warning: We’ve also found that Windows systems can fail to install if the partitioning isn’t perfect (e.g. if you’ve played around with the partitions and sizes a few times before getting them right.) We also suspect (but haven’t investigated fully) that Windows-NT and Windows-2000 can get upset when there are large logical partitions present. Once we had to use the Linux dd utility to zero the physical disk (/dev/hda in our case) and start all over again.

Warning: We assume your machine is "empty" – no operating system installed, and nothing on the disks is important. If you have any data on the PC, back it up because it’s almost certainly going to be over-written.

Tip: In spite of what we’ve just said, if you already have an operating system installed that would be the first to be installed according to the instructions below, then you may be able to use it as it is.

Tip: Almost always, all the space on your disk is allocated to existing partitions, but you will need to create another partition. As long as there’s enough free space within an existing partition, you may be able resize the partition, making it smaller, and leaving enough space for the new partition(s) you want. Whether you can do this or not will depend on where the free space is, and how many partitions of what type you have. (E.g. if you already have four primary partitions, you’re out of luck. But if you only have two primary partitions, and one of the is only 25% full, you can probably just rearrange what’s there.

See the Notes for partitioning tools.

That’s all we cover on disk partitions. For further information see the Notes.

Notes and further reading

The GRUB boot loader

The LILO boot loader

BIOS limitations on disk size

Disk partitioning

On Linux there are five common partitioning tools:

1. fdisk: probably the oldest and hardest to use

2. cfdisk: a nice formatted-screen program that’s easy to use. This is what we almost always use (out of habit rather then the result of an in-depth technical comparison :-).

3. parted: (partition editor): very sophisticated – lets you move and copy and resize partitions

4. sfdisk: mostly for looking at current partitions but has the useful facility that it can and partition a disk according to a set of partition specs read from a file. This can be very useful if you have repetitive partitioning to do on several machines.

5. fips ("First nondestructive Interactive Partition Splitting program"). parted is much more sophisticated than fips so you’re better off using parted. However, you’ll often find references to fips in older documentation

There are other partitioning tools, especially for Windows. Some of the commercial tools are very flexible in what they let you do, e.g. resizing and moving partitions.

Older references

Alternatives to multibooting