歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> 關於Linux >> 永久修改grub2啟動順序

永久修改grub2啟動順序

日期:2017/3/1 14:30:38   编辑:關於Linux
永久修改grub2啟動順序 grub2是通過/etc/grub.d/目錄下的文件順序來決定啟動項順序的: [html] $cd /etc/grub.d $ls -l -rwxr-xr-x 1 root root 6743 9月 13 2012 00_header -rwxr-xr-x 1 root root 5522 4月 18 2012 05_debian_theme -rw-r--r-- 1 root root 7603 4月 18 2012 08_os-prober -rwxr-xr-x 1 root root 7780 1月 23 2013 10_linux -rwxr-xr-x 1 root root 7603 9月 20 13:48 17_os-prober -rwxr-xr-x 1 root root 6335 4月 18 2012 20_linux_xen -rwxr-xr-x 1 root root 1588 11月 27 2011 20_memtest86+ -rwxr-xr-x 1 root root 1388 1月 23 2013 30_uefi-firmware -rwxr-xr-x 1 root root 214 4月 18 2012 40_custom -rwxr-xr-x 1 root root 95 4月 18 2012 41_custom -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: [html] $sudo cp 08_os-prober 17_os-prober [html] $sudo chmod 644 08_os-prober //去掉08_os-prober的可執行權限 $ls -l -rwxr-xr-x 1 root root 6743 9月 13 2012 00_header -rwxr-xr-x 1 root root 5522 4月 18 2012 05_debian_theme -rw-r--r-- 1 root root 7603 4月 18 2012 08_os-prober -rwxr-xr-x 1 root root 7780 1月 23 2013 10_linux -rwxr-xr-x 1 root root 7603 9月 20 13:48 17_os-prober -rwxr-xr-x 1 root root 6335 4月 18 2012 20_linux_xen -rwxr-xr-x 1 root root 1588 11月 27 2011 20_memtest86+ -rwxr-xr-x 1 root root 1388 1月 23 2013 30_uefi-firmware -rwxr-xr-x 1 root root 214 4月 18 2012 40_custom -rwxr-xr-x 1 root root 95 4月 18 2012 41_custom -rw-r--r-- 1 root root 483 4月 18 2012 README 然後打開/etc/default/grub文件把默認啟動項改成你要得那個: [html] $sudo vim /etc/default/grub 找到GRUB_DEFAULT=,改成9.(因為linux是從0開始計數的) 然後更新grub即可:sudo update-grub
Copyright © Linux教程網 All Rights Reserved