Tuesday, October 30, 2007

DualBoot Windows XP and Ubuntu 7.04: Manual Partition

There have been a lot of how-to's written about the process of installing ubuntu onto a hard drive 'next to' XP, thus creating what is called a dual boot system. This one documents how I did it, with an emphasis on the process of partitioning, which is a beginner level thing but very important. Linux, and GParted in particular, allows a very advanced ability to partition and repartition your hard drive without destroying data. That being said, you should always back up before doing any kind of partitioning. I use acronis home, but there is a freeware program called <> which I am going to try soon. I also suggest using Mbrfix prior to making any changes in case there is some damage to the master boot record. Mbrfix will come in handy for the second part of this blog as well, wherein I will describe the process of returning the computer to a Windows boot and using a boot floppy to boot Ubuntu. This latter part is fairly unique, I think, and I had to play with the process to get it right because I could not find adequate documentation.

Having backed up your C: drive, it is time to create the partitions necessary for an Ubuntu Linux install. This blog assumes you have been playing with Ubuntu in a virtual machine. I highly suggest getting familiar with it, or another Linux distro, in this manner before making the leap to having it as your 'main' operating system. The advantages to doing this are well documented; I just like trying different things. From the boot up from the Ubuntu Live CD we will be using the Gnome Partition Editor to make the changes, located at System>Administration>GNOME Partition Editor (click on picture for full size image)

NOTE: BEFORE CONTINUING BACKUP YOUR WINDOWS OS AND ANY IMPORTANT DATA. I highly recommend familiarizing yourself and using BartPE, along with the MBRFix and DriveImage XML plugins (MBRFix is not exactly a plugin, rather it is a command line utility that must be run from a Windows environment, ie the BartPE disk). You should do this whether you are dual booting or not. Keeping your system backed up is always a top priority.

Now it is time to partition! You should be looking at something simliar to this:

In the top right corner is a pull down menu that will show all your hard drives, if you have more than one. You can choose by size, or by the fact that your Windows OS will always be on 'a'. In this case, the OS is on /dev/sda - and more specifically in the first partition /dev/sda1. You can see that the second partition is unallocated. I am going to shrink the Windows partition (sda1) and then add it to this one (sda2).

To shrink the existing partition: Highlight /dev/sda1 (or /dev/hda1 on some drives) then choose Resize/Move.

In the middle box enter the new size of the partition in MB, ie I took mine from 29GB, or 29000MB, to 24GB, or 24000 MB. Then click tab and Gparted fills in the next space for you. Click Resize, and then Apply. This operation could take awhile depending on the change in size and your processor speed.

Now, highlight to unallocated partition and Click New. Choose Extended because we are going to partition this little part up for a couple of new Linux OS's and some swap space, which Linux uses if you get low on RAM. Now click on the unallocated area again and choose New. Leave the first number as it is, type 1000 in the middle and then tab to let Ubuntu fill in the rest. Under File System choose linux swap. This sets aside 1GB of swap space for any linux distro that you run.

In the unallocated space left do the same as above, except choose enough space for the Ubuntu install and choose ext 3 for the file system; I chose 20000 (20 GB), and then leave about 10GB unallocated for another project later. You can do all this and then press apply, but I like to have the program do each step because there seem to be less errors that way, so I hit apply each time I make a change.

Now you are ready to install, as long as you have at least backed up your MBR using MBRfix, that is. The install of Ubuntu is going to insert a new "Bootloader" into your MBR, so be aware that upon startup things are going to look differently. This bootloader, called GRUB, will take care of things for you, providing you with a list of available operating systems to choose from: namely Ubuntu and Windows. So, with all that in mind, double click install and start the process. When you get to Prepare Disk Space, choose manual.

Click on the box next to the partition you set aside for Ubuntu, ext 3, and under mount point, choose the back slash.

Skip the "Migrate Docs and Settings", and choose a name and password you will remember. Finally, make sure the numbers correspond to the ones you want to install to (NONE OF THEM SHOULD BE 1; ie, you should not be installing to sda1 or hda1 because this is where your Windows OS is!!!!!)

Now you are ready to go! Install and restart. You will notice the new Boot menu, which gives you a choice of the Ubuntu OS or the Windows one. You can stop here, adding the programs I suggested in a previous blog, or go on to Part 2, where I will describe how to go back to the Windows way of booting up and then boot Ubuntu from a floppy disk.


No comments: