Loading
0

Linux/Centos6.x更改系统内核启动顺序方法

301免备案跳转微信公众号
腾讯云服务器大促销。
华为服务器
前言:上一篇文章讲解了任何在centos7.x版本中更改内核启动顺序,这一篇文章将介绍在centos6.x系统下如何更改内核启动顺序,(centos7.x与centos6.x的设置方法不一样)

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即可,修改完后保存重启下服务器即可。

 
301免备案跳转微信公众号
华为服务器
腾讯云服务器大促销。

声明:站长码字很辛苦啊,转载时请保留本声明及附带文章链接:https://www.zfcdn.xyz/showinfo-3-36124-0.html
亲爱的:被墙域名跳转TG:@qianhenetwork QQ:851617266,可否收藏+评论+分享呢?
上一篇:Linux/Centos7.x更改内核启动顺序方法.
下一篇:基于宝塔环境安装zabbix