GRUB cant boot windows XP.

Hi, hope you lot can help me fix this. My trouble is that I have XP Pro installed on my SATA drive, MBR is as XP installed. If i choose (in BIOS) to boot straight from SATA then XP works. I also have Fedora 3 in a seperate disc (normal ATA) and can boot linux if i choose to boot straight to this drive too.

Everything Linux 1798 This topic was started by ,


data/avatar/default/avatar34.webp

8 Posts
Location -
Joined 2005-01-29
Hi, hope you lot can help me fix this.
 
My trouble is that I have XP Pro installed on my SATA drive, MBR is as XP installed. If i choose (in BIOS) to boot straight from SATA then XP works.
I also have Fedora 3 in a seperate disc (normal ATA) and can boot linux if i choose to boot straight to this drive too. I installed GRUB onto the ATA disc with Fedora, and told the BIOS to boot from the ATA. During installation i told GRUB where windows was and set it to the default boot option.
Now when i boot i get grub, can select Fedora and boot it, but if i choose Windows it fails to boot. Anyway i can point GRUB to
Windows?

Participate on our website and join the conversation

You have already an account on our website? Use the link below to login.
Login
Create a new user account. Registration is free and takes only a few seconds.
Register
This topic is archived. New comments cannot be posted and votes cannot be cast.

Responses to this topic


data/avatar/default/avatar34.webp

8 Posts
Location -
Joined 2005-01-29
OP
Just thought, had Mandrake 10.0 previosly and it boot loader (LILO I think) had no trouble booting either

data/avatar/default/avatar10.webp

2895 Posts
Location -
Joined 2002-08-30
I just got a sata drive and am still scratching my head. Where did you tell grub to boot Windows from? Specifically, what was the drive designation, hda1, or otherwise?
 
What I am interested in is where does Mandrake see the sata drive at? Hopefully I can learn something in the process as well. Sata drives should be seen as a designaton other than hda??? dependant on the sata hardware on the motherboard.
 
This will help identify where to tell grub to boot from.

data/avatar/default/avatar27.webp

2 Posts
Location -
Joined 2005-01-30
Try to edit the file menu.lst in /boot/grub
add the lines
 
title XP
chainloader = (hd0,0)+1
 
You have to be root to change the file
 

data/avatar/default/avatar10.webp

2895 Posts
Location -
Joined 2002-08-30
That's the point that I was trying to make, frankyb, the sata drive is not seen as (hd0,0), the first drive on an ide drive, but as something else. I was trying to get tomenglish2000 to look and see what it is seen as by Mandrake. Or am I mistaken?

data/avatar/default/avatar34.webp

8 Posts
Location -
Joined 2005-01-29
OP
I believe that when i was installing fedora i pointed Grub to windows at a harddrive with an s in it, (sa1 or something i believe) I also dont know how to login as root, tried to login as su but it wont work. I cant change menu.list as a normal user!

data/avatar/default/avatar34.webp

8 Posts
Location -
Joined 2005-01-29
OP
Just fiqured out that the root username is root and so thought i would post my grub.conf here.
 
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,0)
# kernel /boot/vmlinuz-version ro root=/dev/hdc1
# initrd /boot/initrd-version.img
#boot=/dev/hdc
default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.9-1.667)
root (hd0,0)
kernel /boot/vmlinuz-2.6.9-1.667 ro root=LABEL=/1 rhgb quiet
initrd /boot/initrd-2.6.9-1.667.img
title Microsoft Windows XP Pro
rootnoverify (hd2,0)
chainloader +1
title Other
rootnoverify (hd0,1)
chainloader +1
 
 
As you can see XP Pro is pointing to hd2,0 (but i think it should be sa1 (would the MBR be sa1,0)?
 
What do you make of it all?

data/avatar/default/avatar10.webp

2895 Posts
Location -
Joined 2002-08-30
Since i don't have XP on sata, I am not sure, but try something like this...
 
Remember, that grub sees the first partition on a master drive as (hd0,0).
 
Linux will say that the drive is hda1.
 
Grub starts with "0" and Linux starts the partition series as "1"
 
So, if the drive is seen as sa1 by linux, then the proper entry might be (sa0,0) since grub uses "0" to see the first partition, not "1"
 
Let's try this. Get into a console window and type in dmesg
 
Scroll up until you see an entry for the drive.
 
You can also go to the console as root uer and type in fdisk -l (that's the letter l, not the number 1) and see what the drive and partition structure looks like.
 
Sometimes sata will be seen as hde, which is very much like using a raid connection for an ide drive.
 
Let us know what you find out. I think that we are getting closer. but I admit my knowledge of sata is not good, so perhaps someone else has the proper answer right off.
 

data/avatar/default/avatar34.webp

8 Posts
Location -
Joined 2005-01-29
OP
Hello people.
 
Used dmesg and fdisk -l to gather drive information. Both report my sata as sda (with partition sda1 (where windows is) using system sfs) and a second partition sda2 (that little 8Mb partition that windows doesnt format). Tried these in grub.conf and no luck
 
Using the command line in grub and the geometry command i get the following:
 
hd0 = linux harddrive
hd1 = Windows harddrive (SATA)
hd2 = further drive
 
so i tried pointing Grub to hd1. no use!
i got an unrecognised format/file system type error! (Could this mean that GRUB cant boot from NTFS?)
then i did hd1,0 hd1,1 and hd1,2 (also all no use!)
 
I am going to try the Grub map (hd0)(hd1) line now!

data/avatar/default/avatar34.webp

8 Posts
Location -
Joined 2005-01-29
OP
The unrecognised format/file system type error thing i mentioned actually appeared as this in grub:
 
Error 13: Invalid or Unsupported executable format.
 
And swapping (ie map (hd0)(hd1)) doesnt make a difference.

data/avatar/default/avatar10.webp

2895 Posts
Location -
Joined 2002-08-30
No the problem is not booting from NTFS, it's the way sata is handled by the bios and if the bios is also set up to enable sata raid, as well. I need to think about this.
 
The drive swap technique would work, I think, except for the issue, as noted in the reference that fousage made;
 

Quote:Caution: This is effective only if DOS (or Windows) uses BIOS to access the swapped disks. If that OS uses a special driver for the disks, this probably won't work. 
Let me think about this some more.
 
One more issue that I thought of. What does the file /boot/grub/device.map say the valid drives are on the system?
 
Does it say that hd1 or hd2 is /dev/sda?
 
BTW, what motherboard is this; or what system - HP or Compaq by any chance? This may give me a clue.

data/avatar/default/avatar34.webp

8 Posts
Location -
Joined 2005-01-29
OP
IT WORKS!!!!!!!.
 
The device map says that /dev/sda as (hd1)
 
so i recheck grub.conf
and then read all the way through that HUGE article. In the article i noticed that the author says that there should be a space between my "map (hd0)(hd1)" so i change it to "map (hd0) (hd1)". I do this on both map lines. I change "rootnoverify" to "root" as the article suggests and also enter the "makeactive" line. My grub.conf now reads like this:
 
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,0)
# kernel /boot/vmlinuz-version ro root=/dev/hdc1
# initrd /boot/initrd-version.img
#boot=/dev/hdc
default=1
timeout=8
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.9-1.667)
root (hd0,0)
kernel /boot/vmlinuz-2.6.9-1.667 ro root=LABEL=/1 rhgb quiet
initrd /boot/initrd-2.6.9-1.667.img
title Microsoft Windows XP Pro
root (hd1,0)
map (hd1) (hd0)
map (hd0) (hd1)
makeactive
chainloader +1
 
As for the motherboard i was using it is an ABIT AV8.
It has a SATA controller on board, but i dont use RAID as I have only connected one HD to it.
 
Who would have thought that a couple of spaces would cause so much trouble. I must pay more attention to SYNTAX in the future!!
 

data/avatar/default/avatar10.webp

2895 Posts
Location -
Joined 2002-08-30
Nice work!
 
...and in the process, I learned something about sata and grub to boot.
 
Thanks frankyb for the prompts (puns intended)!