# /lib/modules pointing to wrong kernel [RESOLVED]

## Old School

I've been trying to install the nvidia-kernel after a kernel upgrade on a rock solid set up when I ran into a glitch.

when I modprobe nvidia I get the following:

```
Fatal: Error inserting nvidia (/lib/modules/2.6.12-gentoo-r4/video/nvidia.ko): No such device.
```

the problem is that I am compiling a different kernel (2.6.12-r10), and yes, I checked the sym link in /usr/src -- it is pointing to the correct (2.6.12-r10)

kernel. I checked /lib/module and the 2.6.12-r10 kernel is listed along with the 2.6.12-r4.

When the nvidia-driver is compiling, it is compiling on the correct kernel. It is when I modprobe that I get the wrong one.

I am at a loss as to fix this.

----------

## steveb

is kernel 2.6.12-r10 the active kernel, when you modprobe the nvidia drivers?

cheers

SteveB

----------

## Old School

steveb wrote: *Quote:*   

> is kernel 2.6.12-r10 the active kernel, when you modprobe the nvidia drivers?
> 
> cheers
> 
> SteveB

 

Yes it is, if you mean is that the kernel I'm working in and sym-linked to.

----------

## steveb

 *menelmacar wrote:*   

> Yes it is, if you mean is that the kernel I'm working in and sym-linked to.

 

is this showing the 2.6.12-r10 version of the kernel:

```
uname -r
```

does this list the nvidia.ko module:

```
find /lib/modules/$(uname -r) -iname nvidia* -type f
```

does this show the correct kernel version:

```
find /lib/modules/$(uname -r) -iname nvidia* -type f -exec modinfo "{}" ";"
```

is the module already loaded:

```
lsmod | grep nvidia
```

could you quickly execute the above commands and post the output?

cheers

SteveB

----------

## Old School

I feel so fscking stupid. After I last posted I booted back into the linux side, did a uname -a and guess what-- it said 2.6.12-r4. I knew I stayed up too late last night doing this. I'll try it again and try a novel approach ... I'll use the correct kernel. Thanks steveb, I'll mark this as solved and stupid   :Embarassed: 

----------

## steveb

 *menelmacar wrote:*   

> I feel so fscking stupid. After I last posted I booted back into the linux side, did a uname -a and guess what-- it said 2.6.12-r4. I knew I stayed up too late last night doing this. I'll try it again and try a novel approach ... I'll use the correct kernel. Thanks steveb, I'll mark this as solved and stupid  

 Mark it only as [SOLVED]  :Smile:   :Smile: 

----------

## Old School

ok this is strange.booted back into gentoo,  did

```
ls -l /usr/src
```

sym link pointed to 2.6.12-r10

```
rm /usr/src/linux

cd /usr/src

ln -s linux-2.6.13-gentoo-r3 linux

ls -l /usr/src
```

link pointed to 2.6.13-r3

configured the kernel

```
cd linux

make menuconfig

make && make modules && make modules_install && make install

mount /boot
```

copied the arch bzImage and the .config to /boot 

added the new kernel to /boot/grub/grub.conf

rebooted and the new boot option showed up on grub 

logged in did uname -a and slam: 2.6.12-r4

What am I doing wrong? When I was in menuconfig the header said 2.6.13-r3.

----------

## Old School

I tried 

```
ln -sfn linux-2.6.12-gentoo-r4
```

and got

```
ln: `linux-2.6.12-gentoo-r4' and `./linux-2.6.12-gentoo-r4' are the same file
```

What gives?

after digging around in my /home/me I found 2 links:

```
Jul 23 linux---> linux-2.6.12-gentoo-r4

Jul 23 linux-2.6.12-gentoo-r4 ---> linux-2.6.12-gentoo-r4
```

ok, the first one is legit but the second one...why would it be linked to itself?

----------

## steveb

 *menelmacar wrote:*   

> I tried 
> 
> ```
> ln -sfn linux-2.6.12-gentoo-r4
> ```
> ...

 

you can remove the links in your /home/me directory!

for /usr/src: could you please post the output of:

```
ls -lah /usr/src
```

or could you delete all the links in /usr/src:

```
find /usr/src/ -type l -maxdepth 1 -exec rm -ri "{}" ";"
```

and then set the link again:

```
cd /usr/src

ln -sf linux-2.6.12-gentoo-r4 linux
```

could you as well post the output of the following command:

```
mount /boot

cat /boot/grub/grub.conf
```

and as well the output of the following command:

```
mount /boot

ls -l /boot
```

could you as well post the output of the following command:

```
find /usr/src/linux-2.6.12-gentoo-r4/ -type f -iregex ".*/\(bzImage\|vmlinux\|System.map\)" -exec ls -l "{}" ";"
```

cheers

SteveB

----------

## Old School

steveb, thanks for the reply

```
ls -lah /usr/src

drwxr-xr-x 5 root root 216 Oct 13 20:54 .

drwxr-xr-x 15 root root 520 Aug 10 21:26 ..

 -rw-r--r-- 1 root root 0 Aug 10 21:26 .keep

lrwxrwxrwx 1 root root 22 Oct 13 20:54 linux -> linux-2.6.12-gentoo-r4

drwxr-xr-x 19 root root 1.3k Oct 13 19:19 linux-2.6.12-gentoo-r10

drwxr-xr-x 19 root root 1.3k Oct 13 23:24 linux-2.6.12-gentoo-r4
```

and

```
find /usr/src/linux-2.6.12-gentoo-r4/ -type f -iregex ".*/\(bzImage\|vmlinux\|System.map\)" -exec ls -l "{}" ";"

-rw-r--r-- 1 root root 2085953 Oct 14 09:55 /usr/src/linux-2.6.12-gentoo-r4/arch/i386/boot/bzImage

-rwxr-xr-x 1 root root 2081460 Oct 14 09:55 /usr/src/linux-2.6.12-gentoo-r4/arch/i386/boot/compressed/vmlinux

-rw-r--r-- 1 root root 970377 Oct 14 09:55 /usr/src/linux-2.6.12-gentoo-r4/System.map

-rwxr-xr-x 1 root root 5549312 Oct 14 09:55 /usr/src/linux-2.6.12-gentoo-r4/vmlinux
```

Hope this helps. I removed the 2.6.13 kernel, reading to many nvidia problems with it. Right now I would be happy to get my 2.6.12-r4 kernel going again!

I was able to remove one of the links in my home folder, but the Jul 23 linux-2.6.12-gentoo-r4 ---> linux-2.6.12-gentoo-r4 is still there (don't know how to remove. Read man ls but that didn't help. I recompiled the 2.6.12-r4 kernel and when I modprobed nvidia I got the same complaint:

```
Fatal: Error inserting nvidia (/lib/modules/2.6.12-gentoo-r4/video/nvidia.ko): No such device.
```

I did not post my grub.conf, I really don't think there is a problem there. I'm having to write everything down and then boot into windoze and type it here. The screen resolution on linux right now must be 600x800 or something and I am having a hell of a time navigating the forums -- cant even see the whole width of the page! So it is easier to post from windows. Plus I don't know how to copy and paste from the cli. What a nOOb I am.  :Confused: 

----------

## steveb

 *menelmacar wrote:*   

> steveb, thanks for the reply
> 
> ```
> ls -lah /usr/src
> 
> ...

 

This looks good!  :Smile: 

 *menelmacar wrote:*   

> and
> 
> ```
> find /usr/src/linux-2.6.12-gentoo-r4/ -type f -iregex ".*/\(bzImage\|vmlinux\|System.map\)" -exec ls -l "{}" ";"
> 
> ...

 

This as well  :Smile: 

 *menelmacar wrote:*   

> Hope this helps. I removed the 2.6.13 kernel, reading to many nvidia problems with it. Right now I would be happy to get my 2.6.12-r4 kernel going again!
> 
> I was able to remove one of the links in my home folder, but the Jul 23 linux-2.6.12-gentoo-r4 ---> linux-2.6.12-gentoo-r4 is still there (don't know how to remove. Read man ls but that didn't help. I recompiled the 2.6.12-r4 kernel and when I modprobed nvidia I got the same complaint:
> 
> ```
> ...

 

Easy... No problem with me.

Okay. Lets go ahead. Could you please do this:

```
cd /usr/src/linux-2.6.12-gentoo-r4/

make oldconfig && make && make modules_install

mount /boot

cp /usr/src/linux-2.6.12-gentoo-r4/arch/i386/boot/bzImage /boot/bzImage-2.6.12-gentoo-r4

cp /usr/src/linux-2.6.12-gentoo-r4/System.map /boot/System.map-2.6.12-gentoo-r4

cp /usr/src/linux-2.6.12-gentoo-r4/vmlinux /boot/vmlinux-2.6.12-gentoo-r4

cp /usr/src/linux-2.6.12-gentoo-r4/.config /boot/.config-2.6.12-gentoo-r4
```

Then continue with editing or modifying grub:

```
nano -w -c /boot/grub/grub.conf
```

Please add something linke this to your grub configuration (for now, do not care about double entries for the 2.6.12-gentoo-r4 kernel):

```
title=Gentoo Linux [2.6.12-gentoo-r4]

        root (hd0,0)

        kernel /boot/bzImage-2.6.12-gentoo-r4 root=/dev/<your root disc>
```

And then reboot your system. After you have selected the "Gentoo Linux [2.6.12-gentoo-r4]" entry in grub and you have verified, that the loaded kernel is 2.6.12-gentoo-r4, do the following:

```
emerge -v nvidia-kernel nvidia-glx

eselect opengl set nvidia
```

This should bring back the nvidia module and you should be able to run again X.

cheers

SteveB

----------

## Old School

steveb, thanks for the reply. Before I do the things in your post above could you look at my /boot post here:

```
total 22636

lrwxrwxrwx 1 root root 27 oct 12 21:00 System.map -> System.map-2.6.12-gentoo-r4

-rw-r--r-- 1 root root 780173 oct 12 18:51 System.map-2.6.12-gentoo-r10

-rw-r--r-- 1 root root 809671 oct 11 21:55 System.map-2.6.12-gentoo-r10.old

-rw-r--r-- 1 root root 970377 oct 12 21:00 System.map-2.6.12-gentoo-r4

lrwxrwxrwx 1 root root 970377 oct 12 18:07 System.map-genkernel-x86-2.6.12-gentoo-r4

lrwxrwxrwx 1 root root 28 oct 12 18:51 System.map.old -> System.map-2.6.12-gentoo-r10

lrwxrwxrwx 1 root root 1 jun 9 09:44 boot -> .

lrwxrwxrwx 1 root root 23 oct 12 21:00 config -> config-2.6.12-gentoo-r4

-rw-r--r-- 1 root root 32826 oct 14 09:57 config-2.6.12-gentoo-r10

-rw-r--r-- 1 root root 35254 oct 11 21:56 config-2.6.12-gentoo-r10.old

-rw-r--r-- 1 root root 32826 oct 12 21:00 config-2.6.12-gentoo-r4

-rw-r--r-- 1 root root 33782 oct 13 21:13 config-2.6.13-gentoo-r3

lrwxrwxrwx 1 root root 24 oct 12 18:51 config.old -> config-2.6.12-gentoo-r10

drwxr-xr-x 2 root root 672 aug 14 16:12 grub

-rw-r--r-- 1 root root 1411760 oct 11 21:32 initramfs-genkernel-x86-2.6.12-gentoo-r4

-rw-r--r-- 1 root root 0 oct 11 8:35 initrd

-rw-r--r-- 1 root root 2028540 oct 13 19:21 kernel-2.6.12-gentoo-r10

-rw-r--r-- 1 root root 2085953 oct 14 09:57 kernel-2.6.12-gentoo-r4

-rw-r--r-- 1 root root 2085963 oct 12 18:07 kernel-genkernel-x86-2.6.12-gentoo-r4

lrwxrwxrwx 1 root root 24 oct 12 21:00 vmlinuz -> vmlinuz-2.6.12-gentoo-r4

-rw-r--r-- 1 root root 2029056 oct 12 18:51 vmlinuz-2.6.12-gentoo-r10

-rw-r--r-- 1 root root 2137975 oct 11 21:55 vmlinuz-2.6.12-gentoo-r10.old

-rw-r--r-- 1 root root 2085933 cct 12 21:00 vmlinuz-2.6.12-gentoo-r4

lrwxrwxrwx 1 root root 25 oct 12 18:51 vmlinuz.old -> vmlinuz-2.6.12-gentoo-r10
```

----------

## steveb

Looks like you did your kernel with genkernel? Are you using splashscreen?

cheers

SteveB

----------

## Old School

my original kernel was done with genkernel using the --menuconfig option.

I was using the 2005.1 live cd splash. I didn't include the splash images with the results of ls /boot for reasons of brevity and hand cramps from writing all that down  :Very Happy: 

The kernel I've been trying to work is being done with make menuconfig

Should I go ahead with your instructions from your last post?

----------

## kueitao

 *menelmacar wrote:*   

> steveb, thanks for the reply. Before I do the things in your post above could you look at my /boot post here:
> 
> ```
> total 22636
> 
> ...

 

Why do you expect you can boot a different kernel than vmlinuz-2.6.12-gentoo-r4 if your /boot/vmlinuz points to that?

Is it possible that before "make install" you forgot to "mount /boot"?

----------

## steveb

 *menelmacar wrote:*   

> my original kernel was done with genkernel using the --menuconfig option.
> 
> I was using the 2005.1 live cd splash. I didn't include the splash images with the results of ls /boot for reasons of brevity and hand cramps from writing all that down 
> 
> The kernel I've been trying to work is being done with make menuconfig
> ...

 Yes! Go ahead. Maybe do the following instead of my original post:

```
cd /usr/src/linux-2.6.12-gentoo-r4/

make oldconfig && make && make modules_install

mount /boot

cp /usr/src/linux-2.6.12-gentoo-r4/arch/i386/boot/bzImage /boot/bzImage-2.6.12-gentoo-r4_ver2

cp /usr/src/linux-2.6.12-gentoo-r4/System.map /boot/System.map-2.6.12-gentoo-r4_ver2_ver2

cp /usr/src/linux-2.6.12-gentoo-r4/vmlinux /boot/vmlinux-2.6.12-gentoo-r4_ver2_ver2

cp /usr/src/linux-2.6.12-gentoo-r4/.config /boot/.config-2.6.12-gentoo-r4_ver2_ver2
```

Then continue with editing or modifying grub:

```
nano -w -c /boot/grub/grub.conf
```

Please add something linke this to your grub configuration (for now, do not care about double entries for the 2.6.12-gentoo-r4 kernel):

```
title=Gentoo Linux [2.6.12-gentoo-r4]

        root (hd0,0)

        kernel /boot/bzImage-2.6.12-gentoo-r4_ver2 root=/dev/<your root disc>
```

cheers

SteveB

----------

## kueitao

 *kueitao wrote:*   

>  *menelmacar wrote:*   steveb, thanks for the reply. Before I do the things in your post above could you look at my /boot post here:
> 
> ```
> total 22636
> 
> ...

 

What I mean is that you where trying to boot vmlinuz-2.6.13-* while you don't have it. Your system correctly booted what it is pointed by grub.conf that I suppose is /boot/vmlinuz.

If you have a /boot partition on another disk that is not automatically mounted at boot (this depends on you /etc/fstab) you must manually "mount /boot" before running "make install" from the kernel tree. Can you please check it?

Maybe you have a /boot directory in the same disk as / and a second /boot directory in another disk so this could be the reason why you don't find vmlinuz-2.6.13-*.

----------

## Old School

@steveb I folowed your instructions to the letter. After rebooting I did

```
uname -r

2.6.12-gentoo-r4
```

I'm thinking we wanted to see

```
2.6.12-gentoo-r4_ver2
```

Anyway I unmerged the nvidia-kernel then emerged it did the eselect, still could not get in X.

Rebooted, tried over again with the nvivida-kernel and tried a modprobe nvidia and got

```
Fatal: Error inserting nvidia (/lib/modules/2.6.12-gentoo-r4/video/nvidia.ko): No such device.
```

Any ideas short of ritual suicide?

----------

## steveb

 *menelmacar wrote:*   

> @steveb I folowed your instructions to the letter. After rebooting I did
> 
> ```
> uname -r
> 
> ...

 

NO! 2.6.12-gentoo-r4 is absolutly okay. The _ver2 is only for Grub. It has absolutly nothing to do with uname.

 *menelmacar wrote:*   

> Anyway I unmerged the nvidia-kernel then emerged it did the eselect, still could not get in X.
> 
> Rebooted, tried over again with the nvivida-kernel and tried a modprobe nvidia and got
> 
> ```
> ...

 Okay... It looks like you have the nvidia module (nvidia.ko), but for some strange reason, you can not load the module.

Could you please post the output of:

```
equery l nvidia-*
```

and

```
equery l xorg-x11
```

and the output of:

```
modinfo nvidia
```

cheers

SteveB

----------

## Old School

@steveb Get you the results ASAP

----------

## steveb

okay.... me waiting...

----------

## Old School

@steveb

```
equery l nvidia-*

[Searching for package 'nvidia-bug-report.log in all categories among:]

*installed packages
```

and

```
equery l xorg-x11

[Searching for package 'xorg-x11-bug-report.log in all categories among:]

*installed packages

[I--] [M] x11-base/xorg-x11-6.8.2.-r2 (0)
```

and

```
modinfo nvidia

license:  NVIDIA

alias: char-major-195-*

parmtype: Silence_nvidia_output:int

parmtype: Nvreg_VideoMemoryTypeOverride:int

parmtype: Nvreg_EnableVia4x:int

parmtype: Nvreg_EnableAliAGP:int

parmtype: Nvreg_ReqAGPRate:int

parmtype: Nvreg_NvAGP:int

parmtype: Nvreg_EnableAGPSBA:int

parmtype: Nvreg_EnableAGPFW:int

parmtype: Nvreg_SoftEDIDS:int

parmtype: NvregMobile:int

parmtype: Nvreg_ResmanDebugLevel:int

parmtype: Nvreg_FlatPanelMode:int

parmtype: Nvreg_DevicesConnected:int

parmtypr: Nvreg_VideoEnhancement:int

parmtype: Nvreg_RMLogonRC:int

Vermagic: 2.6.12-gentoo-r4 K7 gcc-3.4

depends: agpgart

alias: pci:v000010DEd*sv*sd*bc03sc00i00*
```

----------

## steveb

 *menelmacar wrote:*   

> @steveb
> 
> ```
> equery l nvidia-*
> 
> ...

 

sorry. could you please rerun this again:

```
equery l "nvidia"
```

cheers

SteveB

----------

## Old School

steveb wrote :

 *Quote:*   

> sorry. could you please rerun this again:
> 
> Code:
> 
> equery l "nvidia"
> ...

 

```
equery l "nvidia"

[I--] [ ] media-video/nvidia-glx-1.0.6629-r6 (0)

[I--] [ ] media-video/nvidia-kernel-1.0.6629-r4 (0)
```

----------

## steveb

 *menelmacar wrote:*   

> steveb wrote :
> 
>  *Quote:*   sorry. could you please rerun this again:
> 
> Code:
> ...

 

okay... let us try to install newer version of the nvidia stuff:

```
mkdir -p /etc/portage

echo ~media-video/nvidia-kernel-1.0.7676 ~x86>>/etc/portage/package.keywords

echo ~media-video/nvidia-glx-1.0.7676-r1 ~x86>>/etc/portage/package.keywords

rmmod -f nvidia

emerge unmerge media-video/nvidia-kernel media-video/nvidia-glx

emerge -uv media-video/nvidia-kernel media-video/nvidia-glx

eselect opengl set nvidia

modprobe nvidia
```

Then try again to start the X server.

cheers

SteveB

----------

## Old School

OK steveb, and by the by I really appreciate you sticking with this.  :Cool: 

----------

## steveb

 *menelmacar wrote:*   

> OK steveb, and by the by I really appreciate you sticking with this. 

 No problem  :Wink: 

I will probably go soon to grab some sleep. It is already 04:20 over here (I'am from Switzerland).

cheers

SteveB

----------

## Old School

@steveb

well, I did everything you suggested (I already had the nvidia stuff in package.keywords, just commented out), I did a 

```
emerge -va nvidia-glx
```

the -uva option was dragging in too many things, like toolchain stuff, that I don't want to deal with now.

did the 

```
eselect opengl set nvidia
```

and 

```
modprobe nvidia
```

and got 

```
Fatal: Error inserting nvidia (/lib/modules/2.6.12-gentoo-r4/video/nvidia.ko): No such device.
```

I did 

```
equery l "nvidia"
```

and it listed the 1.0.7676 kernel and 7676-r1 glx.

Could it be I missed something in my Kernel config?

----------

## steveb

I don't know if you missed something in your kernel config. Could you please try to modprobe the nvidia driver and then after that look at the output of the dmesg command to see why you can not load the module?

Do you have any devices in /dev for nvidia?

```
ls -lah /dev/nvidia*
```

If you like, you could send me your .config file to steeeeeveee@gmx.net and I can have a quick look at it and return you the changes I would make for it. It would be nice, if you could include the output of lspic when you send me your kernel config.

cheers

SteveB

----------

## Old School

@steveb I finally got things working with the 2.6.12-r10 kernel. I don't know what the problem was with the 'r4 kernel, but it was giving me fits. Just wanted to thank you again, for your clear and concise suggestions.  :Cool:   :Cool:   :Cool: 

----------

