Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Error 15
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
CoiledGentoo
n00b
n00b


Joined: 21 Dec 2003
Posts: 26
Location: Sioux City, IA

PostPosted: Tue Dec 30, 2003 9:35 pm    Post subject: Reply with quote

Thats interesting everything semms to be gone completely oh well good excuse to start fresh.
_________________
Athlon Xp 1800+
384MB RAM
EPoX 8RDA
Aureal Vortex 2
Back to top
View user's profile Send private message
lukekendall
n00b
n00b


Joined: 23 Dec 2003
Posts: 57
Location: Sydney, Australia

PostPosted: Wed Dec 31, 2003 1:22 am    Post subject: Reply with quote

FreeFly42 wrote:
Here's mine:
Code:
timeout 5
default 0
splashimage=(hd0,5)/boot/grub/splash.xpm.gz
fallback 1
password --md5 <lots of md5 text here...>

title Gentoo (2.6.0)
    root (hd0,5)
    kernel (hd0,5)/boot/kernel-2.6.0-gentoo root=/dev/hda10 vga=0x317 video=vesa:mtrr,ywrap
    initrd (hd0,5)/initrd.1024


[...]

title Slackware (2.4.20)
    root (hd0,5)
    kernel (hd0,5)/boot/vmlinuz-ide-2.4.20 root=/dev/hda7 vga=0x317 video=vesa:mtrr,ywrap

title Windows XP
    password --md5 <more md5 text here...>
    root (hd0,0)
    chainloader (hd0,0)+1


It will work without the password lines (I've ommited the md5 encrypted passwords just to be safe)


How does the root=/dev/hd... compare to the root (hd0,5)?
I note that (hd0,5) would be /dev/hda6, so what does the root= line mean
for all these other partitions? Is it where the kernel image is, and the
primary root line is where the MBR is?
_________________
luke
Back to top
View user's profile Send private message
Morbickai
n00b
n00b


Joined: 04 Sep 2003
Posts: 33

PostPosted: Wed Dec 31, 2003 1:42 am    Post subject: Reply with quote

grub is a pain in the arse untill you understand a couple of things...first:

root (hd0,0) = your BOOT partition not your root partition.
thus if your kernel is in /boot/kernel-##.##.#-## then the grub.conf line should look something like this

kernel (hd1,0)/kernel-2.4.20 root=/dev/hdb4

and NOT like this

kernel (hd1,0)/boot/kernel-2.4.20 root=/dev/hdb4

(the only reason the splash image usually works is that there is a link in the /boot partion of /boot/boot that points back to the /boot partion)

also root= should aslo point to your /boot partition.

a little more FYI, the /boot partion is alway umounted after bootup by default, if you want to play around in there you will have to remount it manually.
Back to top
View user's profile Send private message
Morbickai
n00b
n00b


Joined: 04 Sep 2003
Posts: 33

PostPosted: Wed Dec 31, 2003 1:47 am    Post subject: Reply with quote

what i wouldnt do for an edit button ...

any mention of root (hd0,0) should of been root (hd1,0) to make the example correct.

pretty much once you say root (hd#,#), you can then use (hd#,#) whenever you would normally see /boot
Back to top
View user's profile Send private message
FreeFly42
l33t
l33t


Joined: 03 Nov 2003
Posts: 848
Location: Houston, TX

PostPosted: Wed Dec 31, 2003 1:54 am    Post subject: Reply with quote

lukekendall wrote:
How does the root=/dev/hd... compare to the root (hd0,5)?

I note that (hd0,5) would be /dev/hda6, so what does the root= line mean
for all these other partitions? Is it where the kernel image is, and the
primary root line is where the MBR is?

root (hd0,5) is a command to tell grub to mount (hd0,5) and use it as the root for any subsequent commands.
Thus
Code:
root (hd0,5)
kernel /kernel-bzImage root=/dev/hda7 otherKernelOption=FooBar

Tells grub to mount (hd0,5) as the / dir for subsequent GRUB commands (not for the Linux kernel, only for GRUB)
The kernel command tells GRUB to look in the previously mounted root partition for a file called kernel-bzImage and load it as the kernel. Anything subsequent on this line is not processed by GRUB, but is simply handed to the kernel as an argument. Thus the root=/dev/hda7 is a signal to tell the Linux kernel what partition to use as the linux root directory (/), which is why it uses the linux convention (hda7) rather than the Grub convention (hd0,6). The otherKernelOption=FooBar would also get passed as an argument to the kernel, but of course the kernel wouldn't know what to do with this ficticious argument, and would spit out an error message and drive on.

So what partition do you need to have the Grub "root" command load? It needs to be the partition you set as root when you installed grub, and should be the same partition where the kernel images are stored. In other words, your /boot partition. Grub will look in the boot sectors for this partition for the stage 1.5 and stage 2 files and the grub.conf file. Grub will look for these files in the /boot/grub/ directory of the Grub root partition (usually the /boot partition). This is why there is a symlink in the boot directory called "boot" pointing right back at the boot directory. So if you don't want a separate /boot partition (like cato), Grub will still look in /boot/grub/grub.conf, which works because of the actual /boot folder. If you have a separate boot partition, Grub will look in /boot/grub/grub.conf, which works because of the symlink.

So the short answer to which partition should be the GRUB root? The partition containing the boot/grub/ folder. This is usually not the same partition as the Linux root partition. (whew)
_________________
Kent

Planes are dangerous, get out of 'em quick
Back to top
View user's profile Send private message
FreeFly42
l33t
l33t


Joined: 03 Nov 2003
Posts: 848
Location: Houston, TX

PostPosted: Wed Dec 31, 2003 2:05 am    Post subject: Reply with quote

Morbickai wrote:
the grub.conf line should look something like this
kernel (hd1,0)/kernel-2.4.20 root=/dev/hdb4
and NOT like this
kernel (hd1,0)/boot/kernel-2.4.20 root=/dev/hdb4

Um, actually it doesn't matter. (I explain again) there is a symlink in your boot folder pointing to ".", which means (hd1,0)/boot/kernel and (hd1,0)/kernel actually will both work, and acually refer to the same file. In fact it is probably better to use (hd1,0)/boot/kernel because this will work whether you have a separate /boot partition or not. If you wanted you could use (hd1,0)/boot/boot/boot/boot/boot/kernel though you would lose some style points. :wink:

Morbickai wrote:
what i wouldnt do for an edit button ...

Look in the upper right corner of any post you have made and (guess what!!) and edit button! There's also a delete button if no one has responded to your post, you can take it back before too many people notice!!
It's in the same spot as you see the "quote" button on other peoples' posts.
_________________
Kent

Planes are dangerous, get out of 'em quick
Back to top
View user's profile Send private message
Morbickai
n00b
n00b


Joined: 04 Sep 2003
Posts: 33

PostPosted: Wed Dec 31, 2003 2:31 am    Post subject: Reply with quote

didnt see the edit button....i must be gettin old. and yea i knew about the sym link. but for some reason i have seen some installs that dont have it. i think the developers put it there just because of all the confusion that grub produces. sometimes i think developers make there progs so confusing for job security.
Back to top
View user's profile Send private message
CoiledGentoo
n00b
n00b


Joined: 21 Dec 2003
Posts: 26
Location: Sioux City, IA

PostPosted: Wed Dec 31, 2003 3:24 am    Post subject: Reply with quote

Going to make the grub config now here is some info i gleaned from the install.

gaming-sources-2.4.20-r3
linux-2.4.20-gaming-r3

/boot/kernel-2.4.20-gaming-r3
/boot/initrd-2.4.20-gaming-r3


Will check back in about 5 minutes, before i make the file.
_________________
Athlon Xp 1800+
384MB RAM
EPoX 8RDA
Aureal Vortex 2
Back to top
View user's profile Send private message
CoiledGentoo
n00b
n00b


Joined: 21 Dec 2003
Posts: 26
Location: Sioux City, IA

PostPosted: Wed Dec 31, 2003 3:40 am    Post subject: Reply with quote

Well here goes. :)
_________________
Athlon Xp 1800+
384MB RAM
EPoX 8RDA
Aureal Vortex 2
Back to top
View user's profile Send private message
CoiledGentoo
n00b
n00b


Joined: 21 Dec 2003
Posts: 26
Location: Sioux City, IA

PostPosted: Wed Dec 31, 2003 3:55 am    Post subject: Reply with quote

:D :D :D WOOOOOOOOOOOOOHOOOOOOOOOOOO
It lives yes. Thanks for all the help guys you are the best. Now all i have to do is install kde.

Edit: got it up and running... sort of so i booted up to a command prompt and promptly emerged kde without knowing i had to have xfree installed not to mention xfree wont even emerge oh well at least i got this far.

oh and how do you reboot? :oops:


Edit 2: Well goodnight i have a really bad headache so i really wouldnt accomplish much anyway will check back in the morning.. :wink:
_________________
Athlon Xp 1800+
384MB RAM
EPoX 8RDA
Aureal Vortex 2
Back to top
View user's profile Send private message
FreeFly42
l33t
l33t


Joined: 03 Nov 2003
Posts: 848
Location: Houston, TX

PostPosted: Wed Dec 31, 2003 5:17 am    Post subject: Reply with quote

CoiledGentoo wrote:
:D :D :D WOOOOOOOOOOOOOHOOOOOOOOOOOO

Man, that is a sweet feeling! Now you know one of the reasons Gentoo is soooo addictive: like any mountain climber it isn't really the view at the top (there are plenty of mountains with roads) it's the climb. 8)

To reboot (as root):
shutdown -r now

To shutdown (also as root):
shutdown -h now

Also you can use (as root):
init 0 (shutdown)
init 6 (reboot)
_________________
Kent

Planes are dangerous, get out of 'em quick
Back to top
View user's profile Send private message
lukekendall
n00b
n00b


Joined: 23 Dec 2003
Posts: 57
Location: Sydney, Australia

PostPosted: Wed Dec 31, 2003 7:55 am    Post subject: Reply with quote

CoiledGentoo wrote:
:D :D :D WOOOOOOOOOOOOOHOOOOOOOOOOOO
It lives yes. Thanks for all the help guys you are the best. Now all i have to do is install kde.

Edit: got it up and running... sort of so i booted up to a command prompt and promptly emerged kde without knowing i had to have xfree installed not to mention xfree wont even emerge oh well at least i got this far.

oh and how do you reboot? :oops:


Edit 2: Well goodnight i have a really bad headache so i really wouldnt accomplish much anyway will check back in the morning.. :wink:


Well done!

Though xfree should have emerged, unless you had both xfree and pam in your list of modules
in your USE variable.

If that's your problem one of the forum posters gave this workaround which
I can confirm works:

Code:

USE="-pam" emerge xfree
emerge system
emerge xfree

_________________
luke
Back to top
View user's profile Send private message
lukekendall
n00b
n00b


Joined: 23 Dec 2003
Posts: 57
Location: Sydney, Australia

PostPosted: Wed Dec 31, 2003 9:22 am    Post subject: Reply with quote

FreeFly42 wrote:
lukekendall wrote:
How does the root=/dev/hd... compare to the root (hd0,5)?

I note that (hd0,5) would be /dev/hda6, so what does the root= line mean
for all these other partitions? Is it where the kernel image is, and the
primary root line is where the MBR is?

root (hd0,5) is a command to tell grub to mount (hd0,5) and use it as the root for any subsequent commands.
Thus
Code:
root (hd0,5)
kernel /kernel-bzImage root=/dev/hda7 otherKernelOption=FooBar

Tells grub to mount (hd0,5) as the / dir for subsequent GRUB commands (not for the Linux kernel, only for GRUB)
The kernel command tells GRUB to look in the previously mounted root partition for a file called kernel-bzImage and load it as the kernel. Anything subsequent on this line is not processed by GRUB, but is simply handed to the kernel as an argument. Thus the root=/dev/hda7 is a signal to tell the Linux kernel what partition to use as the linux root directory (/), which is why it uses the linux convention (hda7) rather than the Grub convention (hd0,6). The otherKernelOption=FooBar would also get passed as an argument to the kernel, but of course the kernel wouldn't know what to do with this ficticious argument, and would spit out an error message and drive on.

So what partition do you need to have the Grub "root" command load? It needs to be the partition you set as root when you installed grub, and should be the same partition where the kernel images are stored. In other words, your /boot partition. Grub will look in the boot sectors for this partition for the stage 1.5 and stage 2 files and the grub.conf file. Grub will look for these files in the /boot/grub/ directory of the Grub root partition (usually the /boot partition). This is why there is a symlink in the boot directory called "boot" pointing right back at the boot directory. So if you don't want a separate /boot partition (like cato), Grub will still look in /boot/grub/grub.conf, which works because of the actual /boot folder. If you have a separate boot partition, Grub will look in /boot/grub/grub.conf, which works because of the symlink.

So the short answer to which partition should be the GRUB root? The partition containing the boot/grub/ folder. This is usually not the same partition as the Linux root partition. (whew)


Thanks, your post was very informative. That means what I tried to do was unusual and perhaps complicated, which is why I failed and gave up. (Well, that and the rumour that grub didn't support RAID by default.)

I want my various red hat kernels on /dev/md0 (RH root), and my various gentoo kernels on /dev/hdb2 (gentoo root). My MBR is on /dev/md0 (/dev/hda6 and hde6). You wrote:

FreeFly42 wrote:

So what partition do you need to have the Grub "root" command load? It needs to be the partition you set as root when you installed grub, and should be the same partition where the kernel images are stored. In other words, your /boot partition.


But I have kernel images in two different partitions (each kernel matching the /lib/modules-##.## for the kernel). Lilo handles that quite naturally. (I don't have a separate /boot partition: without the /lib/modules... build products that correspond to a kernel, it won't be bootable, so why restrict the space available for kernels? It probably makes more sense if you don't build many kernels.)

When you said "the partition you set as root", are you using the word "root" in the same sense asyou use it elsewhere? Installing it is a one-off thing, whereas every bootable image in the grub config file seems to have a "root (hdX,Y)" line, from the examples I've seen. And they're usually the same partition repeated each time (which seems strangely redundant).

Another thing that confuses me about grub is in the gentoo installation instructions for configuring grub (written assuming that the boot partition is on /dev/hda1). It says "setup (hd0)" would install grub in the MBR. Isn't the MBR "address" a partition? I would have thought you'd need to enter "setup (hd0,0)", or in my case, "setup (hd0,5)" and "setup (hd4,5)" since I'm using raid mirroring.

But the key thing I understood is that the grub "root (hdX,Y)" is basically like saying "mount /dev/hdAN /" (except that you can only mount a single partition, to "/"), and that the "root=/dev/hdAN" line is just a Linux kernel boot option.

If I understand correctly, the grub root command must be optional. If you always reference files with (hdX,Y)/pathname, there's no need to issue a "root (hdX,y)"?

But the /boot/grub directory MUST be in the same partition as the MBR?

I think I'm quite happy to stay with lilo - it seems so much simpler!
_________________
luke
Back to top
View user's profile Send private message
FreeFly42
l33t
l33t


Joined: 03 Nov 2003
Posts: 848
Location: Houston, TX

PostPosted: Wed Dec 31, 2003 6:45 pm    Post subject: Reply with quote

Troworld, sorry for the confusion. Let me explain a bit about how your computer boots and what the MBR is. When your computer first powers on, the BIOS (Basic Input Output System) has some software (well firmware really) which is the first thing your cpu executes. This software will load drivers for anything your computer can boot from--IDE drives, floppy disks, possibly SCSI drives and CDROMs. It will also load a driver for your keyboard so you can interact with the BIOS. It doesn't know anything about your operating system or hard drive partitioning or filesystems. Every drive has a special area in the first few sectors known as the boot sectors. The BIOS looks sequentially through the boot sectors of all the drives it has access to until it finds one that has bootable code in its boot sector. There is only one boot sector on a hard drive and it is known as the MBR or Master Boot Record for the drive. This MBR also contains the partition table. So the BIOS looks in the MBR for a boot loader, and if it finds one it launches it. If it doesn't find one it continues to the next drive. When you call "setup (hd0)" one of the things GRUB will do is install itself as the bootloader in the MBR of (hd0). Now, unlike the BIOS Grub does need to know information on the filesystems and paritioning since it needs to load your Linux kernel. However, there are a great deal of filesystem types that GRUB can deal with and it won't have enough room in the MBR to store the information on how to access all these partitions. So grub works in stages. Stage 1 is a generic boot loader which is launched by the BIOS and whose job is to load a filesystem-specific stage 1.5. The filesystem-specific stage 1.5 mounts the grub root partition (for grub) and looks in that partition for a stage 2 (which once again is generic) whose job it is to read the /boot/grub/grub.conf file, interpret it, display the boot menu, and ultimately load the kernel.

In addition to the MBR (which isn't on any partition, it's on the drive), each partition contains some reserved sectors known as the root sectors, or boot record for that partition. Some people mistakenly call this the partition MBR, but the MBR specifically refers to the root sectors of the drive. The filesystem specific stage 1.5 is stored in this sector of the grub root partiton. When you "chain load" another operating system with Grub (or use the "other" command with LILO) it will look in the root sectors of the specified partition and load the boot loader in that partition. That's how both Grub and LILO boot Windows.

So, when you set up Grub, you need to specify a root partition for Grub so it will know which stage 1.5 to install and it will know where to look for the stage 2 file, the grub.conf file, and other filesystem-specific stage files. This partition doesn't need to store the kernel images, but it's a convenient and logical place to do so.

As I said above:
freefly42 wrote:
So the short answer to which partition should be the GRUB root? The partition containing the boot/grub/ folder. This is usually not the same partition as the Linux root partition.


Now, you want to keep your kernel files in a different partition than your grub root partition that is fine. Just pick one of your root partitions to be the grub root. Grub will load it's stage 1.5 files and the grub.conf in the /boot/grub folder of that partition. Suppose that partition is hda1. Then your installation sequence should be:
Code:
grub> root (hd0,0)
grub> install (hd0)

The first line tells grub which partition to look for the stage 1.5 files and grub.conf. The second line tells grub to install itself as the primary bootloader in the MBR of drive hda.
Suppose (just for comparison) you made the mistake of using the following installation sequence:
Code:
grub> root (hd0,0)
grub> install (hd0,0)

In this case grub would use the same root partition, but would leave the MBR untouched. In order to boot, you'd have to have some other boot loader (possibly Windows) installed in the MBR and that boot loader would have to chain load grub. This is probably why you wound up with a grub installation that wouldn't boot anything. You could actually have lilo chain load grub this way! (But why?)
Now suppose you have a different kernel on hda3 but (possibly) using the same linux root (hda1). Your grub.conf might look like:
Code:
title Gentoo 2.4.22
    root (hd0,0)
    kernel /lib/modules/2.4.22-gentoo-r2/kernel-2.4.22-gentoo-r2 root=/dev/hda1

title Gentoo 2.6.0
    root (hd0,0)
    kernel (hd0,2)/lib/modules/2.6.0-gentoo/kernel-2.6.0-gentoo root=/dev/hda1

title Slackware 9.1
    root (hd0,0)
    kernel (hd0,4)/boot/vmLinuz root=/dev/hda5

title Windows
    map (hd1,0) (hd0,0)
    map (hd0,0) (hd1,0)
    map (hd1,1) (hd0,1)
    map (hd0,1) (hd1,1)
    rootnoverify (hd0,0)
    chainloader +1


In fact, one of the reasons that many people use a separate /boot partition is that they can put kernels there for several distros, have grub load them and load the correct linux / partition for each distro, and not need to have the /boot partition mounted in any of the distros.

In the /boot partition of my primary working computer (my laptop) I have 3 different gentoo kernels and 2 slackware kernels, which I really should just delete since I never boot it anymore...

The Windows section of this grub.conf demonstrates how to boot windows from the second hard drive while fooling Windows into thinking it is booting from the primary hard drive. It's been a few years since I had to set up a configuration like this, and I don't have access at the moment to any of my systems which are running like this, so I may have the last root command wrong. I can't remember whether it uses the pre-mapping or post-mapping references. If you are interested, I will have access to one of these systems later in the week and I can look for you.

BTW, each of my gentoo kernels has it's own /lib/modules folder. They don't have to be on different partitions. Back in my RedHat days I rarely upgraded my kernel since I had so many patches in place (man do I love portage), but I had several different versions of the same original kernel source with varying levels of patches. You have to edit /usr/src/linux/include/linux/version.h to modify the kernel version definition, but that way I had separate /lib/module directories for different patch levels of the same base kernel. With Gentoo I just keep an old revision level as my backup kernel, so I don't have to edit version.h anymore, which I also like.

Another little question you implied is why is this so much more complicated than LILO? Well, it isn't really, but with LILO you don't need a root partition because it hard-codes the configuration in the root sector. So gain some simplicity of not having to have a folder somewhere for your bootloader to grab configuration files from, but you lose the flexibility of modifying that configuration at boot time. Like all things OS you have the choice. I think you can handle having a grub root partition, though, it's really not that difficult!
_________________
Kent

Planes are dangerous, get out of 'em quick
Back to top
View user's profile Send private message
CoiledGentoo
n00b
n00b


Joined: 21 Dec 2003
Posts: 26
Location: Sioux City, IA

PostPosted: Thu Jan 01, 2004 5:07 am    Post subject: Reply with quote

Ok hmm im confused what do i do now. Linux boots up to a command prompt but after that... i dont know what to do.
_________________
Athlon Xp 1800+
384MB RAM
EPoX 8RDA
Aureal Vortex 2
Back to top
View user's profile Send private message
lukekendall
n00b
n00b


Joined: 23 Dec 2003
Posts: 57
Location: Sydney, Australia

PostPosted: Thu Jan 01, 2004 5:50 am    Post subject: Reply with quote

CoiledGentoo wrote:
Ok hmm im confused what do i do now. Linux boots up to a command prompt but after that... i dont know what to do.

Linux has lots of different command processors - what exactly do you mean by a command prompt? A login prompt? A shell prompt? What stage in the gentoo installtion guide are you up to - have you completed all the steps there?
_________________
luke
Back to top
View user's profile Send private message
FreeFly42
l33t
l33t


Joined: 03 Nov 2003
Posts: 848
Location: Houston, TX

PostPosted: Thu Jan 01, 2004 5:55 am    Post subject: Reply with quote

CoiledGentoo wrote:
Ok hmm im confused what do i do now. Linux boots up to a command prompt but after that... i dont know what to do.

Did you finish emerging kde? Look at the desktop configuration guide for information on how to transition to a working destkop box.
_________________
Kent

Planes are dangerous, get out of 'em quick
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
Goto page Previous  1, 2
Page 2 of 2

 
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