# [solved] modprobe nvidia problem

## wbrokow1

I have been following the nvidia-drivers howto in the wiki and have come across a problem:

Please, any help is appreciated.

```

wbrokow1 boot # modprobe nvidia

FATAL: Error inserting nvidia (/lib/modules/2.6.18-gentoo-r3/video/nvidia.ko): Invali                                          d module format

wbrokow1 boot # lsmod | grep nvidia && rmmod nvidia

wbrokow1 boot # dmesg | grep nvidia

nvidia: version magic '2.6.18-gentoo-r3 SMP preempt mod_unload K7 gcc-4.1' should be '2.6.18-gentoo-r3 SMP preempt mod_unload K7 gcc-3.4'

nvidia: version magic '2.6.18-gentoo-r3 SMP preempt mod_unload K7 gcc-4.1' should be '2.6.18-gentoo-r3 SMP preempt mod_unload K7 gcc-3.4'

nvidia: version magic '2.6.18-gentoo-r3 SMP preempt mod_unload K7 gcc-4.1' should be '2.6.18-gentoo-r3 SMP preempt mod_unload K7 gcc-3.4'

wbrokow1 boot # ls /lib/modules/`uname -r`/video

nvidia.ko

wbrokow1 boot # lsmod

Module                  Size  Used by

snd_seq_oss            27456  0

snd_seq_midi_event      6080  1 snd_seq_oss

snd_seq                43024  4 snd_seq_oss,snd_seq_midi_event

snd_seq_device          6348  2 snd_seq_oss,snd_seq

usblp                  10944  0

dm_mod                 45912  13

ehci_hcd               25352  0

snd_intel8x0           26588  0

ohci_hcd               17156  0

i2c_nforce2             6080  0

snd_ac97_codec         80096  1 snd_intel8x0

i2c_core               16064  1 i2c_nforce2

usbcore               100676  4 usblp,ehci_hcd,ohci_hcd

snd_ac97_bus            2368  1 snd_ac97_codec

wbrokow1 boot # modprobe nvidia

FATAL: Error inserting nvidia (/lib/modules/2.6.18-gentoo-r3/video/nvidia.ko): Invalid module format

wbrokow1 boot #                                                             

```

```

wbrokow1 alexandra # emerge --info

Portage 2.1.3.9 (default-linux/x86/2007.0/desktop, gcc-4.1.2, glibc-2.6.1-r0, 2.6.18-gentoo-r3 i686)

=================================================================

System uname: 2.6.18-gentoo-r3 i686 AMD Athlon(tm) XP 2800+

Timestamp of tree: Fri, 19 Oct 2007 20:30:04 +0000

app-shells/bash:     3.2_p17-r1

dev-java/java-config: 1.3.7, 2.0.33-r1

dev-lang/python:     2.4.4-r5

dev-python/pycrypto: 2.0.1-r6

sys-apps/baselayout: 1.12.10-r5

sys-apps/sandbox:    1.2.17

sys-devel/autoconf:  2.13, 2.61-r1

sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10

sys-devel/binutils:  2.18-r1

sys-devel/gcc-config: 1.3.16

sys-devel/libtool:   1.5.24

virtual/os-headers:  2.6.22-r2

ACCEPT_KEYWORDS="x86"

CBUILD="i686-pc-linux-gnu"

CFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer"

CHOST="i686-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"

CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"

CXXFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer"

DISTDIR="/usr/portage/distfiles"

FEATURES="distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch"

GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"

LC_ALL="en_US"

PKGDIR="/usr/portage/packages"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/usr/local/portage"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="3dnow X a52 aac acl acpi alsa apache2 asf avi berkdb bitmap-fonts browserplugin cairo cdparanoia cdr cli cracklib crypt cscope cups dba dbus divx4linux dlloader dri dv dvd dvdr dvdread eds emboss encode esd evo fam fame ffmpeg firefox flac foomaticdb fortran gd gif gimpprint gphoto2 gpm gstreamer gtk gtk2 hal iconv ieee1394 imagemagick imlib innodb ipv6 isdnlog java javascript joystick jpeg kde kdeenablefinal kerberos lirc mad matroska midi mikmod mime mmx mp3 mpeg mudflap mysql nas ncurses net nptl nptlonly nsplugin nvidia ogg oggvorbis opengl openmp oss pam pcre pda pdf pdflib perl png ppds pppd python qt qt3 qt3support qt4 quicktime readline reflection samba sdl session shared sound spell spl sse ssl subtitles svg tcpd theora threadsafe tiff transcode truetype truetype-fonts type1 type1-fonts unicode usb v4l2 vcd videos vorbis win32codecs x86 xine xinerama xml xorg xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i740 i810 imstt mach64 mga neomagic nsc nv r128 radeon rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa vga via vmware voodoo"

Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LDFLAGS, LINGUAS, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

wbrokow1 alexandra #                                    

```

Last edited by wbrokow1 on Mon Nov 05, 2007 6:26 pm; edited 1 time in total

----------

## NeddySeagoon

wbrokow1,

Reformatting your error message will help

```
nvidia: version magic '2.6.18-gentoo-r3 SMP preempt mod_unload K7 gcc-4.1' 

should be             '2.6.18-gentoo-r3 SMP preempt mod_unload K7 gcc-3.4' 
```

Spot the difference ?

Your nvidia module was compiled with gcc-4.1 and your 2.6.18-gentoo-r3 kernel was compiled with gcc-3.4. That nomally makes things break, so the kernel checks.

Rebuild your kernel with gcc-4.1, starting with 

```
cd /usr/src/linux

make clean  
```

to ensure its completely recompiled.

This woild be a good opportunity for a kernel update too, since current stab;e is 2.6.22-r8

----------

## wbrokow1

```

wbrokow1 alexandra # cd /usr/src/linux

wbrokow1 linux # make clean

make: Warning: File `..tmp_vmlinux1.cmd' has modification time 8.1e+08 s in the future

  CLEAN   arch/i386/boot/compressed

  CLEAN   arch/i386/boot

  CLEAN   /usr/src/linux-2.6.18-gentoo-r3

  CLEAN   arch/i386/kernel

  CLEAN   drivers/char

  CLEAN   drivers/ieee1394

  CLEAN   init

  CLEAN   lib

  CLEAN   usr

  CLEAN   .tmp_versions

  CLEAN   vmlinux System.map .tmp_kallsyms1.o .tmp_kallsyms1.S .tmp_kallsyms2.o .tmp_kallsyms2.S .tmp_vmlinux1 .tmp_vmlinux2 .tmp_System.map

make: warning:  Clock skew detected.  Your build may be incomplete.

wbrokow1 linux #  

```

Ok, should I compile the new stable kernel now or fix the nvidia-driver issue?

Thanks

----------

## NeddySeagoon

wbrokow1,

Thats entirely your choice. Both things require a kernel compile.

This is a little worrying 

```
make: Warning: File `..tmp_vmlinux1.cmd' has modification time 8.1e+08 s in the future
```

It implies your clock has been stepped back at sometime. This will cause some odd effects with make unless you know that there are no old .o files.

In the kernel, make clean does that, or a new kernel tree.

The first thing to do if fix your clock, if its not correct now.

----------

## wbrokow1

Ok,  I upgraded to the 2.6.22-r8 kernel.

The clock error is gone now.

I emerged the nvidia-drivers.

now I still get an error:

```

wbrokow1 linux # modprobe nvidia

FATAL: Error inserting nvidia (/lib/modules/2.6.18-gentoo-r3/video/nvidia.ko): Invalid module format

wbrokow1 linux #    

```

Alsoit seems my System.map can't be found although it IS there:

```

snip

--- replaced dir /lib

--- replaced obj /etc/modules.d/nvidia

--- replaced dir /etc/modules.d

--- replaced dir /etc

 * Removing x11-drivers/nvidia-drivers-100.14.09 from moduledb.

Switching to nvidia OpenGL interface... done

>>> Regenerating /etc/ld.so.cache...

>>> Original instance of package unmerged safely.

 * Updating module dependencies for 2.6.22-gentoo-r8 ...

 *

 * /usr/src/linux/System.map not found.

 * You must manually update the kernel module dependencies using depmod.                                                                                                     [ !! ]

 *

 * Adding module to moduledb.

Switching to nvidia OpenGL interface... done

 * To use the Nvidia GLX, run "eselect opengl set nvidia"

 *

 * nVidia has requested that any bug reports submitted have the

 * output of /usr/bin/nvidia-bug-report.sh included.

 *

 * To work with compiz, you must enable the AddARGBGLXVisuals option.

 *

 * If you are having resolution problems, try disabling DynamicTwinView.

>>> Regenerating /etc/ld.so.cache...

>>> x11-drivers/nvidia-drivers-100.14.09 merged.

>>> No packages selected for removal by clean

>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

 * Messages for package x11-drivers/nvidia-drivers-100.14.09:

 * To use the Nvidia GLX, run "eselect opengl set nvidia"

 *

 * nVidia has requested that any bug reports submitted have the

 * output of /usr/bin/nvidia-bug-report.sh included.

 *

 * To work with compiz, you must enable the AddARGBGLXVisuals option.

 *

 * If you are having resolution problems, try disabling DynamicTwinView.

 *

 * /usr/src/linux/System.map not found.

 * You must manually update the kernel module dependencies using depmod.

 *

 * GNU info directory index is up-to-date.

```

also this is still in dmesg

```

wbrokow1 boot # dmesg | grep nvidia

nvidia: version magic '2.6.18-gentoo-r3 SMP preempt mod_unload K7 gcc-4.1' should be '2.6.18-gentoo-r3 SMP preempt mod_unload K7 gcc-3.4'

nvidia: version magic '2.6.18-gentoo-r3 SMP preempt mod_unload K7 gcc-4.1' should be '2.6.18-gentoo-r3 SMP preempt mod_unload K7 gcc-3.4'

nvidia: version magic '2.6.18-gentoo-r3 SMP preempt mod_unload K7 gcc-4.1' should be '2.6.18-gentoo-r3 SMP preempt mod_unload K7 gcc-3.4'

nvidia: version magic '2.6.18-gentoo-r3 SMP preempt mod_unload K7 gcc-4.1' should be '2.6.18-gentoo-r3 SMP preempt mod_unload K7 gcc-3.4'

nvidia: version magic '2.6.18-gentoo-r3 SMP preempt mod_unload K7 gcc-4.1' should be '2.6.18-gentoo-r3 SMP preempt mod_unload K7 gcc-3.4'

nvidia: version magic '2.6.18-gentoo-r3 SMP preempt mod_unload K7 gcc-4.1' should be '2.6.18-gentoo-r3 SMP preempt mod_unload K7 gcc-3.4'

nvidia: version magic '2.6.18-gentoo-r3 SMP preempt mod_unload K7 gcc-4.1' should be '2.6.18-gentoo-r3 SMP preempt mod_unload K7 gcc-3.4'

nvidia: version magic '2.6.18-gentoo-r3 SMP preempt mod_unload K7 gcc-4.1' should be '2.6.18-gentoo-r3 SMP preempt mod_unload K7 gcc-3.4'

nvidia: version magic '2.6.18-gentoo-r3 SMP preempt mod_unload K7 gcc-4.1' should be '2.6.18-gentoo-r3 SMP preempt mod_unload K7 gcc-3.4'

nvidia: version magic '2.6.18-gentoo-r3 SMP preempt mod_unload K7 gcc-4.1' should be '2.6.18-gentoo-r3 SMP preempt mod_unload K7 gcc-3.4'

nvidia: version magic '2.6.18-gentoo-r3 SMP preempt mod_unload K7 gcc-4.1' should be '2.6.18-gentoo-r3 SMP preempt mod_unload K7 gcc-3.4'

wbrokow1 boot #                                 

Thanks for your help, I hope we're almost there....
```

----------

## transient

You're still using the wrong kernel version.

----------

## wbrokow1

I switched.

```
wbrokow1 linux # ls -l /usr/src/linux

lrwxrwxrwx 1 root root 22 2007-10-21 17:35 /usr/src/linux -> linux-2.6.22-gentoo-r8

wbrokow1 linux #       
```

```
wbrokow1 boot # ls -l

total 7021

lrwxrwxrwx 1 root root       1 2005-02-15 13:21 boot -> .

-rw-r--r-- 1 root root   42562 2007-10-21 10:06 config-2.6.18-gentoo-r3

-rw-r--r-- 1 root root   46836 2007-10-21 17:50 config-2.6.22-gentoo-r8

drwxr-xr-x 2 root root    1024 2007-09-18 16:55 grub

-rw-r--r-- 1 root root 2332660 2007-10-21 10:04 kernel-2.6.18-gentoo-r3

-rw-r--r-- 1 root root 2758064 2007-10-21 17:49 kernel-2.6.22-gentoo-r8

drwx------ 2 root root   12288 2005-02-15 13:09 lost+found

lrwxrwxrwx 1 root root      27 2007-10-21 18:18 System.map -> System.map-2.6.22-gentoo-r8

-rw-r--r-- 1 root root  865464 2007-10-21 10:05 System.map-2.6.18-gentoo-r3

-rw-r--r-- 1 root root 1092027 2007-10-21 17:50 System.map-2.6.22-gentoo-r8

wbrokow1 boot #                                                           

```

What did I do wrong?

I've switched kernels before exactly according to the handbook.

do I have to reboot?

----------

## transient

```
uname -a
```

If that command outputs something containing 2.6.18, you're still using the old kernel and will need to reboot.

If it outputs something with 2.6.22, then you're using the new kernel and something else must be wrong.

----------

## wbrokow1

yes a new problem crept up when I rebooted

my logical volumes weren't recognized and now I have to figure out what to do about that.

You were right , uname -a produced 2.6.18 as my kernel that's why I rebooted.

Although when I edited the command line to boot from the old kernel 2.6.18

It still did not recognize my logical volumes. Maybe they're corrupt.

My lv's are on 2 scsi drves.

I am using a knoppix live cd to boot now.

Thanks for your help I think I am deeper trouble now of my own doing.

----------

## NeddySeagoon

wbrokow1,

You must add a new booting block in grub.conf to boot your new kernel.

Its identical to the stanza you have now with the kernel file name changed. That will allow you a choice of kernels at boot time.

----------

## wbrokow1

ok I'll add it but I think I have a hardware problem at the same time>

THE drives that have my usr var opt home are dead i think>

the boot drive is ok>

is my system wiped out?

i think it might be

if i create the above dirs on the good drive< at least ill have a starting block>

----------

## NeddySeagoon

wbrokow1,

Its unlikely your drives just died. Its much more lilkely that you have missed a driver.

The kernel menuconfig has been restructured between 2.6.18 abd 2.5.22

make oldconfig does not carry forward settings into to new structure very well.

----------

## wbrokow1

So I have to get into "make menuconfig" in /usr/src/linux?

That means I'll have to recompile.

I don't think I can get to /usr/scr/linux!!

What can I do?

Thanks for your help

----------

## wbrokow1

Ok, I added the 2.6.18 kernel to the list.

Still same errors.

I can't get to /usr/src/linux to run make menuconfig.

Shouldn't it work with the 2.6.18 kernel?

I did not modify that!

This is why I think the drives are bad. 

If the drives are good can't I mount them somehow?

Please help. Thank you very much.

----------

## NeddySeagoon

wbrokow1,

Post your lspci output - it will show yor hardware and we can check your kernel config from there.

Your drives should show up in 

```
fdisk -l
```

 from the liveCD or from kernel 2.6.18, if it didn't get messed up.

Please test from the liveCD.

----------

## wbrokow1

```

lspci

```

gave me :

bash: lspci: command not found

```

fdisk -l

```

 Shows the /dev/hda4 with a Linux LVM system. 

I believe thats the drive.

```

pvdisplay

```

shows the PV name as "unknown device"

How can I use the livecd to test ?

Thanks

----------

## wbrokow1

the live cd shows the two drives as /dev/sda1 & /dev/sdb1.

How do we proceed with the repair?

Thanks again.

----------

## wbrokow1

I have seen others with the same problem but my is differnet than theirs.

Let me explain.

I had 2.6.18 running and wanted to switch to 2.6.22-gentoo-r8 stable.

When I make oldconfig and then installed the new kernel (which I have done many times) I ran into a problem.

The sata drives were not recognized.  All my directories except boot  and swap are on the sata drives(lvm) no raid.

When I rebooted the 2.6.22 did not recognize the sata drives so I said "ok switch back to 2.6.18 and everything should be back to where it was"   NOT so!

When I booted with 2.6.18, which I did no change, at all STILL no sata drives.

THe major problem is /usr/src/linux is on the sata drives!  I can't reconfigure.

Is there a way to use the live CD to rescue myself?  

In my simplistic view of the problem: I need to recompile a kernel (2.6.18 perhaps) and install a new /usr/src/linux

, /usr /opt /home etc to a different drive.  I have two pata drives that are recognized and working. could I use them.

OR should I just WIPE all the sata drives and start over.  

All suggestions are welcome, just please be detailed on how to perform this repair(if possible)

----------

## NeddySeagoon

wbrokow1,

I suspect your 2.6.18 kernel is still there and can be made to boot, its just grub.conf thats not right.

Boot with the liveCD and run 

```
lspci 
```

 Post the output.

As your /boot is outside LVM, grub.conf can be fixed. post your grub.conf and 

```
ls -l /boot
```

You can get at all this from the liveCD.

Some of the SATA drivers changed significantly between 2.6.18 and 2.6.22. Particularly the Intel ones,

so its likely you have not taken account of that, as a result, your SATA drives appear as /dev/hd..., not /dev/sd...

I'm sure your system can be fixed but I don't use LVM to know how to get it to start from the liveCD.

I do know you can though

----------

## wbrokow1

since the system is not functional I have to type .

```

lspci

```

```

0000:01:0b.0 Raid bus controller : cmd technologies inc Silicon Image Sil 3112 SATA raid controller (rev 02)

```

```

ls -l /boot

```

```

/boot -> mnt/livecd/boot

```

my grub.conf is :

```

default 0

timeout 30

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

title=Gentoo Linux 2.6.18

root (hd0,0)

kernel /kernel-2.6.18-gentoo-r3 root=/dev/hda3

title=gentoo linux 2.6.22 

root (hd0,0)

kernel /kernel-2.6.22-gentoo-r8 root=/dev/hda3

```

I type most from memory and copied some down on paper.

Is the lspci output enough?

THanks for the help

----------

## wbrokow1

actually when i do:

```

ls -l /boot  

```

 on the system as is (w/o the live cd)

I get:

```

boot -> .

```

Is this correct?

Also sytem maps and configs are there also for both kernels

----------

## wbrokow1

I booted with a knoppix disk.

Here is my lspci:

```

0000:00:00.0 Host bridge: nVidia Corporation nForce2 AGP (different version?) (r

ev c1)

0000:00:00.1 RAM memory: nVidia Corporation nForce2 Memory Controller 1 (rev c1)

0000:00:00.2 RAM memory: nVidia Corporation nForce2 Memory Controller 4 (rev c1)

0000:00:00.3 RAM memory: nVidia Corporation nForce2 Memory Controller 3 (rev c1)

0000:00:00.4 RAM memory: nVidia Corporation nForce2 Memory Controller 2 (rev c1)

0000:00:00.5 RAM memory: nVidia Corporation nForce2 Memory Controller 5 (rev c1)

0000:00:01.0 ISA bridge: nVidia Corporation nForce2 ISA Bridge (rev a4)

0000:00:01.1 SMBus: nVidia Corporation nForce2 SMBus (MCP) (rev a2)

0000:00:02.0 USB Controller: nVidia Corporation nForce2 USB Controller (rev a4)

0000:00:02.1 USB Controller: nVidia Corporation nForce2 USB Controller (rev a4)

0000:00:02.2 USB Controller: nVidia Corporation nForce2 USB Controller (rev a4)

0000:00:04.0 Ethernet controller: nVidia Corporation nForce2 Ethernet Controller                                                        (rev a1)

0000:00:05.0 Multimedia audio controller: nVidia Corporation nForce MultiMedia a                                                       udio [Via VT82C686B] (rev a2)

0000:00:06.0 Multimedia audio controller: nVidia Corporation nForce2 AC97 Audio                                                        Controler (MCP) (rev a1)

0000:00:08.0 PCI bridge: nVidia Corporation nForce2 External PCI Bridge (rev a3)

0000:00:09.0 IDE interface: nVidia Corporation nForce2 IDE (rev a2)

0000:00:0d.0 FireWire (IEEE 1394): nVidia Corporation nForce2 FireWire (IEEE 139                                                       4) Controller (rev a3)

0000:00:1e.0 PCI bridge: nVidia Corporation nForce2 AGP (rev c1)

0000:01:0b.0 RAID bus controller: Silicon Image, Inc. (formerly CMD Technology I                                                       nc) SiI 3112 [SATALink/SATARaid] Serial ATA Controller (rev 02)

0000:02:00.0 VGA compatible controller: nVidia Corporation NV34 [GeForce FX 5200                                                       ] (rev a1)

knoppix@0[knoppix]$

```

----------

## wbrokow1

any ideas in this yet?

I would hate to have to wipe the drives and start over.

I know just enough to be dangerous!

----------

## NeddySeagoon

wbrokow1,

It appears that your /boot is correct.   the boot -> . is normal. Its allows the same grub.conf to work regardless of /boot being a real partition or not.

I have the same nVidia nForce2 chipset and SIL 3112 as you and my IDE  and SATA works ok. My kernel is made for a Athlon XP+ CPU, so it would run on your system. If you are unable to make a kernel, I can arrange for you to download mine. I do not have LVM support.

Here is what your need for the IDE drives you have

```

  ┌─────────────────────────── ATA/ATAPI/MFM/RLL support ───────────────────────────┐

  │ │    --- ATA/ATAPI/MFM/RLL support                                            │ │  

  │ │    (2)   Max IDE interfaces                                                 │ │  

  │ │    <*>   Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support                │ │  

  │ │    ---     Please see Documentation/ide.txt for help/info on IDE drives     │ │  

  │ │    <*>     Include IDE/ATA-2 DISK support                                   │ │  

  │ │    [*]     Use multi-mode by default                                        │ │  

  │ │    <*>     Include IDE/ATAPI CDROM support                                  │ │    

  │ │    <M>     SCSI emulation support                                           │ │  

  │ │    [*]     IDE ACPI support                                                 │ │  

  │ │    [*]     IDE Taskfile Access                                              │ │  

  │ │    [*]     legacy /proc/ide/ support                                        │ │  

  │ │    ---     IDE chipset support/bugfixes                                     │ │  

  │ │    <*>     generic/default IDE chipset support                              │ │   

  │ │    [*]     PCI IDE chipset support                                          │ │  

  │ │    [*]       Sharing PCI IDE interrupts support                             │ │  

  │ │    <*>     Generic PCI IDE Chipset Support                                  │ │  

  │ │    [*]     Generic PCI bus-master DMA support                               │ │  

  │ │    <*>       AMD and nVidia IDE support                                     │ │  
```

Everything not listed, needs to be off. This has not changed for a while and should already be ok. 

```
Serial ATA (prod) and Parallel ATA (experimental) drivers
```

is a new menu for the SATA drivers that were under Low Level SCSI, make oldconfig gets this wrong and drops your SATA driver out. Choose only   

```
<*>   Silicon Image SATA support 
```

from this new menu.

----------

## wbrokow1

Ok thanks for the response. But exactly how do I run make menu config if I can't get to /usr/src/linux?

----------

## wbrokow1

Anyone else have any input?

----------

## PaulBredbury

```
cd /usr/src

wget <whatever kernel you want, from http://kernel.org/ >

untar it

ln -sfn linux-blah linux

cd linux

make menuconfig

make clean

make -j8 bzImage modules

make modules_install

cp arch/i386/boot/bzImage /boot/kernel

cp System.map /boot/System.map

cp .config /boot/config

emerge nvidia-drivers
```

----------

## wbrokow1

Excellent, thanks for your response.

Please let me ask a couple stupid questions, because I want to be sure not to screw this up.

The /usr/src directory was on the drive I can't access.

But I do have 2 drives that I can access. 

Can I create a temporary /usr/src any place in which to compile the kernel? In other words, can /usr/src be on any partition?

Thank you very much for your help!

----------

## PaulBredbury

 *wbrokow1 wrote:*   

> I can't access.

 

That means nothing. Show the error message.

----------

## wbrokow1

/usr, /var , /opt etc. are on lvm on sata drives.  The 2 sata drives aren't mounted at boot up. only /boot and 1 other drive get mounted.  This is what I mean by I can't access. 

I am at work now and can't give you the exact error but is says something similar to:

unknown device (for the volume group "vg" on the sata drives.)

I can post exact errors when I get home tonight.

Thanks for you help on this!

----------

## wbrokow1

When I boot into the knoppix live cd.  The sata drives are recognized but not mounted.

When I try to mount them I get an error in a kde window:

Could not mount device

The reported error was:

mount : I could not determine filesystem type and none was specified.

Does this info help.

Thanks Again

----------

## wbrokow1

I guess this is a tough one huh?

----------

## RaceTM

I dont use lvm myself but from a quick search it looks like you can't mount lvm partitions directly - you need to mount the bock device for the logical volume (i.e. /dev/vg/....)When you booted the liveCD it should have detected your logical volume groups  and created these nodes for you...Are they there?

I would suggest doing some research about LVM and learning how to mount them properly.  Once you have your root filesystem mounted, you can chroot in to it (again do a search to find out how to do that), then you should be able to go to /usr/src/" of your original installation and proceed with the information that was given earlier in this thread.

Hope this helps,

RaceTM

----------

## RaceTM

http://www.gentoo.org/doc/en/lvm2.xml

----------

## swingkyd

are you sure you have not put your root on an lvm partition? 

Can you post the exact fdisk -l:

```
fdisk -l
```

edit:

and your fstab (if you can get to it)

```
cat /etc/fstab
```

And if you cannot get to your fstab on your root partition, try to use the gentoo install disk. The  minimal disk shoud work..but be sure to enable lvm on the disk. I don't believe it's enabed by default but I could be mistakenLast edited by swingkyd on Tue Oct 30, 2007 12:20 am; edited 1 time in total

----------

## swingkyd

 *NeddySeagoon wrote:*   

> wbrokow1,
> 
> Reformatting your error message will help
> 
> ```
> ...

 

Thanks...this solved the problem I had. The person here seems to have more problems than this problem.  :Wink: 

----------

## wbrokow1

```

root@0[knoppix]# fdisk -l

Disk /dev/hda: 250.0 GB, 250059350016 bytes

255 heads, 63 sectors/track, 30401 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

/dev/hda1   *           1           5       40131   83  Linux

/dev/hda2               6          68      506047+  82  Linux swap / Solaris

/dev/hda3              69          93      200812+  83  Linux

/dev/hda4              94       30401   243449010   8e  Linux LVM

Disk /dev/hdb: 300.0 GB, 300069052416 bytes

255 heads, 63 sectors/track, 36481 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

/dev/hdb1               1       36481   293033601   83  Linux

Disk /dev/sda: 160.0 GB, 160041885696 bytes

255 heads, 63 sectors/track, 19457 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1               1       19457   156288321   8e  Linux LVM

Disk /dev/sdb: 160.0 GB, 160041885696 bytes

255 heads, 63 sectors/track, 19457 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1               1       19457   156288321   8e  Linux LVM

root@0[knoppix]#

```

```

root@0[knoppix]# cat /etc/fstab

/proc      /proc       proc   defaults            0 0

/sys       /sys        sysfs  noauto              0 0

/dev/pts   /dev/pts    devpts mode=0622           0 0

/dev/fd0   /mnt/auto/floppy auto   user,noauto,exec,umask=000    0 0

/dev/cdrom /mnt/auto/cdrom  auto   user,noauto,exec,ro 0 0

/dev/cdrom1 /mnt/auto/cdrom1  auto   users,noauto,exec,ro 0 0

# Added by KNOPPIX

/dev/hda1 /mnt/hda1 ext2 noauto,users,exec 0 0

# Added by KNOPPIX

/dev/hda2 none swap defaults 0 0

# Added by KNOPPIX

/dev/hda3 /mnt/hda3 ext3 noauto,users,exec 0 0

# Added by KNOPPIX

/dev/hda4 /mnt/hda4 auto noauto,users,exec 0 0

# Added by KNOPPIX

/dev/hdb1 /mnt/hdb1 ext2 noauto,users,exec 0 0

# Added by KNOPPIX

/dev/sda1 /mnt/sda1 auto noauto,users,exec 0 0

# Added by KNOPPIX

/dev/sdb1 /mnt/sdb1 ext3 noauto,users,exec 0 0

root@0[knoppix]#                                     

```

----------

## swingkyd

and which partition and device is the root you are having trouble with?

KNOPPIX will try to mount your Linux LVM onto a mount point when it should be accessed via your lvm device points (which show up in /dev)...but I'm assuming you know this as you have LVM's on several different drives.

If your root lives on any LVM, you need to compile lvm support directly into your kernel and then I'm not sure what kind of magic needs to be done to get it to work. 

But, assuming it's living on /dev/hda3, or /dev/hdb1, the problems could be related to grub not mapping the devices the same way you expect them to. have you looked at your system map under grub? (or do you use lilo?)

I'm thinking you are using your KNOPPIX CD to try to fix your system? Is that so? If so, you should be able to mount your old system according to the gentoo handbook and chroot into it. Then re-compile your kernel as needed. 

Keep us posted!

----------

## wbrokow1

I may not be saying this correctly, but my /usr, /var, /opt, /tmp, /home are on the drives 

I can't mount.

I can't get to /usr/src/linux. I can only get to /boot and some backup drive.

lvm was built into the kernel!

Please spoon feed me on this; what do I have to do to "mount my old system and chroot" into it.  I can't run make menuconfig.  My old kernel won't run.

Thanks for your help, what's next?

----------

## NeddySeagoon

wbrokow1,

You need to obtain a kernel with lvm support built elsewhere.

Your toolchain is inside the lvm partitions you are unable to mount. This means 'elsewhere' is another Linux PC or in some spare space on the partitions you can mount.

Building the kernel on another PC is easy ... you build it just as you would locally then move it into /boot using the network, a USB drive or some other removable media. If you don't have another PC, you can do a stage 3 install into a file  (not a partition).  You cannot boot such an install but a untaring a stage 3 provides all you need to build the kernel and you can get the kernel sources from kernel.org. 

Lastly, your swap space is about 1Gb. You can untar a stage 3 there and do a kernel build. Your system may not be happy running swapless but that depends on the amout of RAM you have. This build could be bootable too.

Don't do anything yet, consider your options and post back, I'll provide more detail when I know what you want to do.

----------

## swingkyd

 *wbrokow1 wrote:*   

> I may not be saying this correctly, but my /usr, /var, /opt, /tmp, /home are on the drives I can't mount.
> 
> I can't get to /usr/src/linux. I can only get to /boot and some backup drive.
> 
> lvm was built into the kernel!
> ...

 

Okay, you cannot get to /usr where /usr/linux lives I'm assuming because your LVM drives are not mounted properly. 

 you can rebuild your system but it's probably easier to use a boot CD like the Gentoo minimal CD and use the F1 key on boot to find the correct image which has LVM in the kernal and loaded. CHROOTING is covered in the Gentoo Handbook. LVM is covered in the LVM guide. If you haven't already, you really ought to read those and it will most likely make very clear what you need to do.  

Once you have CHROOTed into your existing system, you'll have to modify your fstab correctly to mount your LVM volumes. Once you have all your partitions mounted correctly, /usr/src/linux will be back. then re-compile your kernel after a "make clean."

... you know, it really would be easier to be sitting at your machine to figure this out  :Wink: 

BUT:

if you truly feel that you have "lost" your system, then rebuilding your system really might be the only solution. I suspect it really isn't the case and it's really just something wrong with your grub and system map. Did you change any of your physical locations of your drives before all this happened? ie: did you swap locations of physical drives, etc.

----------

## wbrokow1

neddyseagoon,

I have a functioning drive that I can load and build a kernel on.

I retrieved 2.6.23.1 from kernel.org and untarred into a directory.

What's next?

Thanks very much.

----------

## NeddySeagoon

wbrokow1,

Make the kernel in the normal manual way.

```
cd 
```

to the top of the kernel tree,

run 

```
make menuconfig
```

buld into the kernel everything you need to boot.

Thats high level disk driver support (SCSI)

Low level disk support ... your SATA chip set.

Your root filesystem driver

and last but not least, LVM support.

Build your new kernel and install it to /boot beside your other kernels.

Add it to grub.conf so its a new choice on the grub menu.

Set it to use your LVM partition as root, as you would normally.

There is one catch .. your /lib/modules is on your unmountable LVM root partition, so you cannot install any modules

for this kernel. When it boots, you will get a lot of errors related to missing modules thats to be expected.

With your root mounted you can rebuild your normal kernel

----------

## wbrokow1

Ok, I booted into the livecd and by some miracle I can get to the /usr/src/linux directory of the installation that was on my system not the livecd's.  but when I try make menuconfig I get some errors. I will type them out since I am another

computer.

```

/mnt/livecd/usr/src/linux-2.6.22-gentoo-r8/scripts/gcc-version.sh: line 11: tail: command not found 

*gcc-config: Profile does not exist or invalid setting for /etc/env.d/gcc/i686-pc-linux-gnu-4.1.1 

gcc-config error: could not run/locate "gcc"

```

then the error above repeats with "line 12" instead of "line 11"

```

HOSTCC scripts/basic/fixdep 

*gcc-config: Profile does not exist or invalid setting for /etc/env.d/gcc/i686-pc-linux-gnu-4.1.1

*gcc-config error: could not run/locate "gcc"

make[1]: *** [scripts/basic/fixdep] Error 1

make : *** [scripts/basic/fixdep] Error 2

```

----------

## NeddySeagoon

wbrokow1,

Your problem is caused by not being in the chroot. Boot the same way again, so your LVM volumes are available and follow  this guide to get into the chroot. You will have to change the mount commands to suite your system.

You are now back in your system on top of the kernel and services provided by the liveCD and can rebuild or emerge a new kernel in the normal way.

----------

## swingkyd

 *NeddySeagoon wrote:*   

> 
> 
> There is one catch .. your /lib/modules is on your unmountable LVM root partition, so you cannot install any modules for this kernel. When it boots, you will get a lot of errors related to missing modules thats to be expected.

 

'sfunny because I have my /usr/lib/modules living on an LVM partition and I don't seem to get any error messages. where might I find them? just on the scroll back?

----------

## NeddySeagoon

swingkyd,

You won't miss them ... its all the  red  [!!] in place of the green [ok] as the boot progresses.

Of course, if you have a monolithic kernel, there are no modules to fail to load.

The error is caused by /lib/modules/`uname -r`/... not existing for the kernel being booted.

If you are using the same kernel for the rescue as you normally boot, it will find the existing  /lib/modules/`uname -r`/... and all will be well.

----------

## swingkyd

 *NeddySeagoon wrote:*   

> swingkyd,
> 
> You won't miss them ... its all the  red  [!!] in place of the green [ok] as the boot progresses.
> 
> Of course, if you have a monolithic kernel, there are no modules to fail to load.
> ...

 

ahah... alright. thanks! I'll keep my eye out for the red.

It could be that the modules that I have compiled with the kernel don't get loaded until stage 3 or so. All others I like to keep in the kernel.

but like you say...it's only on the rescue image that will cause issues.

----------

## wbrokow1

Thanks for the help!

I was able to chroot and rebuild the kernel (2.6.22. :Cool: .

Nvidia-drivers also are working.

I will mark this as solved.

Thanks very much,. again.

 :Razz: 

----------

