LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

grub-set-default

set permanent default GRUB boot entry

TLDR

Set the default boot entry permanently
$ sudo grub-set-default [entry_number]
copy
Set default for an alternative boot directory
$ sudo grub-set-default --boot-directory /[path/to/boot_directory] [entry_number]
copy

SYNOPSIS

grub-set-default [options] entry

DESCRIPTION

grub-set-default sets the permanent default boot entry for GRUB. Unlike grub-reboot, this setting persists across all subsequent boots until changed.The entry can be specified as a number (0 for first entry), the full entry name from grub.cfg, or a menu entry identifier. Submenu entries use notation like "1>2" for the third item in the second submenu.

PARAMETERS

entry

Menu entry number (0-indexed), name, or identifier
--boot-directory DIR
Use alternative boot directory instead of /boot

CONFIGURATION

/etc/default/grub

Must contain GRUB_DEFAULT=saved for grub-set-default to take effect.

INSTALL

sudo apt install grub2-common
copy
sudo dnf install grub2-common
copy
sudo pacman -S grub
copy
sudo apk add grub
copy
sudo zypper install grub2-common
copy

CAVEATS

Requires GRUB_DEFAULT=saved in /etc/default/grub and regenerating the configuration with grub-mkconfig. Without this, the setting in grubenv is ignored. Entry numbers can change when kernels are added or removed.

HISTORY

grub-set-default is part of GRUB 2's saved default functionality. It provides a way to change the boot default without editing configuration files, storing the selection in the grubenv file.

SEE ALSO

RESOURCES

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid