This is an example of Windows Startup by default:
1. First find Windows menuentry.
# Cat/boot/grub2/grub. cfg | grep Windows
Result:
Menuentry "Windows 7 (loader) (on/dev/sda1)" -- class windows -- class OS {
2. Set Windows as the default startup Item (here you can only use the content in the double quotation marks "" or single quotation marks "in the Command output above)
# Grub2-set-default "Windows 7 (loader) (on/dev/sda1 )"
3. Verify the default startup Item
# Grub2-editenv list
Output:
Saved_entry = Windows 7 (loader) (on/dev/sda1)
4. Generate and update grub. cfg (optional)
The following command uses/etc/grub. the automatic configuration script under d and the variables defined in/etc/default/grub automatically generate the GRUB2 configuration file (including the kernel under/boot), and-o specifies the output file, /boot/grub2/grub. cfg is the default configuration file. If it is a multi-system, it will automatically find them and add them to the Startup Menu list.
# Grub2-mkconfig-o/boot/grub2/grub. cfg
Timeout and background images can be configured in/etc/default/grub.
For example:
GRUB_TIMEOUT = 5
GRUB_DISTRIBUTOR = "Fedora"
GRUB_DEFAULT = saved
GRUB_CMDLINE_LINUX = "rd. md = 0 rd. lvm = 0 rd. dm = 0 KEYTABLE = us quiet SYSFONT = latarcyrheb-sun16 rhgb rd. luks = 0 LANG = en_US.UTF-8"
GRUB_BACKGROUND =/boot/grub2/background.png
GRUB_TERMINAL_OUTPUT = gfxterm
GRUB_THEME =/boot/grub2/mytheme/theme.txt
Note: The following command sets Fedora as the default startup Item:
# Cat/boot/grub2/grub. cfg | grep Fedora
Result:
Menuentry 'ora ora Linux, with Linux 3.1.2-1. fc16.i686. pae' -- class Fedora -- class OS {
Menuentry 'ora ora Linux, with Linux 3.1.1-1. fc16.i686. pae' -- class Fedora -- class OS {
Menuentry 'ora ora Linux, with Linux 3.1.0-7. fc16.i686. pae' -- class Fedora -- class OS {
# Grub2-set-default "Fedora Linux, with Linux 3.1.2-1. fc16.i686. PAE"
# Grub2-editenv list
# Grub2-mkconfig-o/boot/grub2/grub. cfg
From A Curious Programmer