Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] grub confusion, Windows XP and gentoo on same disk
View unanswered posts
View posts from last 24 hours

rackathon
 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Seron
Apprentice
Apprentice


Joined: 31 Dec 2002
Posts: 194
Location: Malmö, Sweden

PostPosted: Sat Sep 15, 2007 1:49 pm    Post subject: [solved] grub confusion, Windows XP and gentoo on same disk Reply with quote

I've got a primary sata drive that has Windows XP on /dev/sda1 and the gentoo /boot partition on /dev/sda2 and this is also the bootable partition. Both are primary partitions. There's also a hard disk on /dev/hde which can be disabled by disabling its IDE controller in BIOS. The below menu works either way.

After some fiddling with grub I've got it to work and I can boot both gentoo and Windows XP from the grub menu. But my settings in grub.conf are confusing and I don't understand why it works. It looks weird to me.

Here the relevant parts from grub.conf
Code:
title=Gentoo
root(hd1,1)
kernel /boot/kernel-2.6.22 /root=/dev/sda5

title=Windows XP
rootnoverify (hd0,0)
makeactive
chainloader +1

Remember these partitions are on the same disk drive so why do the menu entires seem to point to different harddisks (hd1 and hd0)? If I set rootnoverify (hd1,0) for the Windows XP entry it hangs when I select that menu item.

Code:
$ cat /boot/grub/device.map
(hd0)    /dev/hde
(hd1)    /dev/sda


And the other thing I would need some help with is; I don't remember where I placed the grub boot loader, MBR or a partition and where it points. How can I find this out?
_________________
man cannot be brave without being afraid


Last edited by Seron on Mon Sep 17, 2007 8:01 am; edited 1 time in total
Back to top
View user's profile Send private message
Habbit
Apprentice
Apprentice


Joined: 01 Sep 2007
Posts: 237
Location: 3.7137 W, 40.3873 N

PostPosted: Sun Sep 16, 2007 3:32 pm    Post subject: Re: grub confusion, Windows XP and gentoo on same disk Reply with quote

Seron wrote:
And the other thing I would need some help with is; I don't remember where I placed the grub boot loader, MBR or a partition and where it points. How can I find this out?

Extract your MBR to a file and test for the presence of the string "GRUB", then do the same with your boot sector. In this example, GRUB is in the boot sector:
Code:

root@machine: ~ # dd if=/dev/sda of=mbr.bin count=1
1+0 input; 1+0 output; 512 bytes transferred
root@machine: ~ # dd if=/dev/sda2 of=bootsect.bin count=1
1+0 input; 1+0 output; 512 bytes transferred
root@machine: ~ # grep "GRUB" mbr.bin bootsect.bin
Match in binary file bootsect.bin


About your HD mess: first, check where your XP boot sector really is, and create it into /dev/sda1 if it's not there (boot from XP disk, use recovery console command FIXBOOT, iIrc). The other possible cause would be XP requiring to boot from the _first_ HD (in order to use some ancient BIOS routines with constant params). GRUB has options to fool OSes and make them think drive 0x80 is really 0x81 and vice versa. They're called swap or something like that. See the GRUB documentation for them, or just enter the grub command line and help yourself to knowledge through tab-completion (only available when run as bootloader, not from inside Linux).
_________________
Code:
~ $ objdump -d ./habbit_mind
90      xchg %rax, %rax
EB FD   jmp $-3
Back to top
View user's profile Send private message
Seron
Apprentice
Apprentice


Joined: 31 Dec 2002
Posts: 194
Location: Malmö, Sweden

PostPosted: Mon Sep 17, 2007 8:00 am    Post subject: Reply with quote

Many thanks. I've changed both entries to point the hd0 and it works just the same but looks more correct. And thanks for letting me know how to find grub.
_________________
man cannot be brave without being afraid
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum