LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-10-2003, 04:44 PM   #1
rheza
LQ Newbie
 
Registered: Apr 2003
Distribution: Slackware
Posts: 21

Rep: Reputation: 15
GRUB and Windows XP


I give up in lilo, I have this problem.

I have Slackware 9.0, in /dev/hda3 [(hd0,2) in GRUB]
and I have a Windows 98 partition, in /dev/hdc1 which has Windows XP's bootloader, capable of booting Windows XP and Windows 98.

GRUB is installed in the /dev/hda MBR (in BIOS, C: boot)
while Windows XP's boot manager is in /dev/hdc MBR (in BIOS, D: boot)

I want to do any of three things

1) boot my system using GRUB which can pick either Slackware 9.0 or Windows XP, where Windows XP will call it's boot manager and let me choose between Windows XP or Windows 98 (this is bad, I don't really like this, the second is better)

2) boot my system using GRUB, which can pick between Slackware 9.0, Windows XP or Windows 98.

3) boot my system using Windows XP's boot manager. And in the boot.ini file, I'll be able to boot Linux, which is called upon by GRUB which doesn't wait, and doesn't have a menu.

Currently, I am setting up for option 1. I followed several sources available online and have managed to make up a menu.lst that looks like this:

=== menu.lst ===
timeout 5
default 1

# For booting Linux - works great
title Slackware 9.0
root (hd0,2)
kernel /boot/vmlinuz root=/dev/hda3 ro

# For booting Windows XP - doesn't work
title Windows XP
rootnoverify (hd1,0)
makeactive
chainloader +1
==== end of menu.lst ===

If I run that, setting my BIOS to boot using C:, which contains GRUB's MBR, and chose Slackware 9.0, I'd be able to boot this properly. But, if I choose Windows XP, it won't do anything and just go to GRUB's command line.

Can anyone help me with that?

Here are the other things that might be important:

=== fdisk -l /dev/hda ===
Disk /dev/hda: 41.1 GB, 41110142976 bytes
255 heads, 63 sectors/track, 4998 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 1 701 5630751 7 HPFS/NTFS
/dev/hda2 1553 4998 27679995 f Win95 Ext'd (LBA)
/dev/hda3 * 702 1552 6835657+ 83 Linux
/dev/hda5 1553 1676 995998+ 82 Linux swap
/dev/hda6 2423 4997 20683656 b Win95 FAT32
=== end of fdsk -l /dev/hda ===

=== fdisk -l /dev/hdc ===
Disk /dev/hdc: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdc1 * 1 702 5638783+ b Win95 FAT32
/dev/hdc2 703 4865 33439297+ f Win95 Ext'd (LBA)
/dev/hdc5 703 1212 4096543+ b Win95 FAT32
/dev/hdc6 1213 3762 20482843+ b Win95 FAT32
/dev/hdc7 3763 4865 8859816 b Win95 FAT32
=== end of fdisk -l /dev/hdc ===

=== GRUB's map information===
(fd0) /dev/fd0
(hd0) /dev/hda
(hd1) /dev/hdc
=== end of GRUB's map information ===

I give up using LILO to do it so please help me with GRUB, thanks.
 
Old 04-10-2003, 06:49 PM   #2
infamous41md
Member
 
Registered: Mar 2003
Posts: 804

Rep: Reputation: 30
this is prolly the problem. when grub loads, it assumes that it is is hd0 for some odd reason. u have to change around the XP part, like this:

# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/hdb2
# initrd /initrd-version.img
#boot=/dev/hdb
default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz

title Red Hat Linux (2.4.18-14)
root (hd0,0)
kernel /vmlinuz-2.4.18-14 ro root=LABEL=/ hdc=ide-scsi
initrd /initrd-2.4.18-14.img

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

-even tho my XP drive is actually harddrive 1, for some reason grub thinks that it isnt. why, i don't know??? but i had the exact same problem as u.

Last edited by infamous41md; 04-10-2003 at 06:51 PM.
 
Old 04-10-2003, 07:08 PM   #3
UnTamed
Member
 
Registered: Dec 2002
Location: Qc, Canada
Distribution: CRUX
Posts: 317

Rep: Reputation: 30
XP *is* on hda1, right? if so, you might just need to change your rootnoverify to (hd0,0).

Otoh, the remapping is what will allow you to boot 98 directly from grub, create another entry and put in the right partition.
 
Old 04-10-2003, 11:05 PM   #4
paneless
LQ Newbie
 
Registered: Mar 2003
Distribution: Debian Woody
Posts: 18

Rep: Reputation: 0
Adding the lines:

map (hd0) (hd1)
map (hd1) (hd0)

as in infamous41md's post should get you to the XP bootloader, which will give you the choice of XP or win98.

You could add another boot stanza to grub for win98 to boot it directly from grub:

title Win98
map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd1,X) #where X is the partition that win98 resides
chainloader +1

Once you have this working, you could then edit your XP system's boot.ini file to delete the line that contains Windows 98 boot information.
 
Old 04-11-2003, 02:53 PM   #5
rheza
LQ Newbie
 
Registered: Apr 2003
Distribution: Slackware
Posts: 21

Original Poster
Rep: Reputation: 15
I got it now, thanks a lot.

(infamous41md)
check out [info grub] -> commands -> Command line and menu entry commands -> map

I don't really get it either, but you might after reading it.
 
Old 11-26-2003, 11:33 PM   #6
screwball
LQ Newbie
 
Registered: Mar 2002
Location: NW FL
Distribution: RH9
Posts: 19

Rep: Reputation: 0
i have a similar problem. I had win98 and Red Hat 9 already installed and added a 3rd hard drive with a good (and legal) version of XP that was on this computer previously. I took out the hard drive for testing but had 98 and RH9 installed in the mean time. So now i have 98 on C: (hd0,0) and RH9 on equivalent of D: (hd1,0). The CDROM is Master and 3rd hd (with XP) is slave on that channel. So I edited the grub.conf as follows:
title Red Hat Linux (2.4.20-6)
root (hd1,0)
kernel /vmlinuz-2.4.20-6 ro root=LABEL=/ hdc=ide-scsi
initrd /initrd-2.4.20-6.img
title Winblows 98
rootnoverify (hd0,0)
chainloader +1
title Winblows XP
rootnoverify (hd1,1)
make active

i figured master channel 1 is Win98 as hd0,0, Linux slave channel 1 hd1,0 then channel 2 CDROM cdrom0,1 (cd not bootable) and XP as hd1,1.

where am i going wrong and how do i update the boot record to reflect the new hard drive and make it available to use?

PS as a side note i am taking out the Win98 eventually (maybe a few weeks or so) to use in another computer but it will be eventually wiped clean and used as a storage hd.
 
Old 11-26-2003, 11:54 PM   #7
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
OK first of all grub doesnt care about cdroms so you only have to worry about harddisks, secondly in grub naming convention the first digit in (hdX,X) refers to the disk, second digit refers to the partition. Therefore your windows xp, which is on the third harddrive, is actually on (hd2,0).
Take note that whenever you change the boot order in bios, the ordering in grub will also change, so for example if you set your D:\ (drive with redhat) as the first boot device it'll become (hd0,0) in grub.

Also another thing very important is how your harddisks are connected when you installed winxp, if it was installed while 3 disks are connect like your current configuration(with win98 as the first boot device), then most likely the nt os loader, which is required to load winxp, will be installed in the bootsector of the win98 partition, resulting in a win98/xp dual boot with nt os loader. If that is the case then you simply need to chainload (hd0,0) in grub. Otherwise if windows XP was installed while its the only harddrive connected(or its set to the first boot device), then nt os loader will be installed in its own partition, which in this case you can use (hd2,0) in grub but you'll need to make a mapping in grub so that it becomes the first boot device, otherwise it won't boot properly.
sample grub entry:

title Windows XP
rootnoverify (hd2,0)
map (hd0)(hd2)
map (hd2)(hd0)
chainloader +1

note that there's no need to makeactive, it'll already be the active partition if there's only one partition.
Oh yeah and you only need to edit /boot/grub/grub.conf to change the configuration, no need to reinstall the bootsector like lilo.

Last edited by Demonbane; 11-26-2003 at 11:57 PM.
 
Old 11-27-2003, 12:50 AM   #8
screwball
LQ Newbie
 
Registered: Mar 2002
Location: NW FL
Distribution: RH9
Posts: 19

Rep: Reputation: 0
it acted as if it started to boot Win98 then i got the error KERNSTUB: error while booting
 
Old 11-27-2003, 10:56 PM   #9
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
Sounds bad...you probably need to reinstall win98..
 
Old 11-28-2003, 09:51 AM   #10
screwball
LQ Newbie
 
Registered: Mar 2002
Location: NW FL
Distribution: RH9
Posts: 19

Rep: Reputation: 0
nah, i just had to reinstall XP and now it works fine, Win98 and RH9 were working fine to begin with but i wasnt sure if i had removed the XP hd because of XP problems or whatnot but all is working now, thanks for the help everyone
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
windows and grub marioV Linux - General 1 11-28-2005 02:36 PM
SuSE 9.1 and Windows Xp refuse to live in harmony: error loading windows through GRUB sanctumtacete Linux - Newbie 3 10-19-2004 08:47 AM
Does windows longhorn use grub? Timeturtle General 4 07-22-2004 07:17 PM
GRUB windows xp not booting mirage Linux - Newbie 2 05-14-2003 03:10 PM
Boot windows 98,windows XP and linux by GRUB Swift&Smart Linux - General 6 02-22-2003 10:11 AM


All times are GMT -5. The time now is 12:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration