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

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.

主站蜘蛛池模板: 六盘水市| 右玉县| 道孚县| 鲁甸县| 益阳市| 大庆市| 和龙市| 黑水县| 西乌珠穆沁旗| 苍南县| 舟山市| 塔河县| 焦作市| 富宁县| 宜良县| 宾川县| 鹤庆县| 耒阳市| 衡阳市| 祁东县| 汤原县| 汤阴县| 从江县| 共和县| 竹溪县| 文昌市| 峨眉山市| 永靖县| 邵武市| 贡觉县| 武乡县| 永平县| 黎平县| 漯河市| 江津市| 盈江县| 耒阳市| 丰顺县| 施秉县| 邢台县| 双江|