Dual Booting Fedora (Windows XP already installed - ntldr method)
by
Rehan Khan
—
last modified
Jan 17, 2009 11:12 AM
—
filed under:
Install Solutions
This How-To will cover Installing Fedora on a Windows machine and Dual Booting Fedora from a Windows XP machine using Grub4Dos. This is a relatively simple method that is non-destructive to the Windows installation. You will need to have some un-partitioned space on your machine to follow this configuration. Some reasons you might want to use this method:
Note : This procedure can be used with Vista but it is recommended that with Vista the EasyBCD tool is used to directly boot linux from the Vista Bootloader. See this link.
Warning:This document assumes that you are able to make some unpartitioned space on a Hard disk possibly by resizing partitions. This can be a risky procedure and you can end up losing ALL your data if done incorrectly. Please consider carefully what you are doing BEFORE you do it to minimise any risks. Check, think, re-check, think and check again. Thinking about things AFTER you have done them when things have gone wrong may not get your data back and may require you to spend a significant (~days) amount of time and expense to fix (and still not get your data back). If you decide to go ahead follow this guideline depending on your confidence and experience:
Make sure you have backed up any important data to a different disk (external/other hard drive, CD/DVD, tape). Make sure your external backup is not connected to the machine when you are resizing partitions.
Although it is not directly relevant to this document one should note that many Partitioning Tools are not aware of or don't work with partitions held within/inside a LVM partition. If your partitioning tool cannot show you the partitions inside the LVM volume and doesn't explicitly say it supports LVM volumes DON'T resize an LVM volume. It is data destructive usually with no easy way of going back. LVM partitions are usually designated 'unknown', 'Linux LVM' or show a partition ID of 0x8E.
Applicable to :
Requirements
Please note that Windows Disk Manager cannot be used to complete this step.
Disk space requirements for free space:
A copy of Grub4Dos which can be downloaded from here:
Doing the Work
1) Make available unpartitioned space on a connected Hard disk
2) Install Fedora to the unpartitioned space
Before starting make absolutely sure you have made some space at the end of the drive after the windows ntfs partition and that the space is un-partitioned space. This can be checked in Windows Disk Manager. One of these guides can be followed to install Fedora, depending on the version you want to install : http://docs.fedoraproject.org/install-guide/ There is only one (very important!) change to a standard install that needs to be made if you are following the guides.
For example whilst installing Fedora 8:
On Fedora 10:
The steps are similar in F9 and F10. The key is to not overwrite the Windows boot sector.
3) Install and Configure Grub4dos in Windows
a) If everything has gone smoothly you will reboot back into Windows (As the linux boot sector is on the linux partitions not the mbr or ntfs partition). b) From the grub4dos zip file you downloaded earlier, extract the grub4dos directory to c:\. c) Copy the grldr file from the c:\grub4dos directory to C:\. (The grldr file must go into the root of the c:\ drive). It is important that the grldr file should be in the c: drive that windows sees. d) Now edit the Windows boot.ini file. To work around windows default settings of hiding system files the boot.ini can be accessed by clicking on the START button and selecting RUN. When the run dialog pops up type "notepad c:\boot.ini" (without the quote marks). Click OK. Notepad should pop up. Add the following line to the bottom of the file:
c:\grldr="Grub4dos"For example the boot ini might look like this: [boot loader] However your boot.ini file looks, the most important line is the the last one. Press ctrl-s to save. As the boot.ini is a system file this first save will fail. When the file dialog pops up just click on save again and the boot.ini will be saved. (strange but true) That should be all that is required to set things up. Final Configuration and TroubleshootingHow to testReboot and select Grub4dos from the windows boot menu. This will start grldr which loads Grub4dos. After a second or two Grub4dos will try to find the drive with a menu.lst. It looks in various places to cover the different flavours of linux out there. It should find the linux boot partition that was created during the Fedora installation. Grub4dos will then execute the Fedora menu.lst as if it was the Fedora Grub. The normal Fedora boot process will follow.
Common problems and fixes
More InformationEXT2IFSThis driver can be installed in Windows. It gives access to ext2 and *clean* ext3 file systems through Windows. Using this you can look into e.g the /boot partition and edit the menu.lst. Notepad++is a good Windows editor if you are editing files on your linux partitions as it retains linux linefeeds if the file originally contained them. Please note that using Ext2IFS, while helpful in certain situations, is a security risk so use it with care.
DisclaimerWe test this stuff on our own machines, really we do. But you may run into problems, if you do, come to #fedora on irc.freenode.net Added ReadingExcellent Grub4Dos guide : http://diddy.boot-land.net/grub4dos/Grub4dos.htm
Appendix A : Some notes about hard disk naming (very simplified)
It might be helpful to keep in mind that the Bios, Grub, Windows XP and Linux all use slightly different methods to designate/label/identify their disks.
Bios: The bios organises it's disk's depending on where they are connected. As a general rule by default The disks connected to the IDE interface (sometimes described as pata) are listed first. If there is an onboard sata interface any disks connected here will be listed next. Any add-on boards are listed finally. The bios designates it's disks disk0 (also sometimes called the boot disk), disk1 etc although you will not usually see this anywhere useful. Some bios' allow you to designate which disk is disk0. Disk0 is important because this is the disk that the bios will try to boot from. It must have a Master Boot Record (MBR) of some sort.
Grub: Disk's are labelled (hdx) or (hdx,y) in grub where x is the disk number and y is the partition number. Both x and y start counting from 0 (zero). Grub labels hd0 by looking at what the bios has labelled disk0 and hd1 from what the bios has called disk1 etc.
Windows XP : Uses a slightly more complex notation which can be seen in the boot.ini. The details are out of scope for this documentation and should not be needed.
Linux: Linux generally calls the bios' boot disk /dev/hda or /dev/sda. Linux designates partitions on disks by adding a numeral after the device name and starts counting from 1 (one). e.g. bios disk0 -> linux /dev/sda -> First partition = /dev/sda1. Sometimes the file /boot/grub/mapppxxx is used to change the way linux see's and labels the bios' disks.
A couple of examples: Disk connected to Primary IDE channel on the end connector : (hardware) Primary IDE Master -> (Bios) Disk0 or boot disk -> (Grub) hd0 -> (Linux) /dev/sda
Disk connected to Primary IDE channel on the end connector, with 1 partition : (hardware) Primary IDE Master -> (Bios) Disk0 or boot disk, active partition-> (Grub) hd0,1 -> (Linux) /dev/sda1
Disk connected to onboard Sata 0 with 1 partition : (hardware) Sata 0 -> (Bios) Disk0 or boot disk, active partition-> (Grub) hd0,1 -> (Linux) /dev/sda1
So depending where you are and what you are doing be sure to use the correct disk/partition naming convensions.
Appendix B:
Grub4Dos had an issue chainloading Fedora Grub, on my machine it hangs the machine. This might work on your machine and it would give you a more seemless boot environment. To test this add the following to the menu.lst file in c:\
[code] title Fedora (grub boot) chainloader (hd0,1)+1 rootnoverify (hd0,1) [/code]
This will boot partition 1 on disk 0 (adjust this to point to your Fedora /boot partition). You should in theory get the Fedora Grub boot screen.
Please report back if this works for you as it is a more preferred solution.
Document Actions |
