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

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.

主站蜘蛛池模板: 邢台市| 文化| 滦平县| 铁岭县| 白城市| 沾化县| 贵德县| 东兰县| 靖西县| 应城市| 贺州市| 北安市| 呼玛县| 塘沽区| 凤山县| 衡水市| 上林县| 江阴市| 三台县| 靖江市| 札达县| 溧阳市| 仙桃市| 旺苍县| 墨脱县| 临朐县| 托克逊县| 宁津县| 永康市| 随州市| 乐业县| 留坝县| 和顺县| 陆河县| 金昌市| 泽库县| 子洲县| 中西区| 个旧市| 航空| SHOW|