找不到网卡eth1

这一次安装服务器时出了一件非常奇怪的事情:明明有两个网卡,安装完操作系统后,另一个却找不到了。

主板信息:Intel 1200BTL

网卡型号:82574L / 82579DM?

操作系统:LinuxCentOS 5.5

系统内核:2.6.18-194.el5

在COMOS中可以看到两个网卡的HWAddr,即MAC地址。启动后,发现只有一个网卡的ifcfg-eth0启动程序。显示那个网卡是82574L。另一个本该出现的eth1不见了。


查看网卡信息的命令如下:

1)ifconfig -a

2)lspci -v

3)ethtool -i eth0

4)ifup ./eth0

5)setup

6)mii-tool

7)dmesg |grep eth (这个是位于/var/logs/dmesg中的记录)

8)cat /var/log/messages |grep eth(可能会有,可能会没有)

9)ls /sys/class/net (可以看到net相关的设备,还是没有eth1)

10)/sbin/lspci |grep Eth
00:19.0 Ethernet controller: Intel Corporation Unknown device 1502 (rev 05)
02:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection

第10个这个Eth中,E要大写。显然是能找到二张网卡的,但是却无法启用它。

find /lib/modules/2.6.18-194.el5/ -name "e1000e*"
/lib/modules/2.6.18-194.el5/kernel/drivers/net/e1000e
/lib/modules/2.6.18-194.el5/kernel/drivers/net/e1000e/e1000e.ko
 

11) /sbin/lsmod |grep e1000
e1000e                161057  0
 

这位的几年前发的跟我的情况差不多:http://www.linuxsir.org/bbs/thread342545.html


下载、编译、安装网卡的过程如下:

第一步:找到正确的网卡驱动程序,如xxxx-1.9.5.tar.gz

第二步:使用ftp或直接在服务器上wget等把这个驱动程序上传到服务器中

第三步:解压缩tar -zxvf xxxx-1.9.5.tar.gz

第四步:cd xxxx-1.9.5/src

第五步:make

第六步:insmod ./xxx.ko(Linux 2.6内核中,xxx.ko就是编译好的驱动程序了,这是测试是否可用)

第七步:make install

第八步:/sbin/service network restart

 

以上的过程中会有很多错误,我遇到的如下:

出错信息1:insmod: error inserting './igb.ko': -1 Unknown symbol in module

是由于模块依赖的其他模块没有加载导致的。处理过程如下:

1)/sbin/modinfo  ./igb.ko | grep depend

结果是:depends: 8021q

2)/sbin/modprobe 8021q

3)insmod ./igb.ko

附:《模块加载常见错误》
1.
insmod: error inserting './igb.ko': -1 Unknown symbol in module           --->    依赖的模块没有加载,需要先加载 depends 中列出的模块


2.
insmod: error inserting './igb.ko': -1 Operation not permitted                --->    这当然是你用普通用户执行才出现的错误咯
3.
insmod: error inserting './igb.ko': -1 Invalid module format                    --->    模块的vermagic(就是编译内核的环境的内核版本)和当前系统不相匹配
4.
insmod: error inserting './aacraid.ko': -1 No such device                       --->    模块是对的,只是没有相应的设备

呵呵,其他的还没收集,等想起来了再加上。

 

这部分出错信息原文引自:http://hi.baidu.com/jhb405759179/item/5720e295049e0ddc7b7f01e2

出错信息2:在make时

Makefile:71: *** Kernel header files not in any of the expected locations.
Makefile:72: *** Install the appropriate kernel development package, e.g.
Makefile:73: *** kernel-devel, for building kernel modules and try again.  Stop.
这是因为它找不到kernel header文件导致的,这时要修改一下Makefile

# vi Makefile

KSP :=  /lib/modules/$(BUILD_KERNEL)/build

        /lib/modules/$(BUILD_KERNEL)/source

        /lib/modules/$(BUILD_KERNEL)-default/build

        /usr/src/linux-$(BUILD_KERNEL)

        /usr/src/linux-$($(BUILD_KERNEL) | sed 's/-.*//')

        /usr/src/kernel-headers-$(BUILD_KERNEL)

        /usr/src/kernel-source-$(BUILD_KERNEL)

        /usr/src/linux-$($(BUILD_KERNEL) | sed 's/([0-9]*.[0-9]*)..*/1/')

        /usr/src/linux

修改为:

KSP :=  /lib/modules/$(BUILD_KERNEL)/build
        /lib/modules/$(BUILD_KERNEL)/source
        /lib/modules/$(BUILD_KERNEL)-default/build
        /usr/src/linux-$(BUILD_KERNEL)
        /usr/src/linux-$($(BUILD_KERNEL) | sed 's/-.*//')
        /usr/src/kernel-headers-$(BUILD_KERNEL)
        /usr/src/kernel-source-$(BUILD_KERNEL)
        /usr/src/linux-$($(BUILD_KERNEL) | sed 's/([0-9]*.[0-9]*)..*/1/')
        /usr/src/linux
        /usr/src/kernels/2.6.18-371.8.1.el5-x86_64

新安装的kernel headers都在这后面的目录里,前面的目录中都没有。前面的空白是一个tab,不要用空格来代替,否则会出错的。

上面的那个/usr/src/linux里面是空的。从下面可以看到,编译的c语言源代码中要求访问这个目录,以找到kernel的头文件。于是有人建议在其下创建一个软链接。

# ln -s 2.6.18-194.el5-x86_64 /usr/src/kernels/2.6.18-371.8.1.el5-x86_64

就能解决找不到头文件的错误(kernel headers)。

 

出错信息3:service network restart时,Bringing up interface eth1:  Device eth1 does not seem to be present,delaying initialization. [FAILED]

一直是这个错误,很多人说修改/etc/udev下面的那个文件就可以。对我这台服务器无效。显然不是同一类错误。

 


下面是一些实际读出的结果

/sbin/lspci | grep -i network

看看是什么型号的网站,结果还是看到eth0那个:02:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection

[root@localhost network-scripts]# /sbin/mii-tool
SIOCGMIIREG on eth0 failed: Input/output error
eth0: negotiated 100baseTx-FD, link ok
 

[root@localhost network-scripts]# dmesg |grep eth
eth0: (PCI Express:2.5GB/s:Width x1) 00:1e:67:aa:1b:78
eth0: Intel(R) PRO/1000 Network Connection
eth0: MAC: 3, PHY: 8, PBA No: 1000ff-0ff
ADDRCONF(NETDEV_UP): eth0: link is not ready
e1000e: eth0 NIC Link is Up 100 Mbps Full Duplex, Flow Control: None
eth0: 10/100 speed: disabling TSO
ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
eth0: no IPv6 routers present
ADDRCONF(NETDEV_UP): eth0: link is not ready
e1000e: eth0 NIC Link is Up 100 Mbps Full Duplex, Flow Control: None
eth0: 10/100 speed: disabling TSO
ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
eth0: no IPv6 routers present
ADDRCONF(NETDEV_UP): eth0: link is not ready
e1000e: eth0 NIC Link is Up 100 Mbps Full Duplex, Flow Control: None
eth0: 10/100 speed: disabling TSO
ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
eth0: no IPv6 routers present

 

[root@localhost network-scripts]# /sbin/ethtool -i eth1
Cannot get driver information: No such device


[root@localhost network-scripts]# /sbin/ethtool -i eth0
driver: e1000e
version: 1.0.2-k3
firmware-version: 2.1-0
bus-info: 0000:02:00.0

 


可能的原因是什么呢?

1、/etc/udev/rules.d/70-persistent-net.rules里面写错了

这台服务器上没有这个文件

2、网卡没有安装好驱动

3、网卡只有一个,是一卡两口模式的

4、另一个网卡坏了

5、修改/etc/modules.conf或/etc/modprobe.conf,在里面添加eth1的别名就可以

实际上,我也试过,不行,现在的内容如下:

alias eth0 e1000e

alias eth1 e1000e (原来没有,添加后重启网络会报错,说这个别名的eth1不存在)
alias scsi_hostadapter megasr
alias scsi_hostadapter1 usb-storage
 

6、kernel header的问题

在解压缩的驱动源文件目录下,有个src的目录,编译是在这里进行的。这里的文件如下:

[root@localhost src]# ls -lh
total 12M
-rw-r--r-- 1 root root  38K Jan 31 18:50 80003es2lan.c
-rw-r--r-- 1 root root 3.5K Jan 31 18:50 80003es2lan.h
-rw-r--r-- 1 root root 262K Jun  7 13:05 80003es2lan.o
-rw-r--r-- 1 root root  55K Jan 31 18:50 82571.c
-rw-r--r-- 1 root root 2.1K Jan 31 18:50 82571.h
-rw-r--r-- 1 root root 293K Jun  7 13:05 82571.o
-rw-r--r-- 1 root root  33K Jan 31 18:50 defines.h
-rw-r--r-- 1 root root 3.8K Jun  7 13:05 e1000e.7.gz
-rw-r--r-- 1 root root 3.5M Jun  7 13:05 e1000e.ko
-rw-r--r-- 1 root root 7.8K Jun  7 13:05 e1000e.mod.c
-rw-r--r-- 1 root root 100K Jun  7 13:05 e1000e.mod.o
-rw-r--r-- 1 root root 3.5M Jun  7 13:05 e1000e.o
-rw-r--r-- 1 root root  21K Jan 31 18:50 e1000.h
-rw-r--r-- 1 root root  72K Jan 31 18:50 ethtool.c
-rw-r--r-- 1 root root 332K Jun  7 13:05 ethtool.o
-rw-r--r-- 1 root root  17K Jan 31 18:50 hw.h
-rw-r--r-- 1 root root 141K Jan 31 18:50 ich8lan.c
-rw-r--r-- 1 root root  13K Jan 31 18:50 ich8lan.h
-rw-r--r-- 1 root root 419K Jun  7 13:05 ich8lan.o
-rw-r--r-- 1 root root  34K Jan 31 18:50 kcompat.c
-rw-r--r-- 1 root root  29K Jan 31 18:50 kcompat_ethtool.c
-rw-r--r-- 1 root root 117K Jan 31 18:50 kcompat.h
-rw-r--r-- 1 root root 228K Jun  7 13:05 kcompat.o
-rw-r--r-- 1 root root  53K Jan 31 18:50 mac.c
-rw-r--r-- 1 root root 3.2K Jan 31 18:50 mac.h
-rw-r--r-- 1 root root 278K Jun  7 13:05 mac.o
-rw-r--r-- 1 root root  12K Jun 10 16:56 Makefile
-rw-r--r-- 1 root root 9.4K Jan 31 18:50 manage.c
-rw-r--r-- 1 root root 2.4K Jan 31 18:50 manage.h
-rw-r--r-- 1 root root 209K Jun  7 13:05 manage.o
-rw-r--r-- 1 root root    0 Jun  7 13:05 Module.markers
-rw-r--r-- 1 root root   19 Jan 31 18:50 Module.supported
-rw-r--r-- 1 root root    0 Jun  7 13:05 Module.symvers
-rw-r--r-- 1 root root 229K Jan 31 18:50 netdev.c
-rw-r--r-- 1 root root 759K Jun  7 13:05 netdev.o
-rw-r--r-- 1 root root  16K Jan 31 18:50 nvm.c
-rw-r--r-- 1 root root 1.8K Jan 31 18:50 nvm.h
-rw-r--r-- 1 root root 226K Jun  7 13:05 nvm.o
-rw-r--r-- 1 root root  17K Jan 31 18:50 param.c
-rw-r--r-- 1 root root 229K Jun  7 13:05 param.o
-rw-r--r-- 1 root root  88K Jan 31 18:50 phy.c
-rw-r--r-- 1 root root  11K Jan 31 18:50 phy.h
-rw-r--r-- 1 root root 293K Jun  7 13:05 phy.o
-rw-r--r-- 1 root root 7.7K Jan 31 18:50 ptp.c
-rw-r--r-- 1 root root  14K Jan 31 18:50 regs.h
开始编译的时候,会出现找不到kernel headers的错误,于是修改了Makefile中的目录,见上文。

 

#include
#include
#include
#include
#include
#include "kcompat.h"
#ifdef HAVE_HW_TIME_STAMP
#include
#include
#endif
#ifdef HAVE_PTP_1588_CLOCK
#include
#include
#endif
#include
#ifdef ETHTOOL_GEEE
#include
#endif
#include "hw.h"
 


0000:02:00.0]# ll
total 0
-rw-r--r-- 1 root root   4096 Jun 12 10:49 broken_parity_status
lrwxrwxrwx 1 root root      0 Jun 12 10:49 bus -> ../../../../bus/pci
-r--r--r-- 1 root root   4096 Jun  8 23:49 class
-rw-r--r-- 1 root root   4096 Jun 12 10:14 config
-r--r--r-- 1 root root   4096 Jun 12 10:14 device
lrwxrwxrwx 1 root root      0 Jun 12 10:49 driver -> ../../../../bus/pci/drivers/e1000e
-rw------- 1 root root   4096 Jun 12 10:49 enable
-r--r--r-- 1 root root   4096 Jun  8 23:49 irq
-r--r--r-- 1 root root   4096 Jun  8 23:49 local_cpus
-r--r--r-- 1 root root   4096 Jun 12 10:49 modalias
lrwxrwxrwx 1 root root      0 Jun 12 10:49 net:eth0 -> ../../../../class/net/eth0
drwxr-xr-x 2 root root      0 Jun  7 16:02 power
-r--r--r-- 1 root root   4096 Jun 12 10:14 resource
-rw------- 1 root root 131072 Jun 12 10:49 resource0
-rw------- 1 root root     32 Jun 12 10:49 resource2
-rw------- 1 root root  16384 Jun 12 10:49 resource3
lrwxrwxrwx 1 root root      0 Jun 12 10:49 subsystem -> ../../../../bus/pci
-r--r--r-- 1 root root   4096 Jun 12 10:49 subsystem_device
-r--r--r-- 1 root root   4096 Jun 12 10:49 subsystem_vendor
--w------- 1 root root   4096 Jun 12 10:49 uevent
-r--r--r-- 1 root root   4096 Jun 12 10:14 vendor
上面是正常的那个网卡的主板信息

0000:00:19.0]# ll
total 0
-rw-r--r-- 1 root root   4096 Jun 12 10:48 broken_parity_status
lrwxrwxrwx 1 root root      0 Jun 12 10:48 bus -> ../../../bus/pci
-r--r--r-- 1 root root   4096 Jun  8 23:49 class
-rw-r--r-- 1 root root    256 Jun 12 10:14 config
-r--r--r-- 1 root root   4096 Jun 12 10:14 device
-rw------- 1 root root   4096 Jun 12 10:48 enable
-r--r--r-- 1 root root   4096 Jun  8 23:49 irq
-r--r--r-- 1 root root   4096 Jun  8 23:54 local_cpus
-r--r--r-- 1 root root   4096 Jun 12 10:48 modalias
drwxr-xr-x 2 root root      0 Jun  7 16:02 power
-r--r--r-- 1 root root   4096 Jun 12 10:14 resource
-rw------- 1 root root 131072 Jun 12 10:48 resource0
-rw------- 1 root root   4096 Jun 12 10:48 resource1
-rw------- 1 root root     32 Jun 12 10:48 resource2
lrwxrwxrwx 1 root root      0 Jun 12 10:48 subsystem -> ../../../bus/pci
-r--r--r-- 1 root root   4096 Jun 12 10:48 subsystem_device
-r--r--r-- 1 root root   4096 Jun 12 10:48 subsystem_vendor
--w------- 1 root root   4096 Jun 12 10:48 uevent
-r--r--r-- 1 root root   4096 Jun 12 10:14 vendor
 既然这没有用,干脆把它unbind吧(参照:http://blog.chinaunix.net/uid-20357359-id-1963557.html)

echo -n "0000:00:19.0" > unbind

bash: unbind: Permission denied
 

其实看看这里,也知道这个0000:00:19.0是有问题的,而那个0000:02:00.0是正确的

[root@localhost devices]# ls -lh
total 0
0000:00:00.0 -> ../../../devices/pci0000:00/0000:00:00.0
0000:00:19.0 -> ../../../devices/pci0000:00/0000:00:19.0(这个是第二块网卡,不能正常工作)
0000:00:1a.0 -> ../../../devices/pci0000:00/0000:00:1a.0
0000:00:1c.0 -> ../../../devices/pci0000:00/0000:00:1c.0(怀疑这个是否可以与eth1关联)
0000:00:1c.4 -> ../../../devices/pci0000:00/0000:00:1c.4(这个与eth0关联了)
0000:00:1c.5 -> ../../../devices/pci0000:00/0000:00:1c.5(这个与vga关联了)
0000:00:1d.0 -> ../../../devices/pci0000:00/0000:00:1d.0
0000:00:1e.0 -> ../../../devices/pci0000:00/0000:00:1e.0
0000:00:1f.0 -> ../../../devices/pci0000:00/0000:00:1f.0
0000:00:1f.2 -> ../../../devices/pci0000:00/0000:00:1f.2
0000:00:1f.3 -> ../../../devices/pci0000:00/0000:00:1f.3
0000:02:00.0 -> ../../../devices/pci0000:00/0000:00:1c.4/0000:02:00.0(这是eth0,能正常工作)
0000:03:00.0 -> ../../../devices/pci0000:00/0000:00:1c.5/0000:03:00.0(这是VGA显示卡)

不让unbind,那就bind吧,也不成,如下:

echo -n "0000:00:19.0" > bind

bash: bind: Permission denied


tree /sys/bus/pci

|   |-- e1000e(这是能正常工作的eth0)
|   |   |-- 0000:02:00.0 -> ../../../../devices/pci0000:00/0000:00:1c.4/0000:02:00.0
|   |   |-- bind
|   |   |-- module -> ../../../../module/e1000e
|   |   |-- new_id
|   |   |-- remove_id
|   |   `-- unbind
|   |-- ehci_hcd
|   |   |-- 0000:00:1a.0 -> ../../../../devices/pci0000:00/0000:00:1a.0
|   |   |-- 0000:00:1d.0 -> ../../../../devices/pci0000:00/0000:00:1d.0
|   |   |-- bind
|   |   |-- module -> ../../../../module/ehci_hcd
|   |   |-- new_id
|   |   |-- remove_id
|   |   `-- unbind
|   |-- igb(这是手工编译安装的网卡驱动,看来是无用的)
|   |   |-- bind
|   |   |-- module -> ../../../../module/igb
|   |   |-- new_id
|   |   |-- remove_id
|   |   `-- unbind
|   |-- igbvf (这是手工编译安装的网卡驱动,看来是无用的)
|   |   |-- bind
|   |   |-- module -> ../../../../module/igbvf
|   |   |-- new_id
|   |   |-- remove_id
|   |   `-- unbind
|   |-- megasr  (这个是RAID卡)
|   |   |-- 0000:00:1f.2 -> ../../../../devices/pci0000:00/0000:00:1f.2
|   |   |-- bind
|   |   |-- module -> ../../../../module/megasr
|   |   |-- new_id
|   |   |-- remove_id
|   |   `-- unbind
 

是不是可以手动添加那个软链接呢?

0000:02:00.0 -> ../../../devices/pci0000:00/0000:00:1c.4/0000:02:00.0
0000:03:00.0 -> ../../../devices/pci0000:00/0000:00:1c.5/0000:03:00.0
不过,这个0000:00:1c.4是哪里来的呢?我们要添的软链接中对应的参数是什么呢?即

ln -s 0000:19:00.0 ../../../devices/pci0000:00/????:??:??.?/0000:19:00.0

 

使用命令/sbin/lspci -n来查看,没有收获。如下:
00:00.0 0600: 8086:0150 (rev 09)
00:19.0 0200: 8086:1502 (rev 05)(当前不能正常工作的网卡)
00:1a.0 0c03: 8086:1c2d (rev 05)
00:1c.0 0604: 8086:1c10 (rev b5)
00:1c.4 0604: 8086:1c18 (rev b5)
00:1c.5 0604: 8086:1c1a (rev b5)
00:1d.0 0c03: 8086:1c26 (rev 05)
00:1e.0 0604: 8086:244e (rev a5)
00:1f.0 0601: 8086:1c54 (rev 05)
00:1f.2 0104: 8086:1c04 (rev 05)
00:1f.3 0c05: 8086:1c22 (rev 05)
02:00.0 0200: 8086:10d3(当前正常工作的网卡)
03:00.0 0300: 102b:0522 (rev 07)

根据上面的发现,初步想把?换成0000:00:1c.0,如果失败了,会有什么风险?会导致服务器崩溃吗?


/sbin/modinfo e1000e
filename:       /lib/modules/2.6.18-194.el5/kernel/drivers/net/e1000e/e1000e.ko
version:        1.0.2-k3
license:        GPL
description:    Intel(R) PRO/1000 Network Driver
author:         Intel Corporation,
srcversion:     36D9C555BAD072CEBA25825
alias:          pci:v00008086d000010F0sv*sd*bc*sc*i*
alias:          pci:v00008086d000010EFsv*sd*bc*sc*i*
alias:          pci:v00008086d000010EBsv*sd*bc*sc*i*
alias:          pci:v00008086d000010EAsv*sd*bc*sc*i*
alias:          pci:v00008086d000010DFsv*sd*bc*sc*i*
alias:          pci:v00008086d000010DEsv*sd*bc*sc*i*
alias:          pci:v00008086d000010CEsv*sd*bc*sc*i*
alias:          pci:v00008086d000010CDsv*sd*bc*sc*i*
alias:          pci:v00008086d000010CCsv*sd*bc*sc*i*
alias:          pci:v00008086d000010CBsv*sd*bc*sc*i*
alias:          pci:v00008086d000010F5sv*sd*bc*sc*i*
alias:          pci:v00008086d000010BFsv*sd*bc*sc*i*
alias:          pci:v00008086d000010E5sv*sd*bc*sc*i*
alias:          pci:v00008086d0000294Csv*sd*bc*sc*i*
alias:          pci:v00008086d000010BDsv*sd*bc*sc*i*
alias:          pci:v00008086d000010C3sv*sd*bc*sc*i*
alias:          pci:v00008086d000010C2sv*sd*bc*sc*i*
alias:          pci:v00008086d000010C0sv*sd*bc*sc*i*
alias:          pci:v00008086d00001501sv*sd*bc*sc*i*
alias:          pci:v00008086d00001049sv*sd*bc*sc*i*
alias:          pci:v00008086d0000104Dsv*sd*bc*sc*i*
alias:          pci:v00008086d0000104Bsv*sd*bc*sc*i*
alias:          pci:v00008086d0000104Asv*sd*bc*sc*i*
alias:          pci:v00008086d000010C4sv*sd*bc*sc*i*
alias:          pci:v00008086d000010C5sv*sd*bc*sc*i*
alias:          pci:v00008086d0000104Csv*sd*bc*sc*i*
alias:          pci:v00008086d000010BBsv*sd*bc*sc*i*
alias:          pci:v00008086d00001098sv*sd*bc*sc*i*
alias:          pci:v00008086d000010BAsv*sd*bc*sc*i*
alias:          pci:v00008086d00001096sv*sd*bc*sc*i*
alias:          pci:v00008086d0000150Csv*sd*bc*sc*i*
alias:          pci:v00008086d000010F6sv*sd*bc*sc*i*
alias:          pci:v00008086d000010D3sv*sd*bc*sc*i*
alias:          pci:v00008086d0000109Asv*sd*bc*sc*i*
alias:          pci:v00008086d0000108Csv*sd*bc*sc*i*
alias:          pci:v00008086d0000108Bsv*sd*bc*sc*i*
alias:          pci:v00008086d0000107Fsv*sd*bc*sc*i*
alias:          pci:v00008086d0000107Esv*sd*bc*sc*i*
alias:          pci:v00008086d0000107Dsv*sd*bc*sc*i*
alias:          pci:v00008086d000010B9sv*sd*bc*sc*i*
alias:          pci:v00008086d000010D5sv*sd*bc*sc*i*
alias:          pci:v00008086d000010DAsv*sd*bc*sc*i*
alias:          pci:v00008086d000010D9sv*sd*bc*sc*i*
alias:          pci:v00008086d00001060sv*sd*bc*sc*i*
alias:          pci:v00008086d000010A5sv*sd*bc*sc*i*
alias:          pci:v00008086d000010BCsv*sd*bc*sc*i*
alias:          pci:v00008086d000010A4sv*sd*bc*sc*i*
alias:          pci:v00008086d0000105Fsv*sd*bc*sc*i*
alias:          pci:v00008086d0000105Esv*sd*bc*sc*i*
depends:
vermagic:       2.6.18-194.el5 SMP mod_unload gcc-4.1
parm:           copybreak:Maximum size of packet that is copied to a new buffer                                                                                                                                 on receive (uint)
parm:           TxIntDelay:Transmit Interrupt Delay (array of int)
parm:           TxAbsIntDelay:Transmit Absolute Interrupt Delay (array of int)
parm:           RxIntDelay:Receive Interrupt Delay (array of int)
parm:           RxAbsIntDelay:Receive Absolute Interrupt Delay (array of int)
parm:           InterruptThrottleRate:Interrupt Throttling Rate (array of int)
parm:           IntMode:Interrupt Mode (array of int)
parm:           SmartPowerDownEnable:Enable PHY smart power down (array of int)
parm:           KumeranLockLoss:Enable Kumeran lock loss workaround (array of in                                                                                                                                t)
parm:           WriteProtectNVM:Write-protect NVM [WARNING: disabling this can l                                                                                                                                ead to corrupted NVM] (array of int)
parm:           CrcStripping:Enable CRC Stripping, disable if your BMC needs the                                                                                                                                 CRC (array of int)
module_sig:

有人说,是因为硬件比较新,操作系统比较老导致的。要尝试着升级操作系统,估计也是一件很难办的事情。因为RAID的驱动……


因为这个kernel-header的事情,我决定重新手动安装一下kernel-headers。首先是因为那个版本的变量是用$(uname -r)代替的,即绝对完全使用当前的kernel。CentOS5.5的kernel版本是2.6.18-194-el5,而使用yum安装的kernel版本是2.6.18-371.8.1.el5,还是有差别的。在/lib/modules下,是两个完全不同的目录。

第一步:获取kernel -header 的rpm安装包

wget http://vault.centos.org/5.5/centosplus/x86_64/RPMS/kernel-headers-2.6.18-194.el5.centos.plus.x86_64.rpm

 

第二步:安装

rpm -ivh kernel-headers-2.6.18-194.el5.centos.plus.x86_64.rpm

package kernel-headers-2.6.18-371.8.1.el5.x86_64 (which is newer than kernel-headers-2.6.18-194.el5.centos.plus.x86_64) is already installed
        file /usr/include/asm-i386/unistd.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/asm-x86_64/auxvec.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/asm-x86_64/cpufeature.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/asm-x86_64/mce.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/asm-x86_64/msr.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/asm-x86_64/signal.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/asm-x86_64/unistd.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/auto_fs4.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/auxvec.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/cciss_ioctl.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/connector.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/dm-ioctl.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/ethtool.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/ext2_fs.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/ext3_fs.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/fcntl.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/fs.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/gfs2_ondisk.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/if.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/if_bonding.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/if_bridge.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/if_ether.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/if_packet.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/in.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/ipmi_msgdefs.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/kernel.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/mii.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/nbd.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/net.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/netfilter/xt_dscp.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/netfilter_ipv6.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/nfs_fs.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/nfsd/const.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/pci_ids.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/pci_regs.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/random.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/resource.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/socket.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/sysctl.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/taskstats.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/tcp.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/types.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/version.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/virtio_blk.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/virtio_net.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/virtio_pci.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64
        file /usr/include/linux/xattr.h from install of kernel-headers-2.6.18-194.el5.centos.plus.x86_64 conflicts with file from package kernel-headers-2.6.18-371.8.1.el5.x86_64

 把那个newer的删除掉

yum remove -y kernel-headers

 

用tail /var/log/messages看一下,删除了这么多。晕。

Jun 12 20:42:56 localhost yum: Erased: pcmciautils
Jun 12 20:42:59 localhost yum: Erased: kernel
Jun 12 21:32:27 localhost yum: Erased: glibc-headers
Jun 12 21:32:27 localhost yum: Erased: kernel-headers
Jun 12 21:32:28 localhost yum: Erased: gcc-c++
Jun 12 21:32:28 localhost yum: Erased: gcc
Jun 12 21:32:29 localhost yum: Erased: glibc-devel
 

再来安装一下

wget http://vault.centos.org/5.5/centosplus/x86_64/RPMS/kernel-devel-2.6.18-194.el5.centos.plus.x86_64.rpm

rpm -ivh kernel-devel-2.6.18-194.el5.centos.plus.x86_64.rpm

又是不能安装,于是要

yum remove -y kernel-devel

再来看一看

Jun 12 20:42:56 localhost yum: Erased: pcmciautils
Jun 12 20:42:59 localhost yum: Erased: kernel
Jun 12 21:32:27 localhost yum: Erased: glibc-headers
Jun 12 21:32:27 localhost yum: Erased: kernel-headers
Jun 12 21:32:28 localhost yum: Erased: gcc-c++
Jun 12 21:32:28 localhost yum: Erased: gcc
Jun 12 21:32:29 localhost yum: Erased: glibc-devel
Jun 12 21:41:58 localhost yum: Erased: kernel-devel

又会出现找不到kernel headers的情况,修改驱动程序解压缩后的文件夹中的src目录下的Makefile

#vi Makefile

在下面这一段处添加红色的部分:

KSP := /lib/modules/$(BUILD_KERNEL)/build
/lib/modules/$(BUILD_KERNEL)/source
/lib/modules/$(BUILD_KERNEL)-default/build
/usr/src/linux-$(BUILD_KERNEL)
/usr/src/linux-$($(BUILD_KERNEL) | sed 's/-.*//')
/usr/src/kernel-headers-$(BUILD_KERNEL)
/usr/src/kernel-source-$(BUILD_KERNEL)
/usr/src/linux-$($(BUILD_KERNEL) | sed 's/([0-9]*.[0-9]*)..*/1/')
/usr/src/linux
/usr/src/kernels/2.6.18-194.el5.centos.plus-x86_64

不要忘记前面的空格是用tab,而不是一个一个的空格,否则也会报错。

 make
Makefile:131: *** Compiler not found.  Stop.

还记得前面我们删除了很多编译程序吗?现在又要来安装了。

#yum install -y gcc-c++ gcc glibc-devel

# cd /downloads/e1000e-3.0.4/src
 make
make -C /usr/src/kernels/2.6.18-194.el5.centos.plus-x86_64 SUBDIRS=/downloads/e1                                                                                                                                000e-3.0.4/src modules
make[1]: Entering directory `/usr/src/kernels/2.6.18-194.el5.centos.plus-x86_64'
  CC [M]  /downloads/e1000e-3.0.4/src/netdev.o
  CC [M]  /downloads/e1000e-3.0.4/src/ethtool.o
  CC [M]  /downloads/e1000e-3.0.4/src/param.o
  CC [M]  /downloads/e1000e-3.0.4/src/82571.o
  CC [M]  /downloads/e1000e-3.0.4/src/ich8lan.o
  CC [M]  /downloads/e1000e-3.0.4/src/80003es2lan.o
  CC [M]  /downloads/e1000e-3.0.4/src/mac.o
  CC [M]  /downloads/e1000e-3.0.4/src/nvm.o
  CC [M]  /downloads/e1000e-3.0.4/src/phy.o
  CC [M]  /downloads/e1000e-3.0.4/src/manage.o
  CC [M]  /downloads/e1000e-3.0.4/src/kcompat.o
  LD [M]  /downloads/e1000e-3.0.4/src/e1000e.o
  Building modules, stage 2.
  MODPOST
  CC      /downloads/e1000e-3.0.4/src/e1000e.mod.o
  LD [M]  /downloads/e1000e-3.0.4/src/e1000e.ko
make[1]: Leaving directory `/usr/src/kernels/2.6.18-194.el5.centos.plus-x86_64'
 

 

# /sbin/insmod ./e1000e.ko
insmod: error inserting './e1000e.ko': -1 File exists
[root@localhost src]# make install
make -C /usr/src/kernels/2.6.18-194.el5.centos.plus-x86_64 SUBDIRS=/downloads/e1000e-3.0.4/src modules
make[1]: Entering directory `/usr/src/kernels/2.6.18-194.el5.centos.plus-x86_64'
  Building modules, stage 2.
  MODPOST
make[1]: Leaving directory `/usr/src/kernels/2.6.18-194.el5.centos.plus-x86_64'
# remove all old versions of the driver
find /lib/modules/2.6.18-194.el5.centos.plus -name e1000e.ko -exec rm -f {} ; || true
find: /lib/modules/2.6.18-194.el5.centos.plus: No such file or directory
find /lib/modules/2.6.18-194.el5.centos.plus -name e1000e.ko.gz -exec rm -f {} ; || true
find: /lib/modules/2.6.18-194.el5.centos.plus: No such file or directory
install -D -m 644 e1000e.ko /lib/modules/2.6.18-194.el5.centos.plus/kernel/drivers/net/e1000e/e1000e.ko
/sbin/depmod -a || true
install -D -m 644 e1000e.7.gz /usr/share/man/man7/e1000e.7.gz
man -c -P'cat > /dev/null' e1000e || true
 

 

/sbin/insmod ./igb.ko
insmod: error inserting './igb.ko': -1 Unknown symbol in module
[root@localhost src]# /sbin/modinfo  ./igb.ko | grep depend
depends:        i2c-core,dca,i2c-algo-bit,8021q
 

 /sbin/modprobe i2c-core
FATAL: Module i2c_core not found.
 

 

Jun 12 22:13:52 localhost kernel: igb: Unknown symbol vlan_gro_receive
Jun 12 22:13:52 localhost kernel: igb: Unknown symbol dca_remove_requester
Jun 12 22:13:52 localhost kernel: igb: Unknown symbol i2c_bit_add_bus
Jun 12 22:13:52 localhost kernel: igb: Unknown symbol dca_add_requester
Jun 12 22:13:52 localhost kernel: igb: Unknown symbol dca_unregister_notify
Jun 12 22:13:52 localhost kernel: igb: Unknown symbol dca_register_notify
Jun 12 22:13:52 localhost kernel: igb: Unknown symbol dca3_get_tag
 


结果是,一直不能解决这个网卡的问题。安装CentOS 6.4,连RAID卡的驱动都不需要,两个网卡正常。

新问题是,缺省安装硬盘被分四个分区与原来的完全不一样。后面所有的软件编译参数要统统更换一遍。

/boot - 500M

/home - 980G

/ -50G

/dev/shm - 7.7G

以前都习惯将软件都安装在/根目录下的,现在这个分区只有50G,危险啊。

你可能感兴趣的:(Linux)