Linux+Win9x+Grub-HOWTO(1).pdf

(17 KB) Pobierz
Linux+Win9x+Grub HOWTO
Linux+Win9x+Grub HOWTO
Joel Rosen
Revision History
Revision v1.0
2002−01−10
Revised by: jr
Initial release.
This HOWTO will tell you how to use the GRUB bootloader to turn your computer into a Windows + Linux
dual boot machine, without affecting your current Linux installation.
Linux+Win9x+Grub HOWTO
Table of Contents
1. Introduction. ....................................................................................................................................................1
1.1. Why use this method?. ......................................................................................................................1
1.2. Copyright and License. .....................................................................................................................1
2. Requirements. ..................................................................................................................................................2
2.1. What are the requirements?. .............................................................................................................2
3. Procedure. ........................................................................................................................................................3
3.1. Creating the Windows partition. .......................................................................................................3
3.2. Installing GRUB. ..............................................................................................................................3
3.2.1. Installation. .......................................................................................................................3
3.2.2. Editing grub.conf. .............................................................................................................4
3.3. Installing Windows. ..........................................................................................................................5
i
184432131.001.png
1. Introduction
1.1. Why use this method?
I'm a big fan of things that aren't Microsoft, so when I got my new computer I had it come with Linux
preinstalled. It's a great desktop machine, but I've been sorely missing my Windows games, and the GIMP
just isn't cutting it. So I finally gave in and decided to make the machine dual boot. When I looked for
instructions on how to accomplish this, all I found was directions on how to install Linux if you already have
Windows installed and how to boot with Loadlin. Unfortunately, because Loadlin runs from under DOS, the
Loadlin method of making your system dual boot requires that you have Windows installed on the first
partition of your first hard drive, due to the fact that Windows believes it is the center of the universe and all
your other operating systems should revolve around it. This is a problem if you already have Linux on that
partition and you don't want to wipe out your system to install Windows.
This is where GNU GRUB, the GRand Unified Bootloader comes in. It differs from bootloaders such as
LILO in that it can lie to Windows and make Windows believe that it's installed on the first partition even if
it's not. So you can keep your current Linux system where it is and install Windows on the side.
1.2. Copyright and License
Copyright (c) 2002 Joel Rosen. Permission is granted to copy, distribute and/or modify this document under
the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free
Software Foundation; with no Invariant Sections, with the no Front−Cover Texts, and with no Back−Cover
Texts. A copy of the license may be found here .
1. Introduction
1
184432131.002.png
2. Requirements
2.1. What are the requirements?
You will need:
· Enough free disk space for your new Windows partition.
A computer with a working installation of Linux.
· A partition editor such as GNU Parted .
· GRUB r pm or source.
· A Windows/DOS boot disk with CDROM support and a CD with the Windows 9x install on it, or a
bootable Windows 9x install CD.
·
·
(Recommended) A Linux boot disk.
2. Requirements
2
184432131.003.png
3. Procedure
3.1. Creating the Windows partition
If you already have a clear partition or disk for your Windows installation, you can skip this section.
Otherwise, you'll need to run a partition editor to defragment your disk and create a new partition for
Windows. I used GNU Parted for my installation; sfdisk should work as well. DO NOT use fdisk, it won't
preserve your data. And note, this process is not guaranteed, make sure to backup any important files before
you begin.
Here is how my partition table looked pre−install:
Device Start End System
/dev/hda1 1 3 Linux
/dev/hda2 4 1222 Extended
/dev/hda5 4 36 Linux swap
/dev/hda6 37 1222 Linux
/dev/hda1 is my /boot partition (you may or may not have a separate boot partition for Linux), /dev/hda2 is an
extended partition which contains two logical drives, /dev/hda5 and /dev/hda6, which contain my Linux swap
partition and Linux installation partition.
As root, run your partition editor. Resize your Linux partition to however small you decide to make it. (Make
sure this size isn't smaller than the amount of data on your disk.) The program will defragment for a good
while and then change the partition table. Resize the extended partition which contains your Linux partition
accordingly. You should now have enough unused space on your disk in which to create a new primary
Windows partition. Go ahead and create the partition with a Win95 FAT32 (LBA) filesystem on it. Now your
partition table should look something like this:
Device Start End System
/dev/hda1 1 3 Linux
/dev/hda2 4 905 Extended
/dev/hda3 906 1222 Win95 FAT32 (LBA)
/dev/hda5 4 36 Linux swap
/dev/hda6 37 905 Linux
I strongly recommend that you run fdisk at this point and write down all of your partition information on a
piece of paper. If you make a mistake in your installation, Windows will be all too happy to rewrite your
partition table to its liking, and you'll need to know what your partitions look like in case of emergency.
3.2. Installing GRUB
3.2.1. Installation
You should have either an RPM or source package of GRUB somewhere on your disk. Go through the
appropriate installation procedure for your system. GRUB should now be installed but not loaded. As root
run:
3. Procedure
3
184432131.004.png
Zgłoś jeśli naruszono regulamin