好景不长,笔记本升级失败,今天打开虚拟机也出错了,费解。都出现如下错误。
【基于 Centos 5.7 i386 虚拟512内存】
内核升级,简洁版,亲测成功,网上有很多文章了。就不详细描述了。
上http://www.kernel.org/选择一个稳定版
#安装依赖包
- #yum install gcc ncurses-devel
- #tar -zxf linux-2.6.33.20.tar.gz -C /usr/src/
- #cd /usr/src/linux-2.6.33.20
#去除内核的依赖关系以及编译后的垃圾信息
- #make mrproper
#拷贝/boot/config-2.6.18-274.el5 为/usr/src/linux-2.6.33.20/.config
- #cp /boot/config-2.6.18-274.el5 .config
#进入菜单方式界面配置内核
- # make menuconfig
#选中倒数第二项,自动加载刚才拷贝的文件.config
选中OK之后继续配置,点开每项之后又详细的,比如选择ext4 支持等。注意:需要勾选上General Setup下面的“enable deprecated sysfs features to support old userspace tools”,不然编译安装之后会找不到原来的挂载点。[参考]
#然后编译内核、编译模块、安装模块、安装内核,注意是在linux-2.6.33.20/
#这步编译有点久,虚拟机用了接近一个小时。
- #make
- #make modules && make modules_install && make install
#完成之后,会提示成功。查看grub.cnf 已经添加了,把default=0 设为0,重启,默认加载新内核。不修改的话,还是加载旧内核。
- #vim /boot/grub/grub.conf
- #boot=/dev/sda
- default=0
- timeout=5
- splashimage=(hd0,0)/grub/splash.xpm.gz
- hiddenmenu
- title CentOS (2.6.33.20)
- root (hd0,0)
- kernel /vmlinuz-2.6.33.20 ro root=/dev/VolGroup00/LogVol00
- initrd /initrd-2.6.33.20.img
- title CentOS (2.6.18-274.el5)
- root (hd0,0)
- kernel /vmlinuz-2.6.18-274.el5 ro root=/dev/VolGroup00/LogVol00
- initrd /initrd-2.6.18-274.el5.img
重启系统,亲测成功
参考: http://www.liusuping.com/ubuntu-linux/redhat-linux-kernel-update.html
http://xugang.blog.51cto.com/400032/95621