CentOS更改开机启动顺序

来源:互联网 发布:java 线程间共享数据 编辑:程序博客网 时间:2024/05/24 22:43

当我们安装多个操作系统时,希望自定义默认启动操作系统,如果安装完CentOS后,我们需要修改gurb,下面是修改gurb操作:


1,以root身份登入。

2,检查grub.conf(grub配置文件)在哪里。在终端中输入:whereis grub.conf 终端输出:“grub: /sbin/grub /etc/grub.conf~ /etc/grub.conf /usr/share/grub /usr/share/man/man8/grub.8.gz” ,我们可以看出grub.conf所在目录为“etc”。

3,修改grub.conf。打开此文件。

      a,修改默认启动操作系统。

我们看有几个以“title”为首的项目,每一个这样的项目,就是我们安装的操作系统,如果我们想让哪个为默认启动操作系统,那么我们需要修改“default”的值,这个值按照数组方式来设置,设置的值为我们系统中实际操作系统数量-1,例如我们现在有两个操作系统,我们想设置第一个为默认操作系统,那么我们应该把这个值设置为0;如果想第二个为默认操作系统,那么应该设置这个值为1。

     b,修改等待时间。

           timeout就是每次引导操作系统时候,我们等待时间,这个时间是秒,我们可以修改成我们需要的时间。

以上修改结束后,保存此文件就可以了,下次启动就会安装我们设置来启动了。



我的电脑是win7和CentOS双系统,装系统的时候默认启动是win7。
    1. 打开终端输入  vi  /etc/grub.conf 
    2. 在 grub.conf 文件中

点击(此处)折叠或打开


  1. # grub.conf generated by anaconda
  2. #
  3. # Note that you do not have to rerun grub after making changes to this file
  4. # NOTICE: You do not have a /boot partition. This means that
  5. # all kernel and initrd paths are relative to /, eg.
  6. # root (hd0,8)
  7. # kernel /boot/vmlinuz-version ro root=/dev/sdb9
  8. # initrd /boot/initrd-[generic-]version.img
  9. #boot=/dev/sdb
  10. default=0
  11. timeout=2
  12. splashimage=(hd0,8)/boot/grub/splash.xpm.gz
  13. hiddenmenu
  14. title CentOS (2.6.32-358.6.2.el6.x86_64)
  15. root (hd0,8)
  16. kernel /boot/vmlinuz-2.6.32-358.6.2.el6.x86_64 ro root=UUID=aa9d0353-afc0-4df5-8940-5090b427c7da rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=auto LANG=zh_CN.UTF-8 rd_NO_LVM rd_NO_DM rhgb quiet
  17. initrd /boot/initramfs-2.6.32-358.6.2.el6.x86_64.img
  18. title CentOS (2.6.32-358.6.1.el6.x86_64)
  19. root (hd0,8)
  20. kernel /boot/vmlinuz-2.6.32-358.6.1.el6.x86_64 ro root=UUID=aa9d0353-afc0-4df5-8940-5090b427c7da rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=auto LANG=zh_CN.UTF-8 rd_NO_LVM rd_NO_DM rhgb quiet
  21. initrd /boot/initramfs-2.6.32-358.6.1.el6.x86_64.img
  22. title CentOS (2.6.32-358.el6.x86_64)
  23. root (hd0,8)
  24. kernel /boot/vmlinuz-2.6.32-358.el6.x86_64 ro root=UUID=aa9d0353-afc0-4df5-8940-5090b427c7da rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=auto LANG=zh_CN.UTF-8 rd_NO_LVM rd_NO_DM rhgb quiet
  25. initrd /boot/initramfs-2.6.32-358.el6.x86_64.img
  26. title win7
  27. rootnoverify (hd0,0)
  28. chainloader +1
default=0     //默认启动的系统 0表示第一个
timeout=2    //系统启动时选择的时间

title  //一个系统启动选项

*小提示:修改需要root权限

0 0
原创粉丝点击