A Simplified Guide to Multibooting for the Beginner

ClareOldie

The following is based on using one PATA (IDE) Hard Disk Drive (HDD) connected as Primary Master in a computer and adding a few installations of Linux to it. The complications presented by distros that refuse to install the Boot Loader to the Boot Sector of the partition are avoided simply by saying do not use these distros until you are more familiar with multi-booting.

Furthermore I make the assumption that you can arrange free space on the HDD and create partitions of a suitable size for the installations. In this regard the assumption is that you create an Extended Partition to hold as many Logical Partitions as you wish to make.

What follows is just one person's opinion and is not the only, or necessarily the best method to achieve success.

Let us say that you have divided the free space on your HDD into a number of partitions of 10 GB each and have formatted them in ext3 file system. First install PCLinuxOS to the first spare partition - hda5. Write the Boot Loader (GRUB) to the Master Boot Record (MBR) of the HDD. If you have Windows previously installed, Grub should recognise that installation and make it bootable also. For this exercise, please use the GRUB bootloader at install time, not Lilo.

Having installed PCLinuxOS and re-booted you should now be presented with several boot options. One of these will be Windows, if installed, and the others, various boot options for PCLinuxOS. Boot, in turn, into Windows and PCLinuxOS to ensure that everything is fully operational. Boot into PCLinuxOS and from the PCLinuxOS Control Center > Boot > Configure the PCLinuxOS Boot Loader, install the boot loader (Grub) to the boot sector of the PCLinuxOS install (hda5). This is useful in case of difficulties later but hopefully won't be needed. Take a note at this time of the partition number that PCLinuxOS is installed on. It will be useful later but if following this scheme will be hda5.

Choose your next distro for install. Install it to the next partition and (very important) have it write its boot loader to the bootsector of that partition only, not to the MBR. If you cannot do this then abort the install. Later, when you are more familiar with things it will be possible to install this type of distro. Having installed the new OS (let's call it distro R) you will not be able to immediately boot into it. Do the same for each of the distros you wish to install lets say three in all R, S, & T. This would give you five operating systems including PCLinuxOS and Windows if installed, but for the present you can only boot into PCLinuxOS or Windows. Take a note of the partition details for each install.

Now a small bit of explanation about how Grub manages multiple boot options. The information is stored for Grub in a file called menu.lst which is a text file and can be edited with just about any text editor. Grub has the capability to boot the installed OS directly but this requires quite a bit of information about the kernel and such, to be known by you, if you wish to have Grub do it this way. For this exercise that information is not required because it is contained in the boot loaders that we have installed on the boot sectors of the installations. What is required therefore is for Grub to hand over the booting to the boot loader of the OS that you select at boot time. Grub does this using a command called chainloading. So, all Grub requires is the location of the other boot loader that is to handle the booting and the command to tell it to hand over.

As many will know, Windows names partitions with letters such as C, D, E, etc. Linux uses names such as hda, hdb etc for the physical HDDs and adds a number to this name which identifies specific partitions on a particular HDD. So we get names for partitions such as hda1, hda2... hda7, hda8 etc. Grub has a naming system which is slightly different. The first HDD is (hd0), the second (hd1) etc. As you can see, Grub starts its numbering from zero, a bit confusing at first. When Grub wishes to reference a particular partition on a HDD it does so like this - (hd0,0) for the first partition on the first HDD, (hd0,1) for the second partition and so on. It should now be clear why it was important to keep a record of what partitions you installed the various distros to.

So for Grub to call the boot loader for a particular partition you must edit the menu.lst file and put in lines that it will understand in other words, references to the partitions in the format that Grub uses. If you have partitioned the HDD in the manner assumed at the beginning, then the first available partition is probably hda6, PCLinuxOS having used hda5, which is the first of the logical partitions. The Linux partition hda6 is the same partition as (hd0,5) in Grub terms. Remember Grub starts at zero not one. So to boot the OS installed on hda6 we tell Grub to call the boot loader on the boot sector of that partition. The instruction would look something like this:

title     "R" on hda6
rootnoverify (hd0,5)
makeactive
chainloader +1
boot

What follows title will be displayed on the screen at boot time.

rootnoverify (hd0,5) tells grub the partition you wish to boot in this case hda6.

makeactive does what it says it makes the booting partition the active one.

chainloader +1 hands the booting control over to the boot loader on the specified partition.

boot tells it to boot.

As you can see from the above, each partition can be booted simply by entering the above lines as many times as there are partitions to boot. In this case, once each for distros 'R', 'S', and 'T'. Just change the "title" to the name of the particular OS and also change the partition number to the one that is to be booted for each entry. It does not matter to Grub what boot loader is on the boot sector of the partition, whether Lilo or Grub, as it hands control over in any case.

Now we know what we need to do to get access to the distros we installed, and are, I'm sure, impatient to test them. The last stage is to edit the menu.lst file so that it contains all the entries necessary to allow us to boot them. To do this, boot into PCLinuxOS and go to Kmenu > Applications > File Tools > File Manager-Super User Mode. This will require your root password, which hopefully you have changed from the default root for security reasons. Navigate to the /boot/grub/ directory and open the file menu.lst for editing in an editor such as Kwrite. Now, with reference to your notes (you did make them didn't you?) you put in the entries discussed above for each new OS. When you have finished and checked that you have made the allowance for the Grub naming system and changed the title, save the file. Do not make any changes to the existing entries, rather only add to them, leaving a blank line between each entry. This should ensure that PCLinuxOS and Windows (if installed) are both still bootable even if errors have been made in the new entries. All that is left to do is re-boot and you should be presented with a list of choices to boot, including all the new entries you have made. Boot each one in turn and make sure that you have the proper title given to each. If you have changes to make, boot into PCLinuxOS and follow the same procedure as before for editing the menu.lst file.

You now have a multi-boot system. Congratulations!

Remember, as with all things Linux, there are many ways of doing things and the method above is only my opinion of what would be easiest for the first time multi-booter.

Further reading (this is a must):
http://www.pclinuxonline.com/wiki/BootloaderFAQ

For information and further testing I have listed a few other boot entries to try out when you are more comfortable with the process.

# Call Boot Loader on HDA2

title Lilo on HDA2 (hd0,1)
rootnoverify (hd0,1)
makeactive
chainloader +1
boot

# Alternate call Lilo on HDA2

title Lilo on HDA2 (hd0,1) root (hd0,1) chainloader +1

# This calls the boot loader on the MBR of the HDD, not a partition

title Grub on hdb (hd1)
rootnoverify (hd1)
chainloader +1
title Windows on the 2nd Disk, 2nd Partition (hdb2)
rootnoverify (hd1,1)
makeactive
chainloader +1
boot

As with all such things, you make changes to your computer entirely at your own risk.

Top