Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
231
rated 0 times [  231] [ 0]  / answers: 1 / hits: 222331  / 3 Years ago, wed, july 28, 2021, 3:26:42

Grub2 - Community Ubuntu Documentation says the following:




Saving an OS can be achieved by running sudo grub-set-default if
DEFAULT=saved is set in /etc/default/grub. It may also be saved if
GRUB_SAVEDEFAULT=true is also set in /etc/default/grub. In this case,
the default OS remains until a new OS is manually selected from the
GRUB 2 menu or the grub-set-default command is executed.




I put the lines DEFAULT=saved AND GRUB_SAVEDEFAULT=true in /etc/default/grub, and ran sudo grub-set-default. Here is the output:



$ sudo grub-set-default
entry not specified.
Usage: grub-set-default [OPTION] entry
Set the default boot entry for GRUB.

-h, --help print this message and exit
-v, --version print the version information and exit
--boot-directory=DIR expect GRUB images under the directory DIR/grub
instead of the /boot/grub directory

ENTRY is a number or a menu item title.

Report bugs to <[email protected]>.


Am I not following the documentation correctly? What's the correct way to do this?


More From » grub2

 Answers
3

The documentation in this case is wrong. All variables in /etc/default/grub start with GRUB_, so it's GRUB_DEFAULT=saved, not DEFAULT=saved. I've corrected the Ubuntu wiki to reflect that.



The official grub manual describes this correctly: http://www.gnu.org/software/grub/manual/grub.html#Simple-configuration



Put the following in /etc/default/grub (command line: gedit admin:///etc/default/grub):



GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true


Then run:



sudo update-grub

[#37745] Thursday, July 29, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tusmuumu

Total Points: 195
Total Questions: 122
Total Answers: 104

Location: Oman
Member since Tue, Feb 7, 2023
1 Year ago
;