Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Setting up Dual Boot?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Negated Void
l33t
l33t


Joined: 25 Dec 2002
Posts: 659

PostPosted: Wed Dec 25, 2002 10:08 pm    Post subject: Setting up Dual Boot? Reply with quote

Hello!

I'm loveing gentoo already! :)

I'm a little stuck on the last section of my install process and was wondering if i could get a quick little 'what to do' off of a benivalent soul :)

I have Two hard drives, with the second one (detected as hdh) partitioned a couplea times. One partition is Windows XP, another is Gentoo, Another the Gentoo BOOT, another the LInux SWAP.

After Installing gentoo, and grub, grub wouldn't run Windows right (i think i might have overwrote the windows MBR) and i needed windows (sadly), so i had to overwrite the MBR with the XP one. So now my computer just goes right to XP upon boot.

I have my recently-created grub boot disk.

What i need to know:

How to re-install grub, without erasing the windows boot option - so i can dual boot.

Thanks soo much!
Merry Christmas (if you're celebrating it)
-Matt

PS - Thanks again! I love the Gentoo Community!
Back to top
View user's profile Send private message
Privateer
n00b
n00b


Joined: 19 Dec 2002
Posts: 9
Location: Vienna, Austria

PostPosted: Wed Dec 25, 2002 10:25 pm    Post subject: Reply with quote

Hi!

AFAIK you can't have two bootloaders... but there shouldn't be any problem dualbooting Windows and Linux with grub.

Boot your system from the Gentoo CD and mount your root partition somewhere. Then mount your boot partition.
Create your grub.conf (/boot/grub/grub.conf):
Code:
default 0
timeout 10
splashimage (hd0,1)/grub/splash.xpm.gz

title Gentoo Linux
root (hd0,1)
kernel /vmlinuz root=/dev/hdh5 ro

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


In this example, there is one hard disk (hd0 in grub, /dev/hdh in Linux), with Windows on its first partition (hd0,0 in grub, /dev/hdh1 in Linux) and Linux using the rest of the disk.
/dev/hdh2 - boot partition (that's the interesting partition for grub - hd0,1)
/dev/hdh3 - swap partition
/dev/hdh5 - root partition (that's the interesting partition for Linux)

Then make a symbolic link from your grub.conf to menu.lst (ln -s /boot/grub/grub.conf /boot/grub/menu.lst).

Next start grub on the command line.
On its shell enter the following commands:
Code:
root (hd0,1)
setup (hd0)
quit


Reboot your system and you should get the fancy boot loader screen... ;-)

Hope that helps!

Bye,
Dan
Back to top
View user's profile Send private message
Negated Void
l33t
l33t


Joined: 25 Dec 2002
Posts: 659

PostPosted: Wed Dec 25, 2002 11:43 pm    Post subject: Thanks Reply with quote

Hey, thanks for the advice :)

It works great for the 'Gentoo Linux' option, but if I select windows XP, then it gets as far as displaying 'chainloader +1' and the cursor just sits there, flashing.

I think this is because the MBR of the drive use to contain the bootloader from XP and now dosn't, resulting in XP not working right. Maybe i need to copy that XP loader onto the start of the partition, not the MBR? It says i could install GRUB to a partition in the install guide - something similar.

Thanks very, very much!
-Matt

PS - I notice your syntax for grub differs from the Install Guide's - Just preference? (like the install guide uses a bunch of '=' signs.)
Back to top
View user's profile Send private message
Negated Void
l33t
l33t


Joined: 25 Dec 2002
Posts: 659

PostPosted: Wed Dec 25, 2002 11:55 pm    Post subject: More Details Reply with quote

After some reading of the boards, it seems this is caused by windows' inability to boot in certain combinations? There might be a fix with (map) but i don't know if it's right.

More details:
Two hard drives, hd0 & hd1.
Hd0 has one partition - Data, fat32
hd1 has a couple - 0 being Windows, 1 being extended, 2 being my linux boot (ext2) and 3 being my linux root (reiserfs)

(all in grub numerating)

Thanks again for your help!
-Matt
Back to top
View user's profile Send private message
Privateer
n00b
n00b


Joined: 19 Dec 2002
Posts: 9
Location: Vienna, Austria

PostPosted: Thu Dec 26, 2002 11:23 am    Post subject: Reply with quote

Hi!

As far as I know Windows expects its boot partition (it's a bit confusing -> in the world of Windows the terms "boot partition" and "root partition" are used wrongly, on the root partition there's the boot loader and the system partition is known as boot partition) to be the first partition on the first hard disk. Maybe that's your problem... (Windows on your second disk).

With grub there's the possibility to "hide" partitions and "map" disks.
I used the first one mainly when I installed several Windows versions with dualboot (so that every Windows thought it's residing on the "C:" drive).
The second one I never tried, 'cause I always had just one hard disk. Its purpose is to "swap" hard disks -> so maybe using this feature fixes your problem.

Another thing that came to my mind is the "makeactive" function in grub.

Try this:
Code:
title Windows XP Professional
rootnoverify (hd1,0)
makeactive
chainloader +1


There's a good chance that the only problem is that Windows' boot partition is not active!

Good luck!
Dan
Back to top
View user's profile Send private message
flying_monkey
n00b
n00b


Joined: 22 Jul 2002
Posts: 33
Location: New Jersey

PostPosted: Thu Dec 26, 2002 3:11 pm    Post subject: Reply with quote

Matt,

OK, now I'm no expert on this, but in general, here's the way you have to install to get Linux to coexist with XP. First, from Win 2000 on, including XP, it has to be booted from its own bootloader. If you want to run Linux, you install grub to the first block of the linux partition. In the case of your system
.0 (except he refers to /dev/hdh when I think he means /dev/hda), the grub session would have
Code:
root (hd1,4)
setup (hd1,4)
quit

When you've done that, make a grub.conf file which contains only the gentoo stanza, something like:

Code:
default 0
timeout 10
splashimage (hd1,4)/grub/splash.xpm.gz

title Gentoo Linux
root (hd1,4)
kernel /vmlinuz root=/dev/hda6 ro hdd=scsi

This assumes you have a CDRW, leave off the hdc=scsi if not, or edit as appropriate

Next you have to do something like this to get the boot block to XP (and this is where my memory starts to get shaky):

Put a dos formatted floppy in the drive, and dump your grub boot block to it:

Code:
dd if=/dev/hdb5 of=/dev/fd0 bs=512


You then boot into XP and copy the file on the floppy into the root directory of drive C as something like, for example, bootsect.Gentoo (memory a little shaky about this step, too. I had all this written down, but can't find the yellow sticky with the directions, so I'm going from memory, plus what I can see in my Win2000 root directory.)

Code:
copy a: c:\bootsect.Gentoo


Then you edit the file boot.ini, which you will find in the root of C: and add this line at the end of the file:

Code:
C:\bootsect.Gentoo="Gentoo Linux" 


There can be no spaces except inside the quotes, and in there is the text of the choice you will be presented at boot, it can be anything you want.

Then when you next boot up, you'll be presented by XP with a choice to boot either XP or "Gentoo Linux."

I think this is the only way to make Linux and Windows 2000 or XP play nicely together.

Good luck,
Ed
_________________
"Pay no attention to that man behind the curtain!"
Back to top
View user's profile Send private message
Negated Void
l33t
l33t


Joined: 25 Dec 2002
Posts: 659

PostPosted: Thu Dec 26, 2002 4:12 pm    Post subject: more info! Reply with quote

Thanks for the help, Privateer, but it still gave the same results as before.

Flying Monkey's solution looks promising, so i'm gonna give it a shot.

Thanks sooo much guys!
-Matt
Back to top
View user's profile Send private message
Negated Void
l33t
l33t


Joined: 25 Dec 2002
Posts: 659

PostPosted: Thu Dec 26, 2002 6:13 pm    Post subject: woe Reply with quote

Hello!

Sorry for the slow updates, i've been horrendisly sick, and only rarely have the strength to sit up and work on this.

I'm getting errors with the 'DD' line - theres not enough space on the floppy disc apparently?

Would it be possible to just copy it right onto my windows drive, or would that overright everything?

Thanks!
-Matt
PS - i'll try other discs too - i didn't think of that till now.
Back to top
View user's profile Send private message
Privateer
n00b
n00b


Joined: 19 Dec 2002
Posts: 9
Location: Vienna, Austria

PostPosted: Thu Dec 26, 2002 7:36 pm    Post subject: Reply with quote

Hi Matt!

Never tried to use the Windows bootloader in conjunction to grub. Give it a try...
The only thing I definitely know is that Windows 2000 and XP don't need their own bootloader. At my office (where I need Windows :-/ ) I had Windows 98, Windows 2000, Windows XP (all three of them thinking their primary partition was C: ) and Linux all together on one disk, each started with the help of grub.

The way Ed mentioned sounds reasonable, so both of them should work... Your idea to try it with different disks is surely worth thinking of, though.

Bye,
Dan
Back to top
View user's profile Send private message
BlackBart
Apprentice
Apprentice


Joined: 07 Oct 2002
Posts: 252

PostPosted: Thu Dec 26, 2002 7:51 pm    Post subject: Reply with quote

what if you reinstalled the windows boot loader to the boot record of the windows partition? (maybe boot to the recovery console and run fixbr?)
Back to top
View user's profile Send private message
flying_monkey
n00b
n00b


Joined: 22 Jul 2002
Posts: 33
Location: New Jersey

PostPosted: Thu Dec 26, 2002 9:01 pm    Post subject: Reply with quote

Matt,

I think your problem here is relying on my memory. I know that the command is something like that, but it is only writing something like 512 bytes, so unless the disk was already full, that aint the problem. The guy who showed me how to do it will be in MOnday, and I'll corrrect the post then.

Sorry,
Ed
_________________
"Pay no attention to that man behind the curtain!"
Back to top
View user's profile Send private message
plate
Bodhisattva
Bodhisattva


Joined: 25 Jul 2002
Posts: 1663
Location: Berlin

PostPosted: Thu Dec 26, 2002 10:25 pm    Post subject: Reply with quote

Allow me to refresh your memory. :P
Back to top
View user's profile Send private message
flying_monkey
n00b
n00b


Joined: 22 Jul 2002
Posts: 33
Location: New Jersey

PostPosted: Fri Dec 27, 2002 1:24 am    Post subject: Reply with quote

Thank you, Plate, that was exactly what I was looking for. I had it almost right.

Edited commands to do what Matt is trying to do:

Install grub boot record as before. Then copy it to a file as follows:
Code:
dd if=/dev/hdb4 of=/tmp/bootsect.Gentoo bs=512 count=1

Now mount a dos-formatted floppy and copy it there:
Code:
mount /dev/fd0 /mnt/floppy
cp /tmp/bootsect.Gentoo /mnt/fd0
umount /mnt/floppy


Now boot into XP and follow the previous instructions to copy in the file to C:\ and add the line to the file C:\boot.ini, and you should be in business. It probably is not necessary to go through the menus that Plate specified, just edit the file C:\boot.ini with Notepad or something to add the line.

Good luck,
Ed
_________________
"Pay no attention to that man behind the curtain!"
Back to top
View user's profile Send private message
Negated Void
l33t
l33t


Joined: 25 Dec 2002
Posts: 659

PostPosted: Fri Dec 27, 2002 3:18 pm    Post subject: Hey Reply with quote

Well - I tried everything, Have a file c:\bootsect.Gentoo weighing in at 512 bytes, and a Gentoo Linux boot option.

But it just reboots if i select it.

Maybe i did the Grubbing wrong - Do i root & setup to my Boot partition or my root partition? (i did boot)

*sigh* keep trying :)
-matt[/quote]
Back to top
View user's profile Send private message
flying_monkey
n00b
n00b


Joined: 22 Jul 2002
Posts: 33
Location: New Jersey

PostPosted: Fri Dec 27, 2002 4:11 pm    Post subject: Reply with quote

Matt,

I find that "But it just reboots if i select it." part strange. I guess to figure this out, we really need to know what your partitions look like. How about do the following:

Under Linux, even your chrooted version, enter
Code:
fdisk /dev/hdb

Enter p at the prompt, and copy what it says there, the q to quit. Put that data into a post, and annotate exactly what you intend to be in what partitions. If it is of any importance, you could also do the same for /dev/hda. When we have that data, I can put the exact commands into the sequence I gave you earlier. Seems like we're pretty close to working, but my guess is that one of the partitions is wrong in one of my commands. It may be that the setup command put the grub bootloader into a partition that isn't the same as the one from which bootsect.Gentoo was generated.

Ed
_________________
"Pay no attention to that man behind the curtain!"
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
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