Problem solve Get help with specific problems with your technologies, process and projects.

Linux dual booting and booting options

How to make Linux and Microsoft co-exist on the same machine.

Your company has been running Windows for a decade, but now your CEO and CIO want to check out Linux. Actually, they want your IT team to evaluate Linux. Trouble is, no one on the team has ventured outside of the MS world. So, where do you get started? Well, dual booting can help you make the first baby steps into Linux land.

Rather than buy new hardware, you probably want to start testing products on Windows PCs in your IT shop. With dual booting, you can make Linux and Microsoft co-exist on the same machine and do it quite well. When turning on your computer, you can choose to boot either Windows or Linux.

In short, the process is easy. The first step is to re-partition the PC. Then, you need to install Linux. Finally, you'll need to install and configure your boot loader.

Let's look at these steps in greater depth. First of all, look into using the recommended dual-boot for your particular variant of Linux. On an IBM ThinkPad I had around four years ago, the Mandrake version I used came with Partition Magic, which helped me build the Linux partition. If a program like this didn't come with your variant, then go with whatever your Linux distribution recommends.

Don't get started before you understand the concept of a boot loader. Without the boot loader, you will not be able to accomplish what you would like to do. Basically, the boot loader is a program that resides in the Master Boot Record of the hard drive. When you first boot your computer, the BIOS transfers control to the Master Boot Record, and the program is launched from here. This program transfers the control to the operating system, which eventually boots you up.

Boot programs include GRUB, LILO (Linux Loader) and the Windows NT boot loader. I've found LILO to be a bit simpler to use than GRUB, but GRUB is respected in most circles for its great flexibility. I have used both successfully. If GRUB is on your Linux partition, that's great. If not, you'll have to download and compile it. You shouldn't have much trouble finding a version doing a Google search on the Internet.

The files that are used for GRUB are in /boot/grub. There is one big difference between GRUB and LILO: With LILO, every time you rebuild your kernel, you will need to reinstall the boot loader (run sbin/lilo). So, there can be less of a maintenance issue with GRUB. Also you'll need to execute lilo again after any changes are made in /etc/lilo.conf.

As a side note, I should say that you don't need any kind of loader installed if you just want to use a floppy to boot into Linux every time. I don't know why anyone would want to do this. I would choose to install both LILO and a boot floppy, as you never know when you will need to boot with a floppy. When installing Red Hat Linux, you can choose the option to install LILO and create a boot disk. Do it!

If you want a more painless environment, I personally would use LILO, as it is easier all around. Naturally, Windows should be the first installed OS, then Linux.

If you have a separate hard drive, use a different drive when installing Linux. If you don't have a separate hard drive, you can do the partitioning on one drive. I don't have to tell you to back up everything important before doing anything, do I?

The Linux partition must be the first partition after the Windows partition. When installing LILO, install it to the /boot partition, which is the second partition on the disk. If you install it on the Master Boot Record, you will overwrite the Windows loader, and you may have to re-install Windows.

Remember to use a disk-partitioning tool when configuring your disk. Partition Magic is very good, as is FIPS, a free tool included on some Linux distributions.

On the Linux side, there is a configuration file, aptly named lilo.conf, residing in /etc. This is the file you will need to configure for LILO. It contains the links to the operating system and messages file that come up on boot. An example of a message file is something like this:

Server Boot Menu

  1. Windows
  2. Linux

As stated previously, the main configuration file is /etc/lilo.conf. If you are using separate hard-drives, it is important that you specify these separate hard drives in this file, (I.E hda1 and hda2) as separate boot directories with separate hard drives.

Here is an example of a lilo.conf file:

     boot= /dev/had
     map= /boot/map
     install= /boot/boot.b
     vga= normal
     default = linux
     timeout   = 50
     message   = /boot/message

       image  = /boot/vmlinuz
       label  = linux

       root   = /dev/hda4

       other  = /dev/hda1
       label  = dos

Using this configuration, Linux will boot up first. Don't have it any other way! After all, Linux is probably coming to your shop to stay!

There are other ways of doing an install if you already have a Linux partition but still want to install a Windows partition. Frankly, I don't know a lot of people who really do this type of deal anymore. Most people I know who have a working version of Linux on their machines want nothing to do with Windows.

Good luck!

Dig Deeper on Linux servers

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.