View previous topic :: View next topic |
Author |
Message |
phillys n00b
Joined: 23 Aug 2003 Posts: 16
|
Posted: Sat Aug 23, 2003 9:12 am Post subject: GRUB bootloader configuration |
|
|
HI guys,
It's my first post here Well, I've just gotten Gentoo 1.4 for my Pentium 4 and i manage to configure everything just nice during the installation but I dont know how to configure my GRUB I dont understand what is this (hd0,0) thing So, what I did was i simple type in whatever I think is right :p well, of course, it turns out that neither one of my OS (WindowsXP and Gentoo) boot at all
So, in order to boot into Windows XP i have to reformat all my linux partitions and reinstall redhat 8 (which configurates GRUB automatically for me) and after that only i can boot into WinXP and post here looking for help :p
Okay, here's the situation right now... I have my WindowsXP partitioned as /dev/hda1 and the rest for Gentoo goes like this, /dev/hda2 for BOOT, /dev/hda3 for SWAP and /dev/hda4 for my ReiserFS partition(where Gentoo is suppose to be installed). So, what should I do to configurate this GRUB? I really dont understand about this (hd0,0) and crap like that
Please help...thanks [/b] |
|
Back to top |
|
|
phillys n00b
Joined: 23 Aug 2003 Posts: 16
|
Posted: Sat Aug 23, 2003 9:22 am Post subject: |
|
|
oh yeah.... i forgot to tell you guys that i used genkernel to automatically compile my gaming-sources kernel thanks |
|
Back to top |
|
|
Garbz Apprentice
Joined: 02 Jul 2003 Posts: 260 Location: Brisbane, Australia
|
Posted: Sat Aug 23, 2003 11:02 am Post subject: |
|
|
THe kernel sources really make no difference.
Grub uses it's own disk addressing system in the form of (hdx,y) x being the disc number and y being the partition number.
These can directly map to:
hda = hd0
hdb = hd1
hdc = hd2
hda1 = hd0,0
hda2 = hd0,1
hda3 = hd0,2
So for ur grub:
title=Windows
rootnoverify (hd0,0)
chainloader +1
title=Linux
root (hd0,1)
kernel /bzImage root=/dev/hda4 vga=791
simple as that. Unless u have aditional controller cards _________________ Every begining is another begining's end. |
|
Back to top |
|
|
phillys n00b
Joined: 23 Aug 2003 Posts: 16
|
Posted: Sat Aug 23, 2003 12:54 pm Post subject: |
|
|
okay...thanks a lot in my situation, the below would work, right?
Code: | default 0
timeout 30
splashimage=(hd0,1)/boot/grub/splash.xpm.gz
# If you're using genkernel, use something like this instead:
title=Gentoo Linux (genkernel)
root (hd0,1)
kernel (hd0,1)/boot/kernel-gaming-sources root=/dev/hda4
initrd (hd0,1)/boot/initrd-gaming-sources
# Below needed only for people who dual-boot
title=Windows XP
root (hd0,0)
chainloader (hd0,0)+1
|
|
|
Back to top |
|
|
Papapishu Tux's lil' helper
Joined: 18 Mar 2003 Posts: 129 Location: ((void*)NULL)
|
Posted: Sat Aug 23, 2003 2:58 pm Post subject: |
|
|
I don't ise initrd myself, so I don't really know what it does.
If /boot/kernel-gaming-sources is your kernel, then it looks right to me.
Add the vga=791 for better graphics _________________ #359074 |
|
Back to top |
|
|
x20vmk4x n00b
Joined: 23 Aug 2003 Posts: 40
|
Posted: Sat Aug 23, 2003 3:03 pm Post subject: |
|
|
phillys wrote: | okay...thanks a lot in my situation, the below would work, right?
...
splashimage=(hd0,1)/boot/grub/splash.xpm.gz
...
kernel (hd0,1)/boot/kernel-gaming-sources root=/dev/hda4
initrd (hd0,1)/boot/initrd-gaming-sources
...
[/code] |
with a seperate /boot partition i dont think you need the "/boot" before your kernel stuff.
bryan |
|
Back to top |
|
|
phillys n00b
Joined: 23 Aug 2003 Posts: 16
|
Posted: Sat Aug 23, 2003 3:44 pm Post subject: |
|
|
Papapishu wrote: | I don't ise initrd myself, so I don't really know what it does.
If /boot/kernel-gaming-sources is your kernel, then it looks right to me.
Add the vga=791 for better graphics |
PAP!! *mighty humps*
err...sorry...
okay, how does it look like now? btw, wat do u mean, x20vmk4x?
Code: |
default 0
timeout 30
splashimage=(hd0,1)/boot/grub/splash.xpm.gz
# If you're using genkernel, use something like this instead:
title=Gentoo Linux (genkernel)
root (hd0,1)
kernel (hd0,1)/boot/kernel-gaming-sources root=/dev/hda4 vga=791
# Below needed only for people who dual-boot
title=Windows XP
root (hd0,0)
chainloader (hd0,0)+1
|
|
|
Back to top |
|
|
x20vmk4x n00b
Joined: 23 Aug 2003 Posts: 40
|
Posted: Sat Aug 23, 2003 3:52 pm Post subject: |
|
|
phillys wrote: |
okay, how does it look like now? btw, wat do u mean, x20vmk4x?
Code: | default 0
timeout 30
splashimage=(hd0,1)/boot/grub/splash.xpm.gz
# If you're using genkernel, use something like this instead:
title=Gentoo Linux (genkernel)
root (hd0,1)
kernel (hd0,1)/boot/kernel-gaming-sources root=/dev/hda4
initrd (hd0,1)/boot/initrd-gaming-sources
# Below needed only for people who dual-boot
title=Windows XP
root (hd0,0)
chainloader (hd0,0)+1
|
|
just take out all references to "/boot"
so it would look like this:
Code: | default 0
timeout 30
splashimage=(hd0,1)/grub/splash.xpm.gz
# If you're using genkernel, use something like this instead:
title=Gentoo Linux (genkernel)
root (hd0,1)
kernel (hd0,1)/kernel-gaming-sources root=/dev/hda4
initrd (hd0,1)/initrd-gaming-sources
# Below needed only for people who dual-boot
title=Windows XP
root (hd0,0)
chainloader (hd0,0)+1
|
test4 is almost done compiling so in a minute ill post my grub.conf
bryan[/code] |
|
Back to top |
|
|
x20vmk4x n00b
Joined: 23 Aug 2003 Posts: 40
|
Posted: Sat Aug 23, 2003 4:00 pm Post subject: |
|
|
ok here's mine:
Code: |
default 0
timeout 5
title=Gentoo 2.6.0-test3
root (hd1,2)
kernel (hd1,0)/vmlinuz-2.6.0-test3 root=/dev/hdb3 ro hdd=ide-scsi
title=Gentoo 2.6.0-test4
root (hd1,2)
kernel (hd1,0)/vmlinuz-2.6.0-test4 root=/dev/hdb3 ro hdd=ide-scsi
title=Counterstrike (WinXP)
root (hd0,0)
chainloader (hd0,0)+1
|
i havent been in windows since i started from scratch again, so i dont knwo if the windows section works.
bryan[/code] |
|
Back to top |
|
|
Papapishu Tux's lil' helper
Joined: 18 Mar 2003 Posts: 129 Location: ((void*)NULL)
|
Posted: Sat Aug 23, 2003 4:04 pm Post subject: |
|
|
x20vmk4x wrote: | phillys wrote: | okay...thanks a lot in my situation, the below would work, right?
...
splashimage=(hd0,1)/boot/grub/splash.xpm.gz
...
kernel (hd0,1)/boot/kernel-gaming-sources root=/dev/hda4
initrd (hd0,1)/boot/initrd-gaming-sources
...
[/code] |
with a seperate /boot partition i dont think you need the "/boot" before your kernel stuff.
bryan |
Doh! I missed that
If you (as the manual suggests) have a separate boot partition, it must be mounted before the /boot would have any effect.
Since it won't be, you just reffer to the partition on which it resides, and take it from there... _________________ #359074 |
|
Back to top |
|
|
Papapishu Tux's lil' helper
Joined: 18 Mar 2003 Posts: 129 Location: ((void*)NULL)
|
Posted: Sat Aug 23, 2003 4:11 pm Post subject: |
|
|
Here's mine:
Code: |
default 0
timeout 30
splashimage=(hd0,0)/grub/splash.xmp.gz
title=Gentoo
root (hd0,0)
kernel (hd0,0)/bzImage_ck root=/dev/hda5 vga=791 hdc=ide-scsi
|
I use Con Kolivas sources.
I used to have more items when I switched from Gentoo Sources...
I use vga=791 for high-resolution text mode + penguin
I use hdc=ide-scsi to tell the kernel that the IDE device on hdc is gonna ude the ide-scsi kernel module, in short, my CD-burner.
When I think about it, there's a symlink on the boot partition that reffers to itself, so it should take care of "/boot", shouldn't it?
I have a problem with Grub since a coupe of days ago.
When I boot, it doesn't show the list, but I can press enter and boot.
It works but it's annoying.
I've tried reinstalling it on the MBR, but no change. _________________ #359074 |
|
Back to top |
|
|
phillys n00b
Joined: 23 Aug 2003 Posts: 16
|
Posted: Sat Aug 23, 2003 4:16 pm Post subject: |
|
|
so, ill take all the /boot/ off, is that right? so, here's how mine is going to look like when i reinstall gentoo tomorrow or sumthing
Code: |
default 0
timeout 30
splashimage=(hd0,1)/grub/splash.xpm.gz
# If you're using genkernel, use something like this instead:
title=Gentoo Linux (genkernel)
root (hd0,1)
kernel (hd0,1)/kernel-gaming-sources root=/dev/hda4 vga=791
# Below needed only for people who dual-boot
title=Windows XP
root (hd0,0)
chainloader (hd0,0)+1
|
comments please!!! |
|
Back to top |
|
|
x20vmk4x n00b
Joined: 23 Aug 2003 Posts: 40
|
Posted: Sat Aug 23, 2003 5:20 pm Post subject: |
|
|
yea thats all correct, but i think you need the initrd line in there, too, if you used genkernel. thats what i read, IIRC.
so itll look like:
Code: |
default 0
timeout 30
splashimage=(hd0,1)/grub/splash.xpm.gz
# If you're using genkernel, use something like this instead:
title=Gentoo Linux (genkernel)
root (hd0,1)
kernel (hd0,1)/kernel-gaming-sources root=/dev/hda4
initrd (hd0,1)/initrd-gaming-sources
# Below needed only for people who dual-boot
title=Windows XP
root (hd0,0)
chainloader (hd0,0)+1
|
but since there is a symlink, i guess it would work. i always wondered why that was there |
|
Back to top |
|
|
Papapishu Tux's lil' helper
Joined: 18 Mar 2003 Posts: 129 Location: ((void*)NULL)
|
Posted: Sat Aug 23, 2003 8:08 pm Post subject: |
|
|
One could acctually type /boot/boot/boot/boot/boot/boot/boot/boot/boot/boot/boot/boot/boot/boot/boot/boot/boot/boot/boot/boot/boot/boot/boot/boot/boot/boot/boot/boot/boot/boot/boot/boot/boot/grub and it would work...
phillys: You don't need to reinstall gentoo.
Just put in the CD, log in, mount the partition, chroot as you did before, and go straight to the GRUB part of installation.
Finish the installation and you got your system
This is not Redhat, so you can resume your installation _________________ #359074 |
|
Back to top |
|
|
phillys n00b
Joined: 23 Aug 2003 Posts: 16
|
Posted: Sat Aug 23, 2003 10:39 pm Post subject: |
|
|
pap.... i tried to resume my installation before but when i try to do chroot /mnt/gentoo /bin/bash, it says something about /bin/bash was not found and not right so, i had to fricking reformat all my linux partitions with stinking redhat(:p).... there goes all my hardwork...
okay...here's the final version , i think.
Code: |
default 0
timeout 30
splashimage=(hd0,1)/grub/splash.xpm.gz
# If you're using genkernel, use something like this instead:
title=Gentoo Linux (genkernel)
root (hd0,1)
kernel (hd0,1)/kernel-gaming-sources root=/dev/hda4 vga=791
initrd (hd0,1)/initrd-gaming-sources
# Below needed only for people who dual-boot
title=Windows XP
root (hd0,0)
chainloader (hd0,0)+1
|
|
|
Back to top |
|
|
phillys n00b
Joined: 23 Aug 2003 Posts: 16
|
Posted: Sat Aug 23, 2003 10:51 pm Post subject: |
|
|
btw, why is the chainloader (hd0,0)+1 needed by GRUB? What does it mean? thanks |
|
Back to top |
|
|
Garbz Apprentice
Joined: 02 Jul 2003 Posts: 260 Location: Brisbane, Australia
|
Posted: Sun Aug 24, 2003 7:01 am Post subject: |
|
|
chainloader informs grub that what you are tying to boot does not contain a kernel directly.
The windows partiton in a way contains it's own bootloader.
I think it technically has something to do with loading the first 512k from that partition in the boot sector. _________________ Every begining is another begining's end. |
|
Back to top |
|
|
phillys n00b
Joined: 23 Aug 2003 Posts: 16
|
Posted: Sun Aug 24, 2003 12:47 pm Post subject: |
|
|
aww...man... i ran into trouble again okay, its like this, i manage to install everything gentoo spick and span and im also able to boot into windows XP with no problem at all
but the problem is, i keep getting the kernel not found error i think i got my kernel name wrongly so, is there anyway i can go back in installation to reconfigure my GRUB boot loader and also check my kernel name? and oh btw, in case any of you want to know, im using the gaming-sources kernel so, any ideas? |
|
Back to top |
|
|
x20vmk4x n00b
Joined: 23 Aug 2003 Posts: 40
|
Posted: Sun Aug 24, 2003 8:04 pm Post subject: |
|
|
just boot up the live-cd, mount ur boot partition somewhere, ls the boot directory to find out what the name of ur kernel is, then nano -w /path/to/grub.conf and correct your problem. umount the boot partition and reboot ur computer, and everythign should work. if that doesnt help, make sure u have the drive correct in ur grub.conf, as its kinda tricky . hd(0,1) is hda2, and that confused me for a while.
HTH
bryan |
|
Back to top |
|
|
phillys n00b
Joined: 23 Aug 2003 Posts: 16
|
Posted: Sun Aug 24, 2003 10:40 pm Post subject: |
|
|
xm, i just tried what u asked me to do but it didnt work okay, lemme explain my what i did here together with comments on the error...
1. boot in live-cd
2. # mount /dev/hda2 /mnt/gentoo/boot
/mnt/gentoo/boot dir not found
3. if i ls the boot dir, i would get only 3 files listed:
-grub
-boot
-lost+found
and after checking them with nano, they are all empty DARNIT! |
|
Back to top |
|
|
x20vmk4x n00b
Joined: 23 Aug 2003 Posts: 40
|
Posted: Mon Aug 25, 2003 12:23 am Post subject: |
|
|
if the dir isnt found, make it then mount again. the files listed are actually directories, so nano wont show anything, if it even opens them. sounds to me like u need to chroot to /mnt/gentoo after you mount your root partition there, then emerge a kernel, build it, and configure grub again.
er... first, did you move your bzImage and intrd to the boot dir? i dont know how genkernel works, but if it doesnt move them there automatically, move them there, and if it does, maybe you didnt have the /boot partition mounted when you ran it.
bryan |
|
Back to top |
|
|
phillys n00b
Joined: 23 Aug 2003 Posts: 16
|
Posted: Mon Aug 25, 2003 6:04 am Post subject: |
|
|
my goodness...maybe it's just me but can someone or could you explain that in a more 'simple' and easy to understand way? im too silly to understand that |
|
Back to top |
|
|
Garbz Apprentice
Joined: 02 Jul 2003 Posts: 260 Location: Brisbane, Australia
|
Posted: Mon Aug 25, 2003 9:01 am Post subject: |
|
|
hey phillys.
A translation:
try mounting /mnt/gentoo that needs to be done before /mnt/gentoo/boot is mounted.
Follow the exact same instructions for mounting and chroot as outlined in the installation guide.
i.e. mount /mnt/gentoo
mount /mnt/gentoo/boot
and mount /mnt/gentoo/proc
then chroot
after you have sucessfully chrooted into gentoo check the following:
in /boot you should have a file bzImage or gentoo-sources or something which resembles a kernel. You may also have an initrd file somewhere.
whereever they are the following needs to be in ur /boot/grub/grub.conf
root (hd0,x) (x is the number of the partition of /boot)
kernel /bzImage root=/dev/hda4 (this is the default replace bzImage with ur kernel)
initrd /initrd (if initrd is used then point to it here.)
Remeber that becuase root was pointed to the /boot partition all the kernel and initrd locatsion are now / i.e. /kernel in grub is the same as /boot/kernel after linux is acutally running.
try fiddleing around on the commandline to save you from rebooting.
after grub starts hit "c"
type "root (hd0,x)"
kernel etc.etc.etc
if ti works correctly it should say:
after root command:
"Filesystem type is ext2fs, partition type 0x83"
after kernel commmand:
"[Linux-bzImage, setup=0x1400, size=0x1275e2]" (actual values may differ)
and after initrd if needed:
"[Linux-initrd @ 0xffc2000, 0x93e bytes]" Once again values will be differnt.
If u saw all of this type "boot" and hope for the best ! _________________ Every begining is another begining's end. |
|
Back to top |
|
|
phillys n00b
Joined: 23 Aug 2003 Posts: 16
|
Posted: Mon Aug 25, 2003 9:31 am Post subject: |
|
|
Garbz, it seems like what you're telling me is for people who compile their own kernels. i used genkernel to compile my kernel if i leave everything at default without changing anything when i compile the kernel, would my grub.conf look like this?
Code: |
default 0
timeout 30
splashimage=(hd0,1)/grub/splash.xpm.gz
# If you're using genkernel, use something like this instead:
title=Gentoo Linux (genkernel)
root (hd0,1)
kernel (hd0,1) /kernel-bzImage root=/dev/hda4 vga=791
initrd (hd0,1) /initrd-bzImage
# Below needed only for people who dual-boot
title=Windows XP
root (hd0,0)
chainloader (hd0,0)+1
|
okay...now im REALLY confused |
|
Back to top |
|
|
Garbz Apprentice
Joined: 02 Jul 2003 Posts: 260 Location: Brisbane, Australia
|
Posted: Mon Aug 25, 2003 11:58 am Post subject: |
|
|
i don't use genkernel but i have tips to help you find out how to config it:
remove the "(hd0,1)" from these lines:
kernel (hd0,1) /kernel-bzImage root=/dev/hda4 vga=791
initrd (hd0,1) /initrd-bzImage
because they will automatically be assumed to be the root location thanks to the "root (hd0,1)" line.
Also that is correct IF and ONLY IF:
1. /boot is mounted on /dev/hda2
2. /boot/kernel-bzImage exists and is the correct kernel
3. /boot/initrd-bzImage exists and is the correct ramdisk.
In all theory that will work and you're final config will look like Code: |
default 0
timeout 30
splashimage=(hd0,1)/grub/splash.xpm.gz
# If you're using genkernel, use something like this instead:
title=Gentoo Linux (genkernel)
root (hd0,1)
kernel /kernel-bzImage root=/dev/hda4 vga=791
initrd /initrd-bzImage
# Below needed only for people who dual-boot
title=Windows XP
rootnoverify (hd0,0)
chainloader +1
|
Was windows xp working? If the filesystem is NTFS then rootnoverify needs to be used as (as far as i can remember) grub couldn't mount the ntfs partition. And thanks to the rootnoverify command hd0,0 does not need to be repeated.
but once again if and only if the kernel-bzImage and initrd-bzImage are located in /boot and /boot is on /dev/hda2
EDIT: An explination of grub.conf lines:
root (hd0,1) ----
this line defines the root location of where the boot files are located. Currently this is pointing to /dev/hda2 becuase of the grub naming convention. If /boot is not mounted anywhere and is rather just another directory then the root partitoin must be the actual "/" partition under linux.
kernel /kernel-bzImage root=/dev/hda4 vga=791 -----
This lines tells grub where the linux kernel is. In this case it is in (hd0,1)/kernel-bzImage, or /dev/hda2--/kernel-bzImage. If like above the boot partition is not separate than this would have to point to /boot/kernel-bzImage. The root=/dev/hda4 tells the linux kernel what partition to mount after it's initalized itself. in this case the actual root file system "/" is on /dev/hda4. vga=791 is appended to instruct the frame buffer to load in 1024x768
initrd /initrd-bzImage ------
This line tells grub where to find the "Initial RamDisk" for the linux kernel. THis is needed for instance if the root partition is reiserfs and reiserfs is not compiled into the kernel, in this case the module would be on this ram disk, but this type of disk (which can be viewed by mounting it as a minix filesystem) literally has countless uses from diskless installs, to splash screens, to encrytion utilities (which is how i use it). I have no idea how gentoo uses it as per default. It follows exactly the same conventions regardin locatio on the file system as written above for the kernel itself.
All of these commands can be typed consecutivly at the grub command followed by boot to achive the same result as this menu item would. _________________ Every begining is another begining's end. |
|
Back to top |
|
|
|
|
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
|
|