花了一天的时间,终于把centos5的linux内核版本从2.6.18升级到3.4. 升级后,系统更加稳定.
具体步骤:
# wget http://www.kernel.org/pub/linux/kernel/v3.x/linux-3.4.tar.gz
# tar zxvf linux-3.4.tar.gz -C /usr/src
# cd /usr/src/linux-3.4
# make menuconfig
# make
# make modules_install
# cp arch/x86_64/boot/bzImage /boot/vmlinuz-3.4
# mkinitrd /boot/initrd-3.4.img 3.4.0
# 把新编译的内核加到/etc/grub.conf
default=0
timeout=5
splashimage=(hd0,2)/boot/grub/splash.xpm.gz
hiddenmenu
title Centos5 (3.4.0)
root (hd0,2)
kernel /boot/vmlinuz-3.4 ro root=LABEL=/1 rhgb quiet
initrd /boot/initrd-3.4.img
title Centos5 (2.6.18-53.el5)
root (hd0,2)
kernel /boot/vmlinuz-2.6.18-53.el5 ro root=LABEL=/1 rhgb quiet
initrd /boot/initrd-2.6.18-53.el5.img
# reboot
下面是一些经验:
1. gcc的版本仍然是centos5的版本
2. 如果编译完重启后出现mount:could not find filesystem /dev/root的错误,解决办法是:
重新make menuconfig, 使CONFIG_SYSFS_DEPRECATED_V2=y(可以打开文件.config验证)
linux内核升级到3.4
最新推荐文章于 2021-07-04 10:35:07 发布