# grub problems

## tursiops

Hi!

I compiled my own kernel took from the latest sources from emerge, and I wanted grub to launch this new kernel, but there is no way to change the configuration...

What can I do?

Thanks!Last edited by tursiops on Tue Aug 17, 2004 5:15 pm; edited 1 time in total

----------

## NeddySeagoon

tursiops,

You need to add a re section to /boot/grub/grub.conf like this

```
default 3

timeout 30

splashimage=(hd0,0)/boot/grub/splash.xpm.gz

# This bit starts an old kernel

title=Gentoo-Webcam (2.4.20)

root (hd0,0)

kernel (hd0,0)/boot/linux-2.4.20-gentoo-r7 root=/dev/hda5 hdc=ide-scsi hdd=ide-scsi

# This bit starts a new kernel

title=Kernel 2.6.6 IDE Writing

root (hd0,0)

kernel (hd0,0)/linux-2.6.6 root=/dev/hda5 hdc=ide-cd hdd=ide-cd

```

You will have to use your own kernel parameters, not mine.

----------

## tursiops

But I don't have any grub folder nor grub.conf file... And grub still work, it's really weird.

----------

## NeddySeagoon

tursiops,

Its on /boot, which is not mounted by default. You need to say 

```
mount /boot
```

If you didn't know that, your nice new kernel will be installed in the directory called /boot (on the root partition) not in the partition called /boot which uses the directory called /boot as a mount point.

The /boot partition has a dirextory called lost+found, the /boot directory does not, so you can tell the two places apart. If fact, the directory called /boot should be empty until the /boot partition is mounted there.

----------

## tursiops

Hi!

Now I mounted the boot partition, and modified the grub.conf file.

It still doesn't work. When I try to launch the new kernel, It says no file found.

What can I do?

----------

## NeddySeagoon

tursiops,

After you built your kernel, you should have done

```
mount /boot

cp arch/i386/boot/bzImage /boot/<kernel_name>
```

If you forgot to mount /boot, it went to the wrong place.

Please post the output of 

ls -al /boot (after boot is mounted) and the content of your grub.conf.

----------

## tursiops

Here is my output of the boot directory:

total 6292

drwxr-xr-x   4 root root    1024 Aug 12 20:04 .

drwxr-xr-x  18 root root    4096 Jul 31 14:39 ..

-rw-r--r--   1 root root       0 Apr 13 01:21 .keep

-rw-r--r--   1 root root  990669 Aug 12 20:19 System.map-2.6.7-gentoo-r12

lrwxrwxrwx   1 root root       1 Jun  9 16:26 boot -> .

-rw-r--r--   1 root root   30831 Aug 12 20:20 config-2.6.7-gentoo-r12

drwxr-xr-x   2 root root    1024 Aug 12 20:27 grub

-rw-r--r--   1 root root 1328153 Jun  9 17:27 initrd-2.6.5-gentoo-r1

-rw-r--r--   1 root root 1969602 Jun  9 17:20 kernel-2.6.5-gentoo-r1

-rw-r--r--   1 root root 2069735 Aug 12 20:19 kernel-2.6.7-gentoo-r12

drwx------   2 root root   12288 Jun  9 15:58 lost+found

And here is my grub.conf file:

default 0

timeout 30

splashimage=(hd0,0)/grub/splash.xpm.gz

title=Gentoo Linux 2.6.5

root (hd0,0)

kernel /kernel-2.6.5-gentoo-r1 root=/dev/ram0 init=/linuxrc real_root=/dev/hda3 vga=792

initrd /initrd-2.6.5-gentoo-r1

title Gentoo Linux 2.6.7-r12

root (hd0,0)

kernel /kernel-2-6.7-gentoo

----------

## NeddySeagoon

tursiops,

You have several problems. Looking at the content of /boot, your 2.6.7 kernel is called  *Quote:*   

> kernel-2.6.7-gentoo-r12
> 
> 

 On its own, that OK.

Looking at grub.conf youo have used the name  *Quote:*   

> kernel-2-6.7-gentoo

 On its own, thats OK too.

Taken togther, its a problem. Grub is looking for one kernel file any you have provided one with a different name. The names can be anything you want, but they must be the same in both places.

The other problem is that you haven't provided the new kernel with any parameters. A good start would be root=/dev/hda3 vga=792.

That will make your kernel line say

```
kernel /kernel-2-6.7-gentoo root=/dev/hda3 vga=792
```

before you fix the names.

----------

## tursiops

Hi!

I've just done what you said but it still say that the file cannot be found. 

What can I do more?

----------

## NeddySeagoon

tursiops,

Post ls -al /boot and the content of grub.conf again

----------

## tursiops

Everything is the same, I just changed the grub.conf file exactly as you told me to.

----------

## NeddySeagoon

tursiops,

I left it for you to resolve the mismatched names between what grub.conf says and the name of the kernel in /boot

The *Quote:*   

> Code:
> 
> kernel /kernel-2-6.7-gentoo root=/dev/hda3 vga=792
> 
> 

  was not intended to work - just illustrate a point.

Match the names exactly, and you should be away.

----------

## tursiops

So what's intended to work? I don't have a clue right now....

----------

## NeddySeagoon

tursiops,

Your kernel is called /boot/kernel-2.6.7-gentoo-r12  

So a kernel line in grub.conf of 

kernel /kernel-2-6.7-gentoo-r12 root=/dev/hda3 vga=792 

would be a good place to start. The bits in bold must match exactly.

This in place of the last line of this bit in grub.conf:-

 *Quote:*   

> title Gentoo Linux 2.6.7-r12
> 
> root (hd0,0)
> 
> kernel /kernel-2-6.7-gentoo

 

----------

## tursiops

So now my grub.conf will look like this:

default 0

timeout 30

splashimage=(hd0,0)/grub/splash.xpm.gz

title=Gentoo Linux 2.6.5

root (hd0,0)

kernel /kernel-2.6.5-gentoo-r1 root=/dev/ram0 init=/linuxrc real_root=/dev/hda3 vga=792

initrd /initrd-2.6.5-gentoo-r1

title Gentoo Linux 2.6.7-r12

root (hd0,0)

kernel /kernel-2-6.7-gentoo-r12 root=/dev/hda3 vga=792

Is it ok?

----------

## NeddySeagoon

tursiops,

That looks good what happened when you tried it ?

----------

## tursiops

Same problem, "file not found"

----------

## ja_david

I had the same problem yesterday. (I'm a newbie and installing my first gentoo form last friday  :Smile:  ). And I don't know why, but helped me this:

root (hd0,0)

kernel (hd0,0)/boot/kernel ...etc.

So just try to add whole path to your kernel.

----------

## tursiops

I tried to add boot/ before kernel, but there no way to getting it work  :Sad: 

----------

## tursiops

Hi all!

It's solved now, I just had to replace the - for a . and it works!

Thanks all!

----------

