The officially official Devuan Forum!

You are not logged in.

#1 2019-07-13 00:56:40

Micronaut
Member
Registered: 2019-07-04
Posts: 201  

[Solved] Grub "savedefault" not working

It was great fun to discover Grub could be configured to save the last manual choice as the default for future boots. I used it with my Linux Mint Rosa (17.3) install and it worked fine. But now it won't work with Devuan Ascii. I can't figure out what is different. Just put:
GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true
in the /etc/default/grub config file and run update-grub. It worked with Mint. What is different about grub in Devuan?

Last edited by Micronaut (2019-07-14 21:59:35)

Offline

#2 2019-07-13 01:05:29

golinux
Administrator
Registered: 2016-11-25
Posts: 3,137  

Re: [Solved] Grub "savedefault" not working

I suspect the question is probably "what is different between mint and devuan".

Offline

#3 2019-07-13 08:18:08

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: [Solved] Grub "savedefault" not working

Please post the output of

grub-editenv list

See also https://www.gnu.org/software/grub/manua … ment-block


Brianna Ghey — Rest In Power

Offline

#4 2019-07-13 21:25:57

Micronaut
Member
Registered: 2019-07-04
Posts: 201  

Re: [Solved] Grub "savedefault" not working

"grub-editenv list" produced no output at all. Even when run in a root terminal. From what I can see about grub-editenv in the man pages, that is where the default should be saved. But it's clearly not getting saved. This was a re-install over the previous Linux (Mint 17.3) -- could differences between the different versions of grub have caused a problem?

Offline

#5 2019-07-14 12:49:55

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: [Solved] Grub "savedefault" not working

Try creating the /boot/grub/grubenv file:

# dd if=/dev/zero of=/boot/grub/grubenv bs=1024 count=1

I have no idea if that will work, I don't use /etc/default/grub myself.


Brianna Ghey — Rest In Power

Offline

#6 2019-07-14 20:17:11

Micronaut
Member
Registered: 2019-07-04
Posts: 201  

Re: [Solved] Grub "savedefault" not working

Wow, I am reluctant to use dd on a disk that has a working OS on it. Anyway, after going back and manually comparing the grub default on the new Devuan system with the one from the Mint system, I changed the parms to lower case. "saved" instead of "SAVED" and "true" instead of "TRUE". It seems to be working now. Odd that the control items are NAMED in upper case, but the parm apparently must be lower case to be recognized.

Offline

#7 2019-07-14 20:40:12

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: [Solved] Grub "savedefault" not working

Micronaut wrote:

I am reluctant to use dd on a disk that has a working OS on it

The command is outputting to a file rather than the block device, it won't over-write your disk.

Anyway, please add [SOLVED] to the thread title to help others who may have this problem.


Brianna Ghey — Rest In Power

Offline

#8 2019-08-17 15:29:14

djk44883
Member
Registered: 2019-06-02
Posts: 2  

Re: [Solved] Grub "savedefault" not working

Just a note to add to SOLVED, at one time I thought there was something about quotes.  I just looked at my file to see how I had saved configured... mixed quote and not quote and back-ticks, it doesn't seem to matter.

GRUB_SAVEDEFAULT=true
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet"

I agree, the mix is sloopy

Offline

#9 2019-08-17 15:45:36

bgstack15
Member
Registered: 2018-02-04
Posts: 205  

Re: [Solved] Grub "savedefault" not working

The /etc/default/grub file whose contents you show here, takes the form of a shell script that is executed before running Grub, so that the variables are defined for Grub to use.
In a shell script, backticks are used to wrap around a statement that is the same as something that could be executed on the shell prompt. So

`lsb_release -i -s 2> /dev/null || echo Debian`

means that the output of that command should be substituted. So if the output of that command is "Devuan" then the line is evaluated as  GRUB_DISTRIBUTOR=Devuan.
The double quotes are just quotes, so the exact string "quiet" is the value for that last entry.
But back to the backticks and their contents. In most shells, the double-pipe || means a logical OR. In shell, that means if the first command returns false (that is, it fails in some way), run the second statement. So if lsb_release -i -s (with sending any errors to the null device, so suppress all error messages) fails, then just show the word Debian.


This space intentionally left blank.

Offline

Board footer