Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
grub trouble
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Duplicate Threads
View previous topic :: View next topic  
Author Message
engtech
n00b
n00b


Joined: 05 Mar 2005
Posts: 3

PostPosted: Sat Mar 05, 2005 7:48 pm    Post subject: grub trouble Reply with quote

I have just installed gentoo, on reboot I get the grub prompt. I setup grub.conf using the install guide.
Code:

default 0
timeout 30

title=Gentoo Linux 2.6.10-r6
root (hd0,0)
kernel /kernel-2.6.10-gentoo-r6 root=/dev/ram0 init=/linuxrc real_root=/dev/hda3
initrd /initrd-2.6.10-gentoo-r6

But it just gets me the grub promt...

So at the grub promt I enter
Code:
root (hd0,0)
kernel /kernel-2.6.10-gentoo-r6 root=/dev/ram0 init=/linuxrc real_root=/dev/hda3

and get error 15 file not found.

Through experimentation I arrived at this and it boots into gentoo:
Code:

grub promt>kernel (hd0,2)/boot/kernel-2.6.10-gentoo-r6 root=/dev/ram0 init=/linuxrc real_root=/dev/hda3
grub prompt>initrd (hd0,2)/boot/initrd-2.6.10-gentoo-r6
grub prompt>boot


I tried putting that into my grub.conf but that doesn't work I still get the grub prompt every time. Type it in as above and then it boots...

I have read the sticky posts on grub and they got me this far. Did I install grub in the wrong place? How can I fix this?

Regards,
engtech
Back to top
View user's profile Send private message
dusdus
Apprentice
Apprentice


Joined: 20 Jan 2005
Posts: 208
Location: Netherlands

PostPosted: Sat Mar 05, 2005 8:21 pm    Post subject: Reply with quote

Maybe its the "root (hd0,0)" part. which partition is the root? /dev/hda3? (check 'fdisk -l')
Code:

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

(check the code-listing in the handbook under 10.b)
_________________
Sorry, I don't understand...
Back to top
View user's profile Send private message
MickKi
Veteran
Veteran


Joined: 08 Feb 2004
Posts: 1158

PostPosted: Sat Mar 05, 2005 8:59 pm    Post subject: Reply with quote

Hi engtech,

Am I right to assume that this is a multiboot installation? From your bootable entry at the command prompt you can safely assume that your / is at /dev/hda3, or in grub nomenclature in (hd0,2).

When you type:
Code:
grub> find /boot/grub/stage1
what do you get? Grub needs certain files in its own "root" (this is where you have installed grub). If you followed the manual then grub's root is installed in /boot; i.e. when you did:
Code:
grub> root (hd0,0)
you assigned grub's root directory in the partition that /boot is located.

I am guessing here, but I bet a pint down your local that the first partition of your hda drive is not where /boot is residing?
_________________
Regards,
Mick
Back to top
View user's profile Send private message
engtech
n00b
n00b


Joined: 05 Mar 2005
Posts: 3

PostPosted: Sun Mar 06, 2005 7:17 pm    Post subject: Reply with quote

Actually no multiboot isn't necessary. I just setup grub.conf exactly as the install guide suggested.

I still havn't made any progress.
Quote:
From your bootable entry at the command prompt you can safely assume that your / is at /dev/hda3, or in grub nomenclature in (hd0,2).
Correct except that wasn't intended...

I did:
Code:

grub> root (hd0,2)         
grub> setup (hd0)

as dusdus suggested and now when I do:
Code:

grub>find /boot/grub/stage1
(hd0,0)

I assume this is a good response. Now how do I get grub installed on (hd0,0)? I tried:
Code:

grub-install --root-directory=/boot /dev/hda

from inside gentoo but get an error about the device not corresponding to anything in bios....
Back to top
View user's profile Send private message
MickKi
Veteran
Veteran


Joined: 08 Feb 2004
Posts: 1158

PostPosted: Sun Mar 06, 2005 9:09 pm    Post subject: Reply with quote

engtech wrote:
. . . I did:
Code:

grub> root (hd0,2)         
grub> setup (hd0)

as dusdus suggested and now when I do:
Code:

grub>find /boot/grub/stage1
(hd0,0)
Let's start from the beginning:

1. If you did "grub> root (hd0,2)" then this installed grub's root files in the third partition of your disk (I understand that this where your / fs is). However, is the third partition of your hda where your /boot directory resides?

2. On the other hand, when "grub>find /boot/grub/stage1" shows (hd0,0) it means that your grub's root is found in the first partition of hda. These two statements are a tad contradictory (i.e. have you installed grub's filesystem twice, on partition hda1 and hda3?!

3. To complicate matters further your bootable command line (in your first post) shows that your /boot is in /dev/hda3.

engtech wrote:
. . . Now how do I get grub installed on (hd0,0)? I tried:
Code:

grub-install --root-directory=/boot /dev/hda

from inside gentoo but get an error about the device not corresponding to anything in bios....
The grub-install command is a bit dangerous because grub just guesses where your BIOS drives are and how these are mapped against the OS drives. It may not always get it right . . . If it doesn't then one has to tweak the /boot/grub/device.map file which grub reads to know where to find each device.

So, what I recommend is that you first find/decide where you want to have your /boot. Then use e.g. fdisk to place a boot label <a> at the partition where /boot resides. Then install grub's root fs there "root (hdX,Y)". Then reinstall grub's boot loader in the MBR: "grub> setup (hd0)". Leave your kernel line as is in the grub.conf; since you have managed to boot it like that, it means that your kernel line is correct.

I hope all this does not sound too confusing?
_________________
Regards,
Mick
Back to top
View user's profile Send private message
BitKeeper
Tux's lil' helper
Tux's lil' helper


Joined: 27 Apr 2004
Posts: 109
Location: Cairns, Australia

PostPosted: Sun Mar 06, 2005 10:38 pm    Post subject: Reply with quote

I find that when this problem happens it is because there is no symlink in /boot to it's self.

Kick up your machine and do a

Code:

ls -l /boot/



You should see somthing like this
Code:

lrwxrwxrwx  1 root root       1 Oct 28 22:32 boot -> .



If boot is just a directory and not a symlink then try

Code:

cd /boot
mv ./boot ./boot_old
ln -s . boot


Now reboot and see how you go. If it works you can delete the /boot/boot_old directory.
Back to top
View user's profile Send private message
Deathwing00
Bodhisattva
Bodhisattva


Joined: 13 Jun 2003
Posts: 4087
Location: Dresden, Germany

PostPosted: Mon Mar 07, 2005 12:34 am    Post subject: Reply with quote

Please, follow the grub error collection thread.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Duplicate Threads 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