# Dual-booting with Windows

This chapter provides instructions and tips on installing Ubuntu and Windows on the same system.

## Introduction

It is possible to have more than one operating system installed on a computer at once. While only one operating system can be run at once, you may choose which one to start when the computer is initially turned on. This is called dual-booting

This quick guide is intended to help you to install Ubuntu onto a computer alongside a copy of Windows.

### Advantages of dual-booting

- You can evaluate Ubuntu while still having access to Windows

- You can boot into Windows if you need to use a Windows-specific application.

- You can gradually switch to Ubuntu, one step at a time

### Disadvantages of dual-booting

- As two operating systems are installed, they can take up a large amount of hard disk space.

- Upgrading to another version of Windows can cause the dual-boot configuration to break

- Start-up time is slightly increased

- More complicated than just running one operating system

## Basic concepts

In order to understand the basics of dual-booting, it is necessary to be aware of a small number of related concepts.

### Summary

- Hard disks can be split up into partitions

- Each partition is treated as if it was a separate hard disk drive

- Operating systems must be installed on separate partitions

- The boot loader decides which operating system to start

### Hard disk partitions

Your hard disk can be split up into many separate partitions, in a similar way that a large room can be partitioned by dividing walls. Each partition, while still being on the same physical device, is treated as being entirely separate to other partitions - it is as if you have multiple hard drives installed rather than just one. In Windows, each partition has its own drive letter. You might have a C, D and E drive which, while being treated as separate devices, are in fact all stored on the same hard disk.

For operating systems to be able to co-exist on the same computer, they should be installed onto separate partitions. This means that to dual-boot between Ubuntu and Windows, you must partition your hard disk in a suitable manner.

By partitioning your disk, you are splitting the storage capacity of your hard disk into separate, differently-sized chunks. You should choose the sizes of each partition carefully to prevent running out of storage space on a partition.

Because each partition is treated as a separate device, each partition must be formatted with a filesystem. Formatting is the process of creating a filesystem on a partition. A filesystem is a method which an operating system uses to store your files - there are many different filesystems, each with its own advantages and limitations. Common filesystems used in a dual boot system include NTFS, FAT32, and ext3. NTFS is the default filesystem used by Windows. ext3 is a native Linux filesystem that can be accessed from Windows using various tools such as ext2fs. FAT32 (also know as vfat) is a filesystem to which Linux can write safely. Hence, in a dual system, a FAT32 filesystem is commonly used as a way of sharing files between Linux and Windows.

There are two different types of partition. Primary partitions can contain only one filesystem and a maximum of four of them can be used on a hard disk. Extended partitions can contain many other partitions, but only one can be used per hard disk.

### The boot-loader

When your computer initially starts up, it quickly checks itself for problems and then passes control over to a program called a boot loader. The boot loader stores a list of operating systems and partitions stored on the computer, and decides which operating system to start up. Once it makes a choice, the operating system it selected is then in control of the computer.

When setting-up a dual-boot system, the boot loader must be made aware of the changes which are being made. Ubuntu will install a boot loader for you, which allows you to choose which operating system to start each time the computer boots up. This boot loader is called GRUB.

## Planning your dual-boot configuration

When setting up a dual-boot system, you must make some important changes to the way your computer operates. While these changes are routine, there is the possibility that they could go wrong. By planning your dual-boot setup you can reduce the risk of error.

### Finding out about your current hard disk drive setup

In order to decide how to partition your hard disk ready for dual-booting, you will need to know how it is currently partitioned.

You need to find out the total storage capacity of your hard disk drive and the layout of the current partitions. This can be done from within Windows XP by using the Disk Management Snap-In.

1. Press Start Run. The Run dialog should appear.

2. Type compmgmt.msc into the box provided and press Run.

3. Click Disk Management to show the status of all of the storage devices connected to your computer.

4. Find the device with the C: drive on it. This should be your primary hard disk (if you have more than one installed).

5. Note down the total capacity of the hard disk and the order and size of the partitions on the disk (if there is more than one).

### Deciding what partitions to use

Windows generally uses one or two partitions, though these are likely to take up the entire hard disk. You must decide how much disk space you will need for Windows, and how much you would like use in Ubuntu.

Recovery partitions

Many computer manufacturers install recovery partitions onto their computers to allow you to restore Windows in case of problems. These tend to be small partitions which are inaccessible from Windows. Because these partitions may be the sole method of recovering Windows in case of a problem, it is recommended that you do not attempt to change or remove such recovery partitions.

## Setting up a dual-boot configuration

This section provides the procedure required to set up a dual-boot system with Ubuntu and Windows.

1. From within Windows, run the Windows defragmentation tool. This can be accessed in XP by going to Start Run, typing defrag in the box provided and then pressing OK, or by going to Start Programs Accessories Deframentation Tool Defragment now in Vista.

2. Defragmentation may take several hours. Once it has finished, insert your Ubuntu Desktop CD into your disc drive and reboot your PC.

3. Follow the instructions given in the section until the installer shows the screen titled Prepare disk space.

4. Choose Manually edit partition table. The disk partitioning tool will start, showing a list of the partitions currently set up on the computer.

5. Select the partition which contains Windows. You may be able to identify it from its size or label. Once you are sure that you have identified the correct partition, press Enter.

6. On the screen which appears, select Size: and press Enter.

7. On the message which is shown, press Yes and then press Enter.

8. Type in a new size in Gigabytes (GB) for your partition. It is recommended that you reduce the size of the partition by at least 10 GB in order to provide enough space for Ubuntu on the hard disk.

9. Press Enter to apply the changes. This may take some time to complete.

10. In the free space which has now been made, create a swap partition of around 500 MB. See for more information on this.

11. Also, create a partition for your Ubuntu installation, of at least 10 GB.

12. Select Finish partitioning and write changes to disk to permanently apply your changes. This operation may take a while, and cannot be reversed.

13. Finish installing Ubuntu according to the instructions on-screen or the section.

14. Upon rebooting your computer after installation, you will be presented with a list of operating systems to boot. Ubuntu should have automatically detected your Windows installation and added an option to boot it on this screen. You can select it using the arrow keys on the keyboard, and can start it by pressing Enter.

## Customizing your dual-boot setup

This section briefly explains how to make basic changes to the settings of your dual-boot setup.

For directions on more advanced configuration options, see the Community Documentation page for Grub2.

### Changing the boot menu timeout

It is possible to change the length of time for which the boot menu is shown. This is useful if you would like the computer to start up faster (without the delay of showing the menu) or would like more time to choose which operating system to start. The instructions for changing the boot menu timeout are given below:

1. Install startupmanager if you have not already done so.

2. Press &startupmanager;.

3. Enter your administrative password if prompted.

4. In the Boot options tab, find the Timeout section. Change the "Timeout in seconds" value to the desired length of time. Use 0 to disable showing the menu.

5. Press Close.

### Changing the default operating system to boot

You can decide which operating system will be started automatically if you have not chosen one from the boot menu within a certain time (see for more information on this).

1. Install startupmanager if you have not already done so.

2. Press &startupmanager;.

3. Enter your administrative password if prompted.

4. In the Boot options tab, find the Default operating system section. From the dropdown box, choose the operating system you would like to use as the default.

5. Press Close.