官术网_书友最值得收藏!

  • Ubuntu 20.04 Essentials
  • Neil Smyth
  • 291字
  • 2021-06-11 17:39:32

5.3 Changing the Default Boot Option

When the system starts, the boot options screen will appear and wait 10 seconds for the user to make an operating system choice. If no selection has been made before the timeout elapses, the default operating system will be started. On a newly configured system, the default operating system will be the standard Ubuntu image. This default can, however, be changed from within Ubuntu.

A range of boot configuration options (including the 10 second timeout and the boot settings outlined in “Installing Ubuntu on a Clean Disk Drive”) are declared in the /etc/default/grub file which reads as follows on a new installation:

GRUB_DEFAULT=0

GRUB_TIMEOUT_STYLE=hidden

GRUB_TIMEOUT=10

GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`

GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash”

GRUB_CMDLINE_LINUX=””

The first step in changing the default boot system is to declare the GRUB_SAVEDEFAULT setting within this file and to change the GRUB_DEFAULT setting to saved:

GRUB_DEFAULT=saved

GRUB_SAVEDEFAULT=true

GRUB_TIMEOUT_STYLE=hidden

GRUB_TIMEOUT=10

.

.

This setting allows a new default value to be saved within the boot configuration. Next, run the grub-set-default command to change the default setting using a numbering system that counts the first option as 0. For example, if the Windows 10 option is position 5 in the menu, the command to make Windows 10 the default boot option would read as follows:

# grub-set-default 4

Check that the new setting has taken effect by running the following command:

# grub-editenv list

saved_entry=4

Note that the saved_entry value is now set to 4. After changing the default, regenerate the boot configuration file as follows:

# grub-mkconfig --output=/boot/grub/grub.cfg

Reboot the system and verify that the boot menu defaults to the Windows 10 option and that Windows loads after the timeout expires.

主站蜘蛛池模板: 原平市| 天柱县| 海安县| 德江县| 陆丰市| 顺义区| 神木县| 揭东县| 定兴县| 威远县| 辽宁省| 石台县| 甘南县| 沂水县| 潼南县| 白山市| 庄浪县| 景东| 新巴尔虎左旗| 镇巴县| 简阳市| 巴青县| 奈曼旗| 双鸭山市| 大英县| 新田县| 永德县| 和政县| 皮山县| 三都| 清水县| 梁河县| 南溪县| 西青区| 琼中| 宝应县| 徐汇区| 汽车| 万源市| 营口市| 辽宁省|