www.tldp.org/HOWTO/Linux+Win9x+Grub-HOWTO/proc.html
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. Resize your Linux partition to however small you decide to make it. 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.
Go through the appropriate installation procedure for your system. As root run: # /sbin/grub-install /dev/hda This will load GRUB into the master boot record of your disk. So, "root (hd0,0)" tells GRUB that the kernel is on the first partition of /dev/hda. You can see that GRUB has a funny numbering system, 0-3 for primary partitions and 4+ for logical partitions. The next line tells GRUB just where to find your kernel and where your actual root partition with your Linux system is. Note that these few lines will probably be somewhat different if you don't have a separate /boot partition. The "map" lines under the Windows 98 section are essential for getting your installation to work. These are the magical lines that trick Windows into believing that it's installed on the first partition of the first disk. If you don't map the Windows partition to (hd0,0), Windows will destroy your partition table and you won't be able to boot anything. The "DOS boot disk" section is needed if you are going to boot from floppy to begin the Windows install, but it will also come in handy after your install if you ever want to use a DOS boot disk for whatever reason. If your Windows install CD is bootable, you'll need to have a "Windows boot disk" section which chainloads to whatever your CDROM device is called. Unlike LILO, GRUB does not require you to run any executable after you've modified the boot configuration. Now, with your emergency Linux boot disk handy, try rebooting your computer. When the system comes up you should see the GRUB menu with your three boot options. Hopefully, Linux will boot as usual and you'll have installed GRUB properly. Once you've got GRUB successfully booting Linux, it's time to install Windows. Installing Windows Remove all diskettes and CDs from your computer and reboot. DO NOT boot your computer with the installation media already in the drive. If you do that, your BIOS will just boot the Windows install directly and GRUB won't get a chance to work its magic. When the GRUB menu comes up, insert your floppy or CD and select the DOS boot disk or Windows install CD boot, depending on your installation method. Windows install should see the partition you've made for it on the C: drive.
|