Linux and XP Bootloading

Home

Dynamics
Collision Response
Rigid Body Dynamics
Spring Tutorial
Volume Interior Finding

OpenGL
OpenGL
Orientation Matrices

Motion Capture
BVH Viewer

Planet Buster
Planet Buster

Linux
Linux and XP Bootloading

Wings3D
Wings 3D Tutorial 2
Wings 3D Tutorial

School Projects
Earlier Projects
Last Projects

Videos
EffecTV


The Setup

I had Windows XP as it came installed on a Dell on a 20 gig hd, and an older 15 gig hd that I set out to install Red Hat Beta Null (7.3.94) onto. Using the beta may not be the best choice, but there were some features on it I was willing to put up with any quirks to have. Currently, everything is upgraded to 8.0 though I don't think grub has been updated significantly between those two releases.

Installation went fine, and as it is said of Linux currently, the challenge lies not in getting the distribution installed but in fine tuning and customizing the system even after the autodetection and automatic configuration was well and successful.


GRUB: The GRand Unified Bootloader

The Red Hat installer didn't recognize my need to boot two different OS's off two different drive, and so I had to delve into the bootloader options. There were two ways to go:

Boot off the XP drive, and have the Windows bootloader boot each os.

Boot off the Linux drive, and have GRUB or lilo choose the os to boot.

Naturally the second is the most attractive option, and that's what I set about doing. One note: I initially thought that the master/slave options set on the drive's jumpers would decide which hd to be booted, but the bios overrides this with its own drive priority settings. Initially, by pressing the del key upon startup, I switched between drives to boot by changing their priority in the bios. That constitutes a third solution to the problem which required little fiddling with bootloaders, but is very inelegant.

GRUB is a GNU replacement for lilo, and one key feature is the ability to edit the boot configuration before bootloading has occured. This saved me from having to use a bootdisk more than a few times.

Another note: I read that Windows does not like to be booted off a secondary drive, and that it might be necessary to erase the mbr (master boot record) on the XP drive with the linux bootloader. This seemed too risky and I ruled it out from the start.

Some google searching and reading of the GRUB manual resulted in an /boot/grub/grub.conf like this:

	default=0
	timeout=10
	#fallback=0
	splashimage=(hd0,0)/grub/splash.xpm.gz
	title Red Hat Linux (2.4.18-11)
	        root (hd0,0)
	        kernel /vmlinuz-2.4.18-11 ro root=LABEL=/ hdd=ide-scsi
	        initrd /initrd-2.4.18-11.img
	title Windows XP
	       map (hd0) (hd1)
	       map (hd1) (hd0)
	       setup (hd0)
	       rootnoverify (hd0,0)
	       root (hd0,0)
	       makeactive
	       chainloader +1
	

The two sets of map commands under the XP portion are supposed to convince Windows that it is in fact on the primary drive (hd0). It didn't work for me but one user sent me this:

	 title Windows XP
	        map (hd0) (hd1)
	        map (hd1) (hd0)
	        rootnoverify (hd0,0)
	        root (hd1,0)
	        makeactive
	        chainloader +1
	

With this I get an error message about an 'Invalid or Corrupt' boot sector. This user was running XP on ntfs rather than fat32, so perhaps that is the source of discrepancy or there are errors on the fat32 partition.


XP Bootloader

The other option requires copy 512 bytes off the /boot portion of the linux drive into the C:\ root directory, and instructing windows to boot that as a second option. Remember that if the drive priority has been switched around in bios, the grub.conf needs to be tailored to that setting- set up grub.conf and run grub-install assuming the linux drive to be secondary even it may have been necessary to set it as primary to get in and do any work at all.

The command was something like:

dd if=/dev/hdb of=bootsect.lnx bs=512 count=1

(it may be /dev/hda depending on the setup) Since I'm running XP on a fat32 filesystem, I could simply copy bootsect.lnx to the 'C:\' drive. With ntfs, use a floppy or email it to yourself and reboot into XP to put the file in it's place.

XP's bootloader can be told to attempt to boot linux by putting a line like

C:\BOOTSECT.LNX="Linux"

Under [operating systems] in boot.ini.

Experiments with this resulted in two failure modes upon attempting to boot linux from the XP bootloader:

GRUB would fail to start, printing a GRUB_ to the screen and locking up.

GRUB would get into an infinite loop, printing 'GRUB' to the screen repeatedly: GRUB GRUB GRUB GRUB, which reminded me of Philip K. Dick's Martian Timeslip for some reason. At least GRUB was getting somewhere though, apparently back to the same piece of code over and over.

The reason I discerned for the two variations was that the first (GRUB_ or GRUB _) was the result of copying the wrong 512 bytes into C:\, like /dev/hdb rather than /dev/hdb1 (the latter being where /boot is mounted).


Concluding in Failure

So I couldn't get it to work, and as a result I have to switch through the bios settings at startup.




Copyright © 2002-2003 Lucas W