Smart Computing ® Smart Computing ®
Top Subscribe Today | Contact Us | Register Now   
middle
Home | Tech Support | Q&A Board | Article Search | Subscribe & Shop   


How To Install A Multiboot System Email This
Print This
View My Personal Library

Web Only
October 2004 • Vol.15 Issue 10
Add To My Personal Library


How To Install A Multiboot System



Figure 1: GRUB boot menu offers choices of booting Windows or Linux.
Want to run Windows XP and Red Hat Linux on the same system? Read on to see how easy it can be to dual-boot your PC. What about running SUSE Linux, too, on the same PC? Well, hitting the multiboot trifecta with three (or even more) operating systems may not be rocket science, but it is more work than dualbooting.

The process of setting up dual/multibooting systems, in 25 words or fewer, is simple:

Organize your hard drive into partitions, install an OS on each, and use a boot loader to choose which partition your PC boots from.

The devil, as always, is in the details. Before you start, you should:

  • be comfortable installing an OS
  • understand how your PC boots
  • know about drive partitioning
  • know what a boot loader is
  • know how to configure your boot loader

You can find out more about installing SUSE Linux by reading our "How To Install Linux" article. If you plan on using some other distro, just be comfortable with it.

Whenever you go messing around with your system, you risk losing data, so back it up. If you're especially reckless, you could conceivably FUBAR (foul up beyond all recovery) a hard drive by messing around with its MBR (Master Boot Record), but if you follow directions you should be safe.

Multiple OSes means organizing your hard drive into partitions. Each of these areas behaves as a separate, logical hard drive. That means turning a 120GB hard drive into the equivalent of three 40GB hard drives, for example.

Advantages of multibooting include:

  • multiple OSes on one PC, one monitor, one keyboard/mouse
  • the ability to access your system, and data, even if one of your OSes is FUBARed
  • sharing data and application configuration among multiple OSes


Plus, it's cool to see how Windows and Linux compare in terms of performance on the exact same hardware.

Installing Your OSes

Modern OSes, such as WinXP or any desktop-oriented Linux distro published since the turn of the century, go through similar basic steps:

  • boot from the installer CD
  • select a hard drive partition on which to install
  • select optional software to install
  • configure user, hardware, and networking options
  • copy software to hard drive


The exact order of those steps may vary, but in general, if you follow the installer's instructions you'll wind up with a usable system. When you're installing more than one OS on the same PC, you'll need to make some changes, but not many.



Figure 2: Here is a sample partition table with partitions for Windows, a swap partition, and a Red Hat partition.

When installing multiple OSes, do the oldest OS first. Newer OSes are generally backward compatible with the older ones, but MS DOS 6.22 won't recognize partitions formatted with NTFS by WinXP.

When mixing Windows and Linux, Microsoft goes first; when installing two or more Linux distros, install them oldest first for backward compatibility.

One more thing: Consider using a new drive, or at least a "spare" drive on your multiboot PC; two drives on one PC can also work out.

Booting Your PC

When your PC boots, it goes through a very specific process before loading any operating system software. First comes the POST (power on self test), and then the BIOS (Basic Input/Output System) is loaded so the system can identify all of its parts and determine where its input and output are coming from and going to. This is where the system checks for things such as keyboard (input), monitor (output), disk drives (input and output), and so on.

Once the BIOS sorts things out, it looks for the MBR on the first bootable device. The MBR points to the OS so the BIOS can load it.

Here's the beautiful part: If your MBR points to a boot loader—a program that allows you to intervene in the booting process and choose from two or more different booting options—you can run more than one OS from the same hardware.

The most widely used boot loader in the Linux world is GRUB (Grand Unified Bootloader; see www.gnu.org/software/grub). Most Linux distros include GRUB, and if the installer detects an existing Windows installation, most allow you to configure GRUB to boot both Windows and Linux.

GRUB works because you can install each OS to a separate part of your hard drive. When the PC boots, it starts GRUB instead of starting an OS, effectively interrupting the boot process. GRUB lists available OSes and restarts the boot process by loading whichever OS you pick.

Drive Partitioning

For each OS, GRUB points to a drive partition that is treated as the logical device from which to boot. Drives can be formatted for use as single entities, in which case there is only one partition. You can also split your drive up into separate units called partitions that are treated as separate, logical disks.

Partitioning helps when your OS is limited in its ability to address disk storage, as with earlier versions of Windows. If you have a 120GB hard drive, you'd have to split it into smaller chunks to avoid the FAT32 32GB limit for a storage device.

Partitions also enable you to install two or more OSes on one drive. Each OS gets its own partition, so GRUB points to one or the other as the logical device from which to boot. You can format one partition for Windows using FAT or NTFS and format other partitions using filesystem formats such as EXT3 or Reiser that have been optimized for Linux or *NIX.



Figure 3: Disk Druid is an easy-to-use GUI wizard-style program provided by Red Hat for disk partitioning.

All disks have a partition table with four entries to specify start and end cylinders of each partition; therefore, a disk may have up to four partitions. These are physical, or primary, partitions identified by physical boundaries. If you need more than four partitions on a drive, as you will if you plan to boot three or more OSes, you've got to create an extended partition, a container for additional "logical" partitions. An IDE/EIDE (Integrated Drive Electronics/Enhanced Integrated Drive Electronics) drive can have up to 63 logical partitions, while SCSI (Small Computer System Interface) drives are limited to 15.

You'll want to configure your first primary partition for use with Windows and create an extended partition for the rest of the drive. Then, you can subdivide the extended partition into several logical partitions for use with one or more Linux distros.

The different partition formats, such as NTFS, FAT, or Reiser, specify the way the OS reads and writes data from and to the partition. NTFS allows Windows to address more than 32GB in a single device, and it also is largely incompatible with other OSes. Although it is possible for some distros to read (usually) and write (less often) NTFS, FAT partitions are more compatible with Linux. For Linux, you're best off using either the Reiser or EXT3 formats.

When system RAM is filled by processes running on the system, a "swap partition" can hold system data that would otherwise be kept in RAM. Most distributions require or strongly recommend swap partitions of one to three times the system RAM. With 512MB RAM, allocate 512MB, 1GB, or 1.5GB for your swap partition. Even with multiple Linux distros, you need only one swap partition, which can be shared.

Windows identifies partitions with single letters; the first drive is C:. Linux identifies partitions more explicitly, as parts of the file system, under the directory /dev (think devices). A hard drive may be called "hda": "hd" for hard drive, and "a" identifying the first drive, "b" the second, and so on. You can access your first drive as /dev/hda under Linux. Be careful, though: Not all drives are hard drives; a SCSI drive might be called /dev/sda.

Drive partitions are identified by the drive they're on and a number: The first partition on the first drive is /dev/hda1, the second is /dev/hda2, and the last primary partition is /dev/hda4. Logical partition numbers start at 5; the first logical partition is called /dev/hda5. (See Figure 2 for a sample partition table.)

You'll want to set up the following partitions on your system:

  • Windows primary partition, using NTFS or FAT
  • extended data partition created by Windows installer partition tool
  • logical (extended) partition created by Windows using FAT
  • Linux primary swap partition
  • logical (extended) partition for each Linux OS installed

For systems booting only two OSes, extended partitions are not mandatory, but they are very useful for managing hard drive space.

Partitioning Tools

For installing a multiboot system from scratch, the only partitioning tools you'll need are included with the OS installers. WinXP has a simple text-based partition tool, while you're likely to encounter one of several tools provided with Linux installers.

Red Hat 8.0 includes fdisk, a text-only command-line interface that is recommended only for experts, and Disk Druid, a user-friendly GUI interface that is much easier to use. Use Disk Druid.

SUSE Linux 9.1 uses its own YaST (Yet another Setup Tool) partition program, another GUI tool that makes partitioning relatively easy to manage.

Configuring GRUB

GRUB configuration is straightforward: Every boot option is set up as a section in the GRUB configuration file. GRUB, installed in the directory /boot/grub/ on the bootable Linux partition, is configured with the file /boot/grub/menu.lst. (Red Hat 8.0 links the file /boot/grub/grub.conf to menu.lst.)

For a simple dual-boot system, you won't need to configure GRUB, as your Linux installer will most likely take care of it for you. You can configure GRUB several ways:

  • during a Linux installation; some distros support full GRUB configuration, as with SUSE 9.1's YaST, which lets you add boot menu sections during the installation
  • after Linux is installed, using a GUI tool such as YaST
  • manually by editing (as root) the configuration file

Now that you've been schooled in booting, partitioning, and GRUBbing, it's time to get our hands dirty and install some OSes.

Multiboot Examples

Just as you've got to crawl before you can walk and walk before you can run, you've got to install one OS before you can dual-boot and dual-boot before you multiboot. So, these two examples step through the process of installing first WinXP on a bare PC, then Red Hat 8.0, and then SUSE 9.1. Your results may vary, especially if you're using different versions of Windows or Linux, so be careful!



Figure 4: SUSE's YaST (Yet another Setup Tool) includes tools for configuring almost any aspect of your system, including partitioning (Partitioner) and the GRUB boot loader (Boot Loader Configuration).

Stick with Linux distros that use GRUB; older distros used LILO (Linux Loader), but GRUB is easier to work with and better supported.

The examples provided here were done with a home-built 256MB RAM/120GB hard drive Athlon PC.

Be warned: While dual-booting with Windows and Linux can be almost effortless, setting up a system that boots three different OSes is not for the fainthearted—but once you master that triple-threat install, you should be ready for almost anything.

Step 1: Install Windows XP

The WinXP installer lets you create new partitions or use (or delete) existing NTFS/FAT partitions. It won't recognize foreign partitions, so when you install WinXP (which you should do first) you can delete existing partitions and start from scratch. Create two: one for Windows and one for data.

Later on we discovered that doing this gave us one primary partition, hda1, formatted for use with Windows, and an extended partition, hda2. Our data partition showed up as hda5, a logical partition under hda2; we will create more logical partitions later for our Linux installs.

The WinXP installation is uneventful; just respond to prompts for user information and product key. On completion, our system restarted and booted directly into WinXP.

Step 2: Install Red Hat Linux 8.0

Next, install OS No. 2. Boot with the Red Hat installation CD, respond to prompts for language, keyboard, mouse, and installation type, and it's time to partition your drive. Use Disk Druid, leave all the existing partitions alone, and allow Red Hat to automatically create new partitions—just be sure to review any changes for fine-tuning.

Disk Druid creates a swap partition, a root partition (/) for most of your Red Hat files, and a separate partition for boot files, called /boot. These mount points are names given to the partitions that allow them to be incorporated into your filesystem. Unlike the /dev/ names, which point to the hardware, these names point to files and directories on your filesystem.

You don't have to use a separate /boot directory if you don't want to, as it can confuse matters here if it is left out. Leave the Windows partitions alone, and add only extended partitions. You can't create new primary partitions anyway, since the extended partition comprises the unallocated balance of the drive.

At this point, we have one Windows-formatted partition on hda1, a second Windows partition on hda5, an EXT3 partition on hda6, and a swap partition on hda7.

After partitioning you'll be prompted for boot loader configuration. Choose GRUB. You can boot DOS (Windows XP) or Red Hat Linux by default, but leave all the other options alone.

Once partitioning and boot loader configuration are complete, the rest of the install should go smoothly as you configure system networking, security, time, users, and choose software to install.

Follow the prompts and you'll have a system that boots two OSes: You can choose DOS (Windows XP) or Red Hat Linux on system start.

Congratulations

Before you start installing OS No. 3, print out a copy of the file /boot/grub/grub.conf (see the output in Figure 6), the file to which Red Hat 8.0 writes the GRUB configuration. (Check the /boot/grub/ directory for other distros.) You'll need superuser access rights to view that directory; open a terminal window, enter the su command followed by the root password, and you should have root level access.



Figure 5: The SUSE YaST partition tool at work.

Look at the GRUB configuration file generated by Red Hat 8.0; all the lines starting with "#" are comments. This configuration lists two boot sections, each identified by the "title" lines: Red Hat Linux and DOS (Windows XP, actually). Anything that appears after "title" is displayed in your menu, and you can change as you prefer.

Within each section are GRUB commands; "root" specifies which hard drive and partition are to be used as the root file system for the OS. (hd0,5) specifies the first ("0") hard drive and the sixth ("5") partition. In other words, hda6.

The "kernel" command specifies the file to be loaded as the OS kernel, and the "initrd" command initializes a ram disk at boot. This stuff is automatically generated by the Red Hat installer, so make a note of it for later when you have your third OS installed.

Step 3: Install SUSE Linux 9.1

Dual-boot is easy because commercial Linux distros are designed to facilitate Windows/Linux coexistence. More than two OSes gets sticky because those Linux distros also assume that you'll want Windows plus only one flavor of Linux, not several.

Never fear. You just need to create a new partition to install your third OS and leave existing partitions alone. Our SUSE partition is hda8. It's OK to format the swap partition. (You'll be prompted to.) Otherwise, complete the SUSE installation, making sure no existing partitions are changed, and create a new, logical partition to install SUSE.

The tricky part is that the SUSE installer doesn't know that GRUB was already installed by Red Hat, so it's not listed as a boot option in the SUSE installer.

This is where you can re-create the Red Hat boot option in GRUB, or you can wait until installation and reconfigure GRUB with YaST—or even manually reconfigure GRUB by adding the appropriate lines to the GRUB configuration file. No matter what, you must add a section for Red Hat to the GRUB config file.

Click Booting in the SUSE installation settings panel. Highlight Available Sections and click Edit. You'll see four sections: Linux (for the current SUSE install), Windows, Failsafe, and Memory Test. The last two are useful for when you need to do system management or recover data after a system failure, but you need to add your Red Hat section. Click Add.

Step 4: Configure GRUB To Triple-Boot

GRUB is an incredibly powerful tool, with which you can do incredible things beyond simply displaying three or four different OS choices at boot time, or even modifying the colors of that menu (almost all of which is beyond the scope of this article). All we want to know is how to get Red Hat, SUSE, and WinXP all to boot on one PC.

Choose Available Sections in the YaST boot loader setup tool and then click Add to add a new section for Red Hat. You'll have to fill in the blanks for the GRUB commands root (the root file system for the OS), kernel (the kernel image file) and initrd (initializing the kernel with a RAM disk).

Then, you can go ahead and clean up the GRUB configuration, changing section names (for example, "Windows" for "DOS," "SUSE Linux" for "Linux") and moving the Red Hat option higher in the menu list.

Or, you can edit the GRUB configuration file yourself, by starting a terminal session, running "su" and opening the /boot/grub/menu.lst with your favorite text editor.

See Figure 7 for our triple-boot GRUB configuration file.

Congratulations! You should now be able to boot any of three OSes: WinXP, Red Hat Linux 8.0, or SUSE Linux 9.1. If you have a problem, you're likely to get a kernel panic error message on boot, in which case you should try to decipher that error (they're usually pretty clear, pointing to problems mounting a partition, for example, or trying to load the wrong kernel). Problems with your menu.lst file are relatively easy to fix; problems with mounting partitions may mean going back and starting from scratch with at least one of your OSes.

What Next?

At this point, you should be able to access data in any of your partitions under Linux/*NIX OSes using standard file system tools, as well as read and write data to your current OS partition. You can try adding another OS to your GRUB boot menu, or if you're in a hurry, just get a bootable CD distro (see sidebar) and boot a fourth OS from your CD drive.

Just remember, while dual-booting should be a breeze, getting to three (or more) may require more confidence as well as more skill. If you run into a problem, don't give up—start over, do a Web search, or ask someone for help. Chances are someone else has already solved the exact same problem as you.

Good luck—and don't forget to back up.

By Pete Loshin




Figure 6


# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,5)
# kernel /boot/vmlinuz-version ro root=/dev/hda6
# initrd /boot/initrd-version.img
#boot=/dev/hda


default=0
timeout=10
splashimage=(hd0,5)/boot/grub/splash.xpm.gz


title Red Hat Linux (2.4.18-14)
root (hd0,5)
kernel /boot/vmlinuz-2.4.18-14 ro root=LABEL=/
initrd /boot/initrd-2.4.18-14.img


title DOS
rootnoverify (hd0,0)
chainloader +1


Dual-boot GRUB configuration file.




Booting Outside the Hard Disk


Are you stuck with Windows and afraid to mess up your PC with Linux? Fear no longer: Just get a live-CD distro and run Linux on any PC that boots from CD without making any changes to your hard drive.

Commercial Linux vendors such as SUSE (www.suse.com) and Linspire (www.linspire.com) offer freely downloadable live-CDs so users can test their distros on their own hardware and make sure everything works before they actually commit to installation.

Other bootable-CD distros are designed as rescue toolkits for PCs that may have been damaged by accident or by purposeful attack, such as INSERT (www.inside-security.de/insert_en.html), Plan-B (www.projectplanb.org) or SystemRescueCd (www.sysresccd.org). These distros typically include enough software to secure and fix damaged PCs, including programs for recovering data, scanning for viruses, and partitioning hard drives.




Figure 7




# Modified by YaST2. Last modification on Wed Oct 6 18:43:32 2004


color white/blue black/light-gray
default 0
timeout 8
gfxmenu (hd0,7)/boot/message


###Don't change this comment - YaST2 identifier: Original name: linux###
title SUSE Linux
kernel (hd0,7)/boot/vmlinuz root=/dev/hda7 vga=0x31a splash=silent desktop resume=/dev/hda6 showopts
initrd (hd0,7)/boot/initrd


title Red Hat Linux (2.4.18-14)
kernel (hd0,5)/boot/vmlinuz-2.4.18-14
initrd (hd0,5)/boot/initrd-2.4.18-14.img


###Don't change this comment - YaST2 identifier: Original name: windows###
title Windows XP
rootnoverify (hd0,0)
chainloader +1


###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe
kernel (hd0,7)/boot/vmlinuz root=/dev/hda7 showopts ide=nodma apm=off acpi=off vga=normal noresume nosmp noapic maxcpus=0 3
initrd (hd0,7)/boot/initrd


Triple-boot GRUB configuration file.




Software Multibooting


Whether you call it CPU emulation, virtualization, or something else, sometimes using software to emulate multiple OSes on a single PC is a good idea. Multibooting as described in the main article allows you to select almost any OS and run it on your PC at boot time. But once you get Windows (or Linux or BSD or MS-DOS) up and running, you can't just switch over to Linux (or Windows or BSD or, well, you get it). You have to reboot your system and choose that other OS.

VMware's VMware Workstation 4 (www.vmware.com) emulates PCs in software, meaning that you can run virtual computers on your desktop. You configure your virtual PC by assigning it disk space and then install any OS you want. The virtual PC runs as a task of your host OS, so you can have a virtual Windows XP system running in a window on your Linux desktop—or vice versa.

Virtualizing benefits users who need to test out different OSes before committing to any changes, a particular boon for testing service pack updates or software compatibility under different versions of Windows. VMware also offers users the ability to hotkey between different OSes.







Want more information about a topic you found of interest while reading this article? Type a word or phrase that identifies the topic and click "Search" to find relevant articles from within our editorial database.

Enter A Subject (key words or a phrase):
ALL Words (‘digital’ AND ‘photography’)
ANY Words (‘digital’ OR ‘photography’)
Exact Match ('digital photography'- all words MUST appear together)





Home     Copyright & Legal Information     Privacy Policy     Site Map     Contact Us

Copyright © 2010 Sandhills Publishing Company U.S.A. All rights reserved.