This is a tutorial on how to create a dual boot with a flavor of Linux and Windows XP(using the NTFS file system) using the GRUB boot loader.
While some of the things discussed in this tutorial may seem obvious to the more advanced members of the AD linux community, Please remember that this tutorial is made so that even if someone has no prior experience with Linux or doing a clean install, they can still set up a dual boot with XP using the GRUB boot loader. If you think that you do not need this tutorial or do not wish to learn more on the topic, please do not continue reading. ;-) before anybody jumps in being critical of some of my methods.. this was how I did it back when I was a linux n00b too, and I wrote this not long afterwards.. some things may be dated, I was running NT back when. Please feel free to comment/add suggestions.
I wrote this tutorial because when I first attempted this I thought I knew what I was doing, and quickly found out I had no idea what I was getting myself into. I even started a thread that asked for advice on this topic. Unfortunately, there are just so many little things that people assume others know. When I finally got enough info to make a dual boot, I decided to write this tutorial to give people like myself a helping hand, by writing a how-to on dual-booting. Also, I noticed that a large amount of people that attempted this using the NTFS file system for their XP partitions experience problems that force them to convert their XP partitions to the less secure FAT32 file system. Using the GRUB boot loader solves this problem.
This tutorial is aimed at the following people:
* People looking to EASILY set up a Linux / XP system.
* People that are interested in the new GRUB boot loader and how to implement it.
* People that are just looking for something to do with their free time.=)
Preparation before the Installation:
There are a few things that we need to have before we can start. Obviously, we need a copy of both Windows XP and Linux.
The easiest way to obtain a copy of Linux is to download the bootable ISO’s from a site and burn them to a CD-R.
http://distrowatch.com/dwres.php?resource=major I recommend the use of the mirror sites over the actual companies’ site, because the companies’
FTP server tends to be really slow.
In order to burn the ISO’s into a CD, you must have a third-party CD burning program. The native burner which is built into Windows XP DOES NOT have the ability to do this. It will only copy the ISO onto the cd which does you no good (see any of the iso burning threads on afterdawn if you don't know what to do with a XXXXXXXX.iso file)
The final preparation step is to back up all your files(Don't forget your e-mails!! - I lost over a thousand e-mails and all my bookmarks because I forgot to back them up!).
Partitioning, Formatting, and Installing XP:
Once, you’ve backed up all of your files that you wish to save(don’t forget your e-mails!), you’re ready to begin. It is good practice to install Windows XP first since it does not have the level of customization that Linux does(XP has the nasty habit of taking the first partition it finds).
Pop in the XP installation CD and restart. When your Computer’s start up screen comes up, enter the BIOS setup by pressing the necessary key(s). Set it up to have your computer boot from your CD drive. When the CD boots up, you’ll be greeted with the standard Windows XP set-up screen.
The next step is to use the fdisk partitioning utility and carve your hard drive into partitions. Fdisk comes with XP. After you ok the installation for the first time it will let you delete your current hard disk and partition it. How you partition your hard disk is up to you and what your system can handle. I did the following on a 40 GB hard drive:
15GB for XP and applications (NTFS)
1GB for XP Swap/Paging File (NTFS – not necessary for XP)
16.5GB for Data and Files (FAT32)
7.5 GB for Linux (Will be formatted during the Linux install)
I decided to make the Data and Files partition FAT32, because that way both Linux and XP can read and write to it (Linux can read from NTFS, but writing to it is still “experimental” and not suggested). After you partition the hard drive you format the partition XP on using NTFS (make sure that your XP partition is the FIRST partition).
Continue with the XP setup and finish installing. Once you’re done, you can format the other partitions (not necessary for the Linux partition though) by going to Start -> Control Panel -> Administrative Tools -> Computer Management. There are tools in there that you can use to format your partitions and make them recognizable and usable in Windows.
Partitioning, Formatting, and Installing Linux:
The Linux install is only slighty more complicated, but is faster ( ~20min). Pop-in the 1st Linux CD and restart again. Your system should still be set to boot from CD, so the Linux installation screen should come up. You want to do just an install. In most linux distros (I was using redehat/fedora at the time) this brings up the installation GUI for Linux. When it asks you what kind of installation you would like to perform you want to select “custom” or “expert” (custom is the easier of the two, only use expert if you are sure that you know what you are doing!), since you’ll need to tell Linux what partition to install on.
Setup will eventually ask you what program you want to use to partition your hard drive. I chose to use Disk Druid.(others are available..these days I like cfdisk, most new distros have a partitioner all their own) It’s a pretty easy utility to use and it has a GUI (unlike fdisk which is command line). Linux will recognize your Windows partitions and show them. If Windows decided to format your Linux partition to FAT16 (mine did for some weird reason…) just delete it. Out of the free space left on your hard drive you need to make the following partitions:
50MB for Boot Partition, listed under “\boot”
2x your current amount of RAM for Linux Swap/Paging File(ex: 256MB RAM -> 512MB Paging File, and its REQUIRED for Linux), listed under “\swap”
3GB or more for the Linux OS Partition, listed under “\” which is called “root”
Once this is done, you can continue through the rest of the setup, just make sure that when you reach the point of what Boot loader you want to use, pick GRUB and make sure it installs to the MBR(Master Boot Record). This will cause Linux to boot instead of XP the next time your computer boots from the hard disk.
Once your done picking and choosing what you want installed along with the Linux OS, setup will do the rest for you. Make sure you make a user account for yourself other than “root” when prompted by the Linux setup, because when you are logged into the “root” account you can do anything and everything to the partition Linux resides on, including DELETING THE WHOLE PARTITION by accident.
Post Linux Installation:
Ok, so now we have both OSs installed. Once Linux is finished setting up you can remove the CD, and restart. This time go back into the BIOS setup and set the computer to boot from the hard drive again. GRUB will appear and give you a choice between either Linux and DOS or just Linux to boot to. Select Linux with your keyboard. Linux will boot and bring you to a login screen. Login under the “root” account, using the login name “root” and your “root” password. - This is the only way to modify the necessary file to get Windows XP to boot from GRUB.
(historic info follows.. Most modern linux distros will have asked you a while ago about the grub bootloader and cohabiting with another OS.. Use your common sense and chose the option you want)
Once Linux is finished loading, bring up the Command Line Shell (In Redhat 7.2 this is the computer monitor Icon with a shell on it located in the taskbar, if you can’t find it in **insert name of linux distro here** just hover over each icon with your mouse and the name of the program will appear as “Terminal”, “Root Terminal”, "Console", "Command Line", or something to that effect.). Once the Command Shell appears, you need to navigate to the following directory and file:
/etc/grub.conf
If you’ve never used the command line interface in Linux before(like me), go to the “Sessions” button and click on the “Root Midnight Commander” (the non-“Root” version won’t allow you to edit the file). This will bring up a very basic GUI(similar to the BIOS setup in use) that will allow you to easily navigate your Linux files.
Once you open up the file, either through the command line or through Midnight Commander, go all the way down to the bottom of the file and add the following lines after the rest of the lines in the file:
title Windows XP
[TAB]root (hd0,0)
[TAB]makeactive
[TAB]chainloader +1
PLEASE NOTE that the word TAB inside the brackets indicates where you should indent with a TAB. Make sure that you type the bolded lines in EXACTLY as written above with the spaces and capitalizations all correct. Save it and exit. The next time you restart and the GRUB boot loader comes up, Windows XP should be listed under Linux. Just select it with the keyboard and hit enter. Windows XP should boot up and your system is now dual-booting Windows XP and Linux!! If the Windows XP title does not appear on your GRUB boot loader screen then you know that you did it wrong (real simple test, right? ;-) ).
There you go.. And you wanted to know how to do it right??