打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
永久修改grub2启动顺序

grub2是通过/etc/grub.d/目录下的文件顺序来决定启动项顺序的:

  1. $cd /etc/grub.d  
  2. $ls -l  
  3.   
  4. -rwxr-xr-x 1 root root 6743  9月 13  2012 00_header  
  5. -rwxr-xr-x 1 root root 5522  4月 18  2012 05_debian_theme  
  6. -rw-r--r-- 1 root root 7603  4月 18  2012 08_os-prober  
  7. -rwxr-xr-x 1 root root 7780  1月 23  2013 10_linux  
  8. -rwxr-xr-x 1 root root 7603  9月 20 13:48 17_os-prober  
  9. -rwxr-xr-x 1 root root 6335  4月 18  2012 20_linux_xen  
  10. -rwxr-xr-x 1 root root 1588 11月 27  2011 20_memtest86+  
  11. -rwxr-xr-x 1 root root 1388  1月 23  2013 30_uefi-firmware  
  12. -rwxr-xr-x 1 root root  214  4月 18  2012 40_custom  
  13. -rwxr-xr-x 1 root root   95  4月 18  2012 41_custom  
  14. -rw-r--r-- 1 root root  483  4月 18  2012 README  

08_os-prober是我之前为了默认启动项为win8而改的,因为现在又改成ubuntu为默认启动了,所以将08_os-prober的权限修改为不可执行的。该目录下有个readme

翻译如下:

该目录下的可以执行文件的顺序是按照shell扩展来排列的(就是按首字符排列的意思,用来配置grub的顺序)。

00_开头的文件是预留给00_header的


10_开头的用于系统本身


20_开头的用于第三方程序

可以新建和改变文件的顺序来配置gurb2的启动顺序。

知道以上这些就好办了。我们只要把08_os-prober的顺序设置到10_linux之后就可以让windows的选项在linux之后了。

运行以下命令把08_os-prober复制一份并且重命名为17_os-prober:


  1. $sudo cp 08_os-prober 17_os-prober  
  1. $sudo chmod 644 08_os-prober   //去掉08_os-prober的可执行权限  
  2. $ls -l  
  3.   
  4.   
  5. -rwxr-xr-x 1 root root 6743  9月 13  2012 00_header  
  6. -rwxr-xr-x 1 root root 5522  4月 18  2012 05_debian_theme  
  7. -rw-r--r-- 1 root root 7603  4月 18  2012 08_os-prober  
  8. -rwxr-xr-x 1 root root 7780  1月 23  2013 10_linux  
  9. -rwxr-xr-x 1 root root 7603  9月 20 13:48 17_os-prober  
  10. -rwxr-xr-x 1 root root 6335  4月 18  2012 20_linux_xen  
  11. -rwxr-xr-x 1 root root 1588 11月 27  2011 20_memtest86+  
  12. -rwxr-xr-x 1 root root 1388  1月 23  2013 30_uefi-firmware  
  13. -rwxr-xr-x 1 root root  214  4月 18  2012 40_custom  
  14. -rwxr-xr-x 1 root root   95  4月 18  2012 41_custom  
  15. -rw-r--r-- 1 root root  483  4月 18  2012 README  


然后打开/etc/default/grub文件把默认启动项改成你要得那个:

  1. $sudo vim /etc/default/grub  

找到GRUB_DEFAULT=,改成9.(因为linux是从0开始计数的)


然后更新grub即可:sudo update-grub

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
安装双系统后,设置XP为开机默认启动
win7与Ubuntu 13.04双系统修改启动项顺序的2种可行方法
关于win10 deepin启动项顺序问题解决方案
Linux与Windows双系统,安装完linux后无法通过grub进入Windows的解决方法
Grub的图形化工具介绍
Ubuntu grub2的启动配置文件grub.cfg,为了修改另人生厌的时间
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服