GRUB cant boot windows XP.
#1
Posted 29 January 2005 - 11:17 PM
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?
#2
Posted 29 January 2005 - 11:18 PM
#3
Posted 30 January 2005 - 02:26 AM
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.
#4
Posted 30 January 2005 - 10:09 AM
add the lines
title XP
chainloader = (hd0,0)+1
You have to be root to change the file
#5
Posted 30 January 2005 - 02:31 PM
#6
Posted 30 January 2005 - 04:12 PM
#7
Posted 30 January 2005 - 04:21 PM
# 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?
#9
Posted 30 January 2005 - 05:35 PM
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.
#10
Posted 30 January 2005 - 06:05 PM
If you have installed Windows on a non-first hard disk, you have to use the disk swapping technique, because that OS cannot boot from any disks but the first one. The workaround used in GRUB is the command map (see map), like this:
grub> map (hd0) (hd1)
grub> map (hd1) (hd0)
(from: http://www.gnu.org/software/grub/manual/html_node/DOS-Windows.html#DOS%2fWindows)
#11
Posted 30 January 2005 - 08:10 PM
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!
#12
Posted 30 January 2005 - 08:18 PM
Error 13: Invalid or Unsupported executable format.
And swapping (ie map (hd0)(hd1)) doesnt make a difference.
#13
Posted 30 January 2005 - 09:22 PM
The drive swap technique would work, I think, except for the issue, as noted in the reference that fousage made;
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.
#14
Posted 31 January 2005 - 12:33 AM
http://www.linuxquestions.org/questions/showthread.php?s=&threadid=237511
#15
Posted 31 January 2005 - 01:32 AM
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!!
#16
Posted 31 January 2005 - 02:46 AM
...and in the process, I learned something about sata and grub to boot.
Thanks frankyb for the prompts (puns intended)!

Help










