|
Homepage: http://linuxhelp.150m.com/ (Dec 2006. Last updated, June 24, 2008) on a Spare Partition. It is assumed that your harddisk is already partitioned, that grub is properly installed in the Master Boot Record (MBR), enabling you to boot all your Linux partitions, and that you wish to install Windows 2000 or XP on one of the partitions. I will install Windows on the partition /dev/hda2. Below is the partition table and the grub menu file from the computer that I will install Windows on. Of course, your partition table and menu file will be different. However, these files will be similar enough, to help you with yours. fdisk -l less /boot/grub/menu.lst A few things to note: 1) All grub numbering starts at zero. So /dev/hda2 = (hd0,1) in grub-speak. 2) SCSI and SATA harddrives are denoted like /dev/sda2, rather than /dev/hda2. 3) The line default 2 means that the 3rd entry of the grub menu file is booted by default. Remember, the numbering starts at 0, so default 0 would indicate the 1st entry is booted by default. 4) The 3rd entry of the grub menu file is the SUSE Linux 10.0 installation on /dev/hda5 = (hd0,4) in grub-speak. This means that grub will be using the grub machinery, including the menu file, from the 5th partition. I chose this partition because the SuSE boot-up is by far the most aesthetic. 5) The partition number in the kernel and initrd addresses, can be stated separately, for example, 6) Linux ignores the designation of "active" partition provided by the partition table (the star in the boot column). Now, let's proceed with the installation: 1) Turn on your computer. 2) If necessary, enter the BIOS of your computer and set the CD-drive as the first boot device. Even if you do not need to enter the BIOS in order to change the boot order, you may wish to enter the BIOS to give yourself enough time to get the installation disk into your CD/DVD drive, before it boots from the hard-drive. While in the BIOS you will have plenty of time to get the installation disk into the drive. When you leave the BIOS, the computer will reboot. 3) Place your Windows XP or 2000 installation disk in the CD/DVD drive. At this point the Windows installation program will kick in. It will ask you a few questions, you will have to enter a few details, click OK a number of times and after 30-40 minutes you will have a new copy of Windows installed on your chosen partition (in my case the 2nd partition /dev/hda2).
After, the installation you will be left to search for, and install, such items as video and printer drivers. Although, the installation provides a small number of utilities, games, etc, you will still have to install and configure the bulk of your software. So, you now have the difficult task of reinstalling and customizing, Microsoft Office and your third party software, such as, Adobe Reader, Photoshop, Virus protection, etc, etc. This all takes a lot of time and effort, especially if you happen to have lost the disk that came with your printer that included the printer drivers. Even worse, you may find that the disk that came with your printer does not have the necessary Windows XP/2000 drivers. So, reestablishing a Windows system is usually a royal pain in the ass. In contrast, reestablishing Novelle SuSE 10.0, is pretty much all done in 30 or 40 minutes. However, if, for example, you have an ATI video card and wish to install the fully accelerated ATI drivers, this may take you forever, as the installation of drivers (for certain cards) seems to have been deliberately sabotaged. On occasions, getting Windows back to the way it was, has taken a few days (and sometimes longer). So, when people tell you how easy Windows is to install, they are lying by omission, as they omit to tell you that the install is just the beginning of reestablishing a Windows system and that reestablishing a Windows system can be a royal pain in the ass. Proceeding with the installation: During the Windows installation the MBR written by grub, is overwritten. This means that if you were to reboot at this point, you could only boot Windows. Hence, we must reestablish a suitable MBR entry that will allow all bootable partitions to boot, be they Linux or Windows. In case you are interested, the MBR is just the first 512 bytes on your harddrive. 4) Replace the Windows installation CD with a Linux rescue CD and reboot. I used the Novelle SuSE 10.0 installation CD/DVD, which is also a rescue disk. In this case, choose "Rescue System" from the menu. When the login prompt appears, type root and hit return. No password is needed. For other varieties of rescue CD, you need to do whatever is necessary, to be logged on as root. Just for interest, enter fdisk -l to view the new partition table. Mine looked like: fdisk -l 5) Change root to be able to use the grub machinery on /dev/hda5. Now, as mentioned above, grub will be using the MBR and the grub machinery located on the 5th partition. So when we run grub, we must also use the files on the 5th partition (and not the grub files, if any, from the rescue CD). Consequently, we need to mount the 5th partition and chroot to. mkdir /5 mount /dev/hda5 /5 chroot /5 /bin/bash 6) To establish a suitable MBR, enter the command: grub grub 7) When the grub prompt appears, enter the following commands highlighted in green. grub> root (hd0,4) (specify which partition's menu file GRUB should use (here the 5th)) grub> setup (hd0) (install GRUB to the MBR (of 1st harddrive)) grub> quit (exit the GRUB shell) Again, the grub numbering system starts at zero, hence (hd0) is the first harddrive, ie, /dev/hda and (hd0,4) is the 5th partition, ie, /dev/hda5, on the first harddrive. Remember to change the entry root (hd0,4) so that it points to the partition with the menu.lst file (and other necessary grub files) that you have chosen to be read by grub at boot. Now adjust the menu.lst file. emacs /boot/grub/menu.lst & To be able to boot Windows, add the following to (hd0,4)/boot/grub/menu.lst. The following items are often added as well, but seem to be not necessary. makeactive rootnoverify (hd0,1) Your main menu file should now look something like: less /boot/grub/menu.lst Now exit the chroot, remove the CD and reboot. exit; reboot You should now be able to boot all your bootable partitions. In particular, you will be able to boot Windows by choosing the WINDOWS XP/2000 (/dev/hda2) entry from the grub menu. Furthermore,... 1) Suppose you now install a new flavor of Linux, called Zenith, on the 7th partition, /dev/hda7 (replacing the existing Debian installation). During the installation you will be asked if you wish to use grub as your boot-loader (ie, install grub). Say yes. You will also be asked if you wish to install grub in the MBR (Master Boot Record). Say no, as you already have grub (which knows to use the grub machinery from /dev/hda5) installed there. If you say yes, then this will tell grub to use the grub machinery from /dev/hda7, which is probably not what you want. Installing grub provides the file, (hd0,6)/boot/grub/menu.lst, which might look like this: The installation automatically produces a correct menu.lst entry for Zenith Linux. The only problem is that it is not in the right menu.lst file, so we will have to copy it there. The desired entry is: Since grub is using the grub machinery from /dev/hda5 = (hd0,4), we need to copy this entry to the file (hd0,4)/boot/grub/menu.lst and delete the old Debian entry. Of course, since the menu.lst file you wish to edit, is on a different partition, you will have to mount that partition before you will be able to edit it. mkdir /5 mount /dev/hda5 /5 emacs /boot/grub/menu.lst & On rebooting, Zenith Linux will then be listed in the grub menu. Selecting it with the arrow keys and hitting return will boot up Zenith Linux. By the way, if you accidentally added grub to the MBR, don't worry, just get your Rescue CD and do as you did after a Windows install. More explicitly, once you have logged in as root, changed root, run grub and got the grub prompt, enter: grub>root (hd0,4) grub>setup (hd0) grub>quit 2) Adding a further Windows XP/2000 partition, say on /dev/hda6 = (hd0,5). Make sure the first partition you installed Windows on, is marked as bootable by fdisk (ie, that there is star in the boot column). Delete any previous grub entry for /dev/hda6. Now precede with the Windows installation. The installation will automatically add /dev/hda6 to the Windows boot-loader. To boot the new copy of Windows, you choose the WINDOWS XP/2000 (/dev/hda2) entry from the grub menu, as before. Grub will start up the Windows boot mechanism which will present you with the Windows boot-loader menu. Choose the correct menu entry from there and the copy of Windows on /dev/hda6 will boot up. It is similar for three or more Windows partitions. On choosing the grub entry, "WINDOWS XP/2000 (/dev/hda2)," grub loads the Windows boot mechanism, which then provides the usual Windows menu enabling you to choose from the available Windows partitions. |