Modify Colors

Default Reverse Brown Dark Blue

Archive

Advertisement

January 6, 2008 | Tutorials
[tagged: ]

Dual-booting Tutorial

Setting up a dual- or multi- boot Linux system

Making your computer boot a number of operating systems can be a very simple or complex issue. If you just want to set up a dual boot with Ubuntu and Windows there are lots of guides to help you do that, and often you don’t even need to change any
settings. This guide is not about that, although there is no reason one of the partitions could not be Windows. Another thing you should know before using this guide, is that you can set up a virtual machine, where an operating system can run in
a window on your computer, and that is both a lot easier and safer.

OK, so if you still want to set up a dual or multi boot system, there is one more thing you should know. This guide will not give step by step instructions, but will rather explain what you need to do in general. For example, instead of saying something like “Select the grey box representing free space in the top of the window, and press new…” this tutorial will just say “You need to create a new partition and format it ext3.” If you think you need a more step by step tutorial, I recommend you ask for help on a forum, like LinuxQuestions.org. And one last thing, this tutorial will assume you are using an empty hard drive. I don’t recommend you do this for the first time on a hard drive you can’t just reformat and start over. I messed up more then once, and I still don’t even know what went wrong. Luckily, it was a blank hard drive, so I just started over.

Part 1: Format the Drive

Before you install anything, it is easiest to set up the partitions (pieces of your hard drive) in advance. To start out download and burn a live CD that allows you to partition your drive. I recommend the GParted live CD. This CD does partitioning, and just about nothing else, that’s what makes it great. When you have booted it up these are the partitions you need to make:

Filesystem Primary/Extended/Logical Size Use Notes
swap primary Approx. twice your RAM or 1.5GB to 2GB on a modern
computer
Sort of like extra RAM. Generally a good idea on Linux
systems.
None.
ext3 primary Depends on what distro you want to install. For testing
purposes I recommend 10-12GB for CD distributions and 15GB+ for DVD
distributions.
One of the distributions goes here. None.
ext3 primary Depends on what distro you want to install. For testing
purposes I recommend 10-12GB for CD distributions and 15GB+ for DVD
distributions.
One of the distributions goes here. If you only ever need three distributions, make another of
this type and then you are done.
N/A extended All avaliable space Other partitions can go inside of this, but you can only have
4 primary/extended partition. Don’t ask me why. Go try and Google it or
something if you must know.
All following partitions go inside this
partition.
ext3 logical Depends on what distro you want to install. For testing
purposes I recommend 10-12GB for CD distributions and 15GB+ for DVD
distributions.
One of the distributions goes here. Goes inside the extended partition.

Make as many of these as you need.

You may want to make a logical fat32 (or ext3 if you only plan to have Linux on the computer you are working on) for data storage between operating systems.

Now, after you write the partitions to the disk (YOU WILL LOSE ALL YOUR DATA), you should see names such as /dev/sda1. (These names will vary from system to system depending on your hard drive.) Write these names down along with what partition they correspond to. At the very minimum you need to know the name of the partitions you want to put Linux on.

Also, if you mess up and want to restart, just put the CD back in the drive and delete all the partitions and make them again.

I hope that was clear, if not please contact me. (Link at the bottom of the page to a form or email me at webmaster@linuxloop.com.)

Part 2: Installing the main OS

To start out you need to install one “main” operating system. This is the only operating system you will allow to write the “Master Boot Record” (called the MBR from now on.) The MBR is a portion of your hard drive where your computer looks for a
“boot loader” to tell it where to go to boot an operating system. In this tutorial we will use GRUB. GRUB is a boot loader that comes with most Linux distributions by default.

I normally use Ubuntu, but any Linux that can install a GRUB boot loader (almost all of them) will work. The only thing you need to do differently is that you need to choose “Manual” (or “Custom” or something) when you get to the partitioning options.
Then you need to choose to install to the first of the ext3 partitions and choose mount point “/”. You can let it format it if you want. Choose ext3 or, if that is not an option ext2 (or whatever the distro prefers, it will not matter a lot).

Part 3: Installing other OSs

This is going to be the same as installing the main OS, except for two things. The first is that you don’t want to use the same partition, so just pick the next of the ext3 partitions each time, but still use the manual mode and stuff. The second difference is that you don’t want it to write GRUB to the MBR. This varies from distribution to distribution and on a few distributions, you can’t do it at all. Basically, make sure that at some point in the install process you will get a chance
to do one of the following:

  • Best Choice: Install GRUB to the same partition that you installed the OS to. This will be phrased different ways, but if you have an option to write GRUB to the same partition you put the OS on, that is the best choice.
  • Last Resort Choice: Don’t install any boot loader anywhere.

The only better thing then installing GRUB to the same partition, is installing it to the same partition AND adding the OS to the existing GRUB automatically.

OK, so you got something installed, now what to do next:

If you were able to install GRUB to the same partition as the OS:

Go back into your main OS, and open a terminal window. As root (or in Ubuntu just add sudo to the beginning) type gedit /boot/grub/menu.lst. If you use KDE you will need to use kedit or another text editor instead. Now, go to the bottom of the file
and add (on a new line):

title the name of the new OS

root (hd0,partition number)

chainloader +1

The name of the OS can be anything, but I recommend just using, for example, “Ubuntu 7.04.”

To get the correct partition number find the names of the partitions, that you wrote down. Take the number at the end of the name and subtract one. That should be it. For example, if the name of the partition was /dev/sda5, I would write “root
(hd0,4)”.

If you did not install a boot loader at all:

Go back into your main OS, and open a terminal window. As root (or in Ubuntu just add sudo to the beginning) type gedit /boot/grub/menu.lst. If you use KDE you will need to use kedit or another text editor instead. At the end of this file you need to
add some lines of text. In this case your best bet is to get someone who has the distro (both version and distro matter) installed normally to tell you what his/her entry(s) say.

I hope this works for you. If you need addition help, please contact me (webmaster@linuxloop.com) or look for a forum.

Related posts:

  1. Tricks for Installing and Configuring a Local LAMP Sever LAMP stands for Linux, Apache, MySQL, and PHP, which represents...

No comments on this post so far.

Be the first to leave a comment!

Leave a Comment