LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   grub guru needed: XP/FC3 dual boot (https://www.linuxquestions.org/questions/linux-newbie-8/grub-guru-needed-xp-fc3-dual-boot-289518/)

FC3noob 02-12-2005 10:16 PM

grub guru needed: XP/FC3 dual boot
 
Hoping to find a grub master here. Have 3 SCSI disks, XP/ntfs installed on the first two (drive 1 boots XP, and both are dynamic disks) and FC3 on the third. FC3 was initially installed with disks 1 and 2 disconnected, and grub (on disk 3's mbr) boots FC3 if give drive 3 boot designation in the SCSI bios, but I'd also like to use grub to boot XP. When booting Fedora, grub uses the following table entry in grub.conf:

title Fedora Core (2.6.10-1.760_FC3smp)
root (hd0,0)
kernel /vmlinuz-2.6.10-1.760_FC3smp ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.10-1.760_FC3smp.img

Fedora can mount and read ntfs on both the XP disks just fine. I tried adding the following to grub.conf:
title winXP
rootnoverify (hd1,0)
makeactive
chainloader +1
thinking that (hd1,0) would be how grub saw the XP boot drive. I booted from drive 3, but when I select the above entry from grub nothing happens (grub just echoes these entries but XP never loads).

Here is what fdisk -l returns (extraneous crap removed)
Disk /dev/sda: 36.7 GB, 36703934464 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 4461 35832951 42 SFS
/dev/sda2 4462 4462 8032+ 42 SFS

Disk /dev/sdb: 18.3 GB, 18351967232 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 2231 17920476 42 SFS

Disk /dev/sdc: 9186 MB, 9186603008 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 * 1 13 104391 83 Linux
/dev/sdc2 14 1116 8859847+ 8e Linux LVM

Can anyone tell me how to tell grub to find the XP boot disk and transfer control to the XP boot loader? Alternatively, can I set the first drive as boot but add an entry to boot.ini to transfer control to grub? What would that entry look like?

Dark_Helmet 02-12-2005 11:31 PM

I did something similar. I have two drives: one with Win2k, and one with Linux. I installed Linux while the Windows drive was disconnected. My drives are IDE, but I don't think that will matter; they're just drives from the BIOS perspective. Here's the juicy part of my grub.conf:
Code:

title LFS 6.0-7b
root (hd0,0)
kernel /lfskernel-2.6.8.1-7b root=/dev/hdb2

title Windows 2000
map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd1,0)
chainloader +1

Ok, first, I removed the makeactive. Why? Because makeactive actually marks the partition bootable. In my BIOS, that meant my Windows drive would become the default boot drive in the system on the next boot. In other words, I would lose access to grub, because the system would go look at Windows' boot sector first, see it's marked as bootable, and use it (instead of seeing grub on the other drive).

Now, the mapping business... I'd read that Windows requires that it boot from the "first drive in the system" or something along those lines. To my understanding, the map commands "lie" to Windows, convincing its bootloader that it is the first drive. I don't know how it does it (maybe temporarily affecting BIOS information). Anyway, I had seen the same thing you are: the system displays the commands in the grub entry and just sits there. Adding the map commands fixed the problem.

Also note, that the rootnoverify is set up based on the pre-remap. The mapping commands don't affect the drive designations within grub.

FC3noob 02-12-2005 11:59 PM

Quote:

Originally posted by Dark_Helmet


map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd1,0)
chainloader +1


Now, the mapping business... I'd read that Windows requires that it boot from the "first drive in the system" or something along those lines. To my understanding, the map commands "lie" to Windows, convincing its bootloader that it is the first drive. I don't know how it does it (maybe temporarily affecting BIOS information). Anyway, I had seen the same thing you are: the system displays the commands in the grub entry and just sits there. Adding the map commands fixed the problem.

Also note, that the rootnoverify is set up based on the pre-remap. The mapping commands don't affect the drive designations within grub.

Dark_Helmet:
You're right! I made the changes exactly as you described as it works perfectly ... progress :D
Thanks for the expert help!

syg00 02-13-2005 01:19 AM

Hopefully both of you are aware of Microsofts penchant for re-writing the MBR on re-install/upgrade.
These schemes only work when grub can get control.
If you remember to put the M$ disk back as primary for any such re-install, you'll be fine - if not you'll be severely pissed off. :eek:

FC3noob 02-13-2005 03:15 AM

Thanks for the tip, syg00. Actually, that eventuality was my motivation for keeping grub on the last disk, away from XP's big feet.
Cheers --


All times are GMT -5. The time now is 06:29 PM.