Centos7.x修改内核启动顺序方法可参考:https://www.zfcdn.xyz/showinfo-3-36123-0.html
1、查看centos6.x中是否存在多个内核的命令:
命令执行结果显示如下,我系统有三个内核,红色文字是内核名cat /etc/grub.conf
如图:# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,0)
# kernel /boot/vmlinuz-version ro root=/dev/sda1
# initrd /boot/initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.32-642.6.2.el6.x86_64)
root (hd0,0)
kernel /boot/vmlinuz-2.6.32-642.6.2.el6.x86_64 ro root=UUID=7928866e-2f2c-4f3d-8a32-e310f5ec0788 rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD quiet rhgb crashkernel=auto LANG=zh_CN.GBK rd_NO_LVM rd_NO_DM SYSFONT=latarcyrhed-sun16
initrd /boot/initramfs-2.6.32-642.6.2.el6.x86_64.img
title CentOS (2.6.32-220.4.1.el6.x86_64)
root (hd0,0)
kernel /boot/vmlinuz-2.6.32-220.4.1.el6.x86_64 ro root=UUID=7928866e-2f2c-4f3d-8a32-e310f5ec0788 rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD quiet rhgb crashkernel=auto LANG=zh_CN.gb2312 rd_NO_LVM rd_NO_DM
initrd /boot/initramfs-2.6.32-220.4.1.el6.x86_64.img
title CentOS (2.6.32-220.el6.x86_64)
root (hd0,0)
kernel /boot/vmlinuz-2.6.32-220.el6.x86_64 ro root=UUID=7928866e-2f2c-4f3d-8a32-e310f5ec0788 rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD quiet rhgb crashkernel=auto LANG=zh_CN.UTF-8 rd_NO_LVM rd_NO_DM
initrd /boot/initramfs-2.6.32-220.el6.x86_64.img
2、在修改前我们可以先查看下当前使用的是哪一个内核,执行如下命令:
表示使用了第一个内核,[root@blog_tag_gg ~]# uname -r
2.6.32-642.6.2.el6.x86_64
三个内核从上到下依次编号为:0、1、2 ,配置文件中可以看到如下指定:
表示将启动第一个内核,default=0
3、如果我们要启动第二个内核 :2.6.32-220.4.1.el6.x86_64 怎么做呢?很简单,直接将配置文件中的 default=0 改成 default=1保存即可,同理,若使用第三个内核,改成default=2即可,修改完后保存重启下服务器即可。
文章评论 本文章有个评论