-   Linux - General (
-   -   need a little info on setting up grub (

jonny bravo 07-13-2005 11:16 AM

need a little info on setting up grub
I am very close to finishing a dual boot windows xp (fat32) and Gentoo stage1 install.
I have 2 hard drive's a 5 gig /dev/hda being windows, and the second a 160 gig set up for Gentoo as follows /dev/hdb1 boot , /dev/hdb2 swap , and /dev/hdb3 root. I would like to overwrite the mbr for grub to boot windows or Gentoo, do I still follow the grub setup as
grub > root (hd0,0)
grub > setup (hd0)
grub > quit

and my configuration as-
default 0
timeout 30


title=Gentoo Linux 2.6.12-r4

root (hd1,0)
kernel /kernel-2.6.12-gentoo-r4 root=/dev/hda3

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

Hopefully I've got this right any help with this or advice would really be apreciated, as I'm very close to setting up grub just waiting on a few last emerges. thanks!!!!

bigrigdriver 07-13-2005 07:56 PM

Your proposed grub setup won't work. There are several reasons why.

Start with the basics. Grub numbers disks and partitions starting with 0.
hda = 0
hdb = 1
first partition = 0
second partition = 1
third partition = 2

Now. You have Linux root in /dev/hdb3 (grub numbers: hd1,2), and windows in /dev/hda1 (grub numbers: hd0,0); Linux boot in /dev/hdb1 (grub numbers: hd1,0).

grub > root (hd0,0)
grub > setup (hd0)
grub > quit

This won't work because, after grub is installed and you try to boot, grub will look into the windows partition for the grub stages and menu. Change root (hd0,0) to root (hd1,2) to point to the Linux root.

Setup (hd0) is correct if you want grub to write to the MBR and be the bootloader for Linux and windows. The reason for leaving setup at hd0 is that the first hard disk is the master; the second is the slave. The MBR of the master is the one that will be in charge at boot time. Telling grub that the root of the Linux partition is (hd1,2) tell grub where the root of the Linux filesystem is located. Telling grub where to /boot directory is (in the kernel line) tells grub where to find the kernel image to boot.

Splashimage (hd0,0) won't work; the splashimage should be (hd1,2).

The rest seems OK. However, you may have to edit the Linux kernel line to get it to work. Something like: kernel (hd1,0)/kernel-2.6.12-gentoo-r4 (to point grub to the kernel image in /boot).

jonny bravo 07-13-2005 08:32 PM

Thanks!!!! Ive never setup a dual boot with Linux when I first started learning I took that leap of faith without a dual boot and just ran Linux, but have since found there are a few programs that I need in Windows that wine does'nt support. Setting up grub on a dual boot on two drives is new.

syg00 07-13-2005 08:39 PM

Close bigrigdriver - Gentoo generally uses /boot for grub, not the root.
jonny bravo change all (hd1,2)references in bigrigdrivers post to (hd1,0) and you should be right.
With the root(hd1,0), you also don't need the suggested update to the kernel line - but it also won't do any harm. However you will need to update it for the root= keyword to;


jonny bravo 07-13-2005 09:06 PM

I think I borked it I can get it to boot but no menu listing it's just booting into Gentoo by default from the timeout setting. When it comes up the screen is all obscure. I know from experiance where my login is , I login as root and
then exit and the screen resorts back to normal (legible) I think I may have corrupted something here, but it seems as if Gentoo is ok once I log back in.

bigrigdriver 07-13-2005 09:54 PM

Take another look at the kernel line. You are having graphics probs. You can add a vga= option to boot into a default graphics option.

I have this in my grub menu.lst (SuSE) but it should work for any distro using grub. vga=0x31a (that's zero x 31 a). There are other options if you want to google them up.

syg00 07-13-2005 10:53 PM

Comment out the splash line (put a # in column 1), and try "vga=normal".

All times are GMT -5. The time now is 06:53 PM.