CentOS升级kernel
升级命令:
1 yum update kernel2 yum update kernel-devel3 yum update kernel-firmware4 yum update kernel-headers
查看内核版本命令:
1 uname -r
Linux 内核配置文件:
1 [root@yjn ~]# cat /etc/grub.conf 2 # grub.conf generated by anaconda 3 # 4 # Note that you do not have to rerun grub after making changes to this file 5 # NOTICE: You do not have a /boot partition. This means that 6 # all kernel and initrd paths are relative to /, eg. 7 # root (hd0,0) 8 # kernel /boot/vmlinuz-version ro root=/dev/vda1 9 # initrd /boot/initrd-[generic-]version.img10 #boot=/dev/xvda11 default=012 timeout=513 splashimage=(hd0,0)/boot/grub/splash.xpm.gz14 hiddenmenu15 title CentOS (2.6.32-696.23.1.el6.x86_64)16 root (hd0,0)17 kernel /boot/vmlinuz-2.6.32-696.23.1.el6.x86_64 ro root=UUID=94e4e384-0ace-437f-bc96-057dd64f42ee rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet18 initrd /boot/initramfs-2.6.32-696.23.1.el6.x86_64.img19 title CentOS (2.6.32-696.10.1.el6.x86_64)20 root (hd0,0)21 kernel /boot/vmlinuz-2.6.32-696.10.1.el6.x86_64 ro root=UUID=94e4e384-0ace-437f-bc96-057dd64f42ee rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet22 initrd /boot/initramfs-2.6.32-696.10.1.el6.x86_64.img
default=0 这个就是制定选择那个版本的内核。
title默认的是0开始,选择对应的版本后,reboot。问题
如果升级有问题,请检查一下几个文件:
1.linux内核配置文件要有相应版本
2./boot/
3./lib/module/版本
以上目录如果更新的不完整,将正确的拷贝过来,重启即可。
原理