永久修改grub2啟動順序

來源:互聯網
上載者:User

永久修改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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.