很久没上CSDN了,最近开始在做RAID测试和调优相关的工作~
对于已编译了多个内核版本的情况下,修改Linux默认启动的内核方法如下:
①编辑grub.conf文件:
vi /etc/grub.conf
②修改"default="后面的数值,改为需要启动的内核编号(下面会依次列有编译成功的每个内核版本,编号从0开始),例如"default=0"
③最后再重启系统即可进入我们选择的内核版本。
grub.conf文件示例:
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/sda3
# initrd /initrd-version.img
#boot=/dev/sda
default=0timeout=5splashimage=(hd0,0)/grub/splash.xpm.gzhiddenmenutitle CentOS (2.6.29.6) root (hd0,0) kernel /vmlinuz-2.6.29.6 ro root=LABEL=/1 initrd /initrd-2.6.29.6.imgtitle CentOS (2.6.29.6rc1) root (hd0,0) kernel /vmlinuz-2.6.29.6rc1 ro root=LABEL=/1 initrd /initrd-2.6.29.6rc1.imgtitle CentOS (2.6.32.27) root (hd0,0) kernel /vmlinuz-2.6.32.27 ro root=LABEL=/1 initrd /initrd-2.6.32.27.imgtitle CentOS (2.6.test) root (hd0,0) kernel /vmlinuz-2.6.29testtest ro root=LABEL=/1 initrd /initrd-2.6.29testtest.imgtitle CentOS (2.6.34.7) root (hd0,0) kernel /vmlinuz-2.6.34.7 ro root=LABEL=/1 initrd /initrd-2.6.34.7.imgtitle CentOS (2.6.35.9) root (hd0,0) kernel /vmlinuz-2.6.35.9 ro root=LABEL=/1 initrd /initrd-2.6.35.9.imgtitle CentOS (2.6.36.4) root (hd0,0) kernel /vmlinuz-2.6.36.4 ro root=LABEL=/1 initrd /initrd-2.6.36.4.imgtitle CentOS (2.6.38.8) root (hd0,0) kernel /vmlinuz-2.6.38.8 ro root=LABEL=/1 initrd /initrd-2.6.38.8.imgtitle CentOS (2.6.18-238.el5) root (hd0,0) kernel /vmlinuz-2.6.18-238.el5 ro root=LABEL=/1 initrd /initrd-2.6.18-238.el5.img