"grub" saved OS does not

Status
Not open for further replies.

anneranch

Active Member
Joined
Mar 16, 2019
Messages
223
Reaction score
43
Credits
2,078
There is an option in grub to save current OS ( in multiboot system) and have it reboot to it next time when boot is run.
That is what the option is and it simply does not work - ever since Ubuntu 18 version.
It used to work.
(I am now on 21.04 which is being "software updated" almost daily.)
Anybody can confirm this or help me to fix it?

I am not familiar with Ubuntu versioning ,
but it looks as 21.04 is in user's (QA) "beta test" and not ready for prime time.
 


It'd be beneficial if you told us *how* you tried to go about making this work, with specific steps and changes made. Otherwise, we can't possibly guess at a solution.
 
It'd be beneficial if you told us *how* you tried to go about making this work, with specific steps and changes made. Otherwise, we can't possibly guess at a solution.
I use it on Arch, but haven't tried it on other distributions but it looks like this.
Code:
# Uncomment to make GRUB boot from saved selection
GRUB_DEFAULT=saved

# Uncomment to make GRUB remember the last selection. This requires
# setting 'GRUB_DEFAULT=saved' above.
GRUB_SAVEDEFAULT=true
 
Please read the post.
I am NOT asking how to implement the option .
I clearly said " it used to work " , hence logically I must know how to implent it.

There is no need to "guess".

I am expecting answer / participation from a person who is familiar with the option, hence if unfamiliar with the option I am expecting NOT to participate in discussion.
 
I did read the post. Frankly, it's usually user error, which is why we need to know how you tried to implement it. We need to see the actual work to figure out if you screwed it up.
 
There is an option in grub to save current OS ( in multiboot system) and have it reboot to it next time when boot is run.
That made me think you were talking about the option I mentioned in grub.

If you had taken the time to explain in more detail what exactly you meant I wouldn't have responded, so far all your posts have been quite vague and whenever I asked a question to understand better what you mean or for more information about something I get a vague answer back. It's up to the person asking a question or asking for help to provide as much detail so that the problem or question is clear. That way you will get the answers you are looking for and won't have to complain if the person misunderstood your question.
It'd be beneficial if you told us *how* you tried to go about making this work, with specific steps and changes made. Otherwise, we can't possibly guess at a solution.
 
As long as "it is usual user error" I do not see any point to read any further nor continue to discuss the issue here. Have a swell day.
 
Just a simple question, if you changed the option in the grub file, did you then run

Code:
sudo update-grub

??

If you did not, then it will not change the overall boot environment.

You could do me the courtesy of answering this question, unlike other questions I have asked which remain unanswered.

Thank you

Chris Turner
wizardfromoz
 
As long as "it is usual user error" I do not see any point to read any further nor continue to discuss the issue here. Have a swell day.
Then at least give more details on what you are having problems with because from your current short description it sounds like you are having an issue with a grub option, since in your other post you said it is not and seems @KGIII didn't understand your problem/issue as well than it means you have not given enough information for anyone to understand your problem or question which means no one will be able to give you an answer or help to work towards a solution.
It'd be beneficial if you told us *how* you tried to go about making this work, with specific steps and changes made. Otherwise, we can't possibly guess at a solution.
 
Last edited:
Then at least give more details on what you are having problems with because from your current short description it sounds like you are having an issue with a grub option, since in your other post you said it is not and seems @KGIII didn't understand your problem/issue as well than it means you have not given enough information for anyone to understand your problem or question which means no one will be able to give you an answer or help to work towards a solution.
OK, here is a repeat

GRUB has an option to save current OS so when the system is booted / rebooted it will be reused.
The option has been posted here by other poster.

The success of the option is indicated in GRUB menu by prefixing the line with asterisk (*)

To my best recollection , this option LAST worked as advertised in Ubuntu 18 .

I am on 21.04 and it SIMPLY DOES NOT WORK.

It would be unreasonable ( I am not using Ubuntu to do QA for Ubuntu ) to regress back to 18 to prove validity of the issue. However, it would be relatively easy task for someone actually using Ubuntu 21.04 in multi-boot setup to verify this - and that is not unreasonable to expect from forum.
That is why I posted here, but if my expectation are wrong, please forgive my intrusion.

HOWEVER
I strongly suspect that something is amniss in Ubuntu boot process ( does efibootmgr interfere in grub ?) and this option is no longer viable.


PS
If it helps - I am using UEFI /EFI , NOT bios.
 
I understand now what your problem is and what you are asking. I spent a couple of hours testing and here is what I found.

I installed two efi boot systems with dual-boot:
system1: Windows + Ubuntu 18.04.5 LTS
Code:
tux@ubuntu:~$ lsb_release -r
Release:    18.04

tux@ubuntu:~$ sudo ls /boot/efi/EFI
Boot  Microsoft  ubuntu
system2 Windows + Ubuntu 21.04
Code:
tux@ubuntu:~$ lsb_release -r
Release:    21.04

tux@ubuntu:~$ sudo ls /boot/efi/EFI
Boot  Microsoft  ubuntu
I added the following two options to grub on both.
Code:
GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true
I booted into Windows which is the second boot options in grub in both systems. On both systems after I rebooted it booted into the last selected option, so from my testing it on both Ubuntu 18.04 and Ubuntu 21.04 I can say that the grub options to save the last boot option and to boot into that option at next boot still works on Ubuntu 21.04.

I also then upgraded the system running Ubuntu 18.04 to Ubuntu 20.04 doing an in place upgrade.
Code:
tux@ubuntu:~$ lsb_release -r
Release:    20.04

tux@ubuntu:~$ sudo ls /boot/efi/EFI
Boot  Microsoft  ubuntu
I tested booting into Windows again and then rebooting again, when it rebooted it automatically booted into Windows again.

I then did an in place upgrade from Ubuntu 20.04 to Ubuntu 20.10.
Code:
tux@ubuntu:~$ lsb_release -r
Release:    20.10

tux@ubuntu:~$ sudo ls /boot/efi/EFI
Boot  Microsoft  ubuntu
I again tested booting into Windows again, the when it rebooted it had automatically selected Windows as boot option again, so the option was also still working here.

I then did an in place upgrade from Ubuntu 20.10 to Ubuntu 21.04.
Code:
tux@ubuntu:~$ lsb_release -r
Release:    21.04

sudo ls /boot/efi/EFI
Boot  Microsoft  ubuntu
I then booted into Windows again, after then restarting it booted into the last selected grub option again which was Windows, just as it did with the previous versions of Ubuntu which I tested.

So I can conclude from my testing that from the system dual-booting with Windows and a fresh install of Ubuntu 21.04 the option still works. As well as the system dual-booting with Windows with an Ubuntu 18.04 install that it works, then when upgrading to 20.04, 20.10 and then finally to 21.04 it still worked.
 
Last edited:
I really appreciate you spending time on this.
I really do.

I am assuming that when you boot you get "grub" menu with
last workig OS indictaed with asterisk (*) on start of the line. .

Can you clarify the following:
I added the following two options to grub on both.

I do not want to guess -
but do you have "grub" for each OS - irregardless if it is Linux or Window ?
(I check the validity of my grub in use by removing the "flash" so I get
real time info during boot. )

From your test I also assume your setup firmware is UEFI/EFI.

And really stupid question
could I have syntax / spelling error in my option ?

Here is a part copy of /etc/default/grub

#GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debia>
#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true

Also , can you give me a hint what /boot/efi/EFI file function is ?

Here is mine and I really do not get function both entries .


qe@qe-desktop:~$ sudo ls /boot/efi/EFI
[sudo] password for qe:
BOOT ubuntu
qe@qe-desktop:~$

PS
is this ag good place to start ?:
 
Last edited:
Yes I did install the system with uefi boot and yes I see the *(asterisk) with the selected and saved boot option.
If you read my last post I showed output of what the /boot/efi/EFI directory looks like, I have attached two screenshots where you can see I'm using uefi and the asterisk on the selected boot option.
Code:
##CUSTOM##
# Uncomment to make GRUB boot from saved selection
GRUB_DEFAULT=saved

# Uncomment to make GRUB remember the last selection. This requires
# setting 'GRUB_DEFAULT=saved' above.
GRUB_SAVEDEFAULT=true
Lastly here's a link to the grub configuration on the system.
PS
is this ag good place to start ?:
The article just explains what uefi is and where the uefi files are located on different operating systems, you don't have to know much about uefi to use it. I first installed Windows, then afterwards I installed Ubuntu, during installation the uefi part is done by the installer. As in my earlier post that looks like this under Ubuntu.

The main efi directory.
Code:
tux@ubuntu:~$ lsb_release -r
Release:    21.04

tux@ubuntu:~$ sudo ls /boot/efi/EFI
Boot  Microsoft  ubuntu
The Windows efi directory.
Code:
sudo ls /boot/efi/EFI/Microsoft/Boot
BCD          boot.stl    es-MX  it-IT           kd_02_19a2.dll        lt-LT     qps-ploc    tr-TR
BCD.LOG       cs-CZ    et-EE  ja-JP           kd_02_1af4.dll        lv-LV     Resources   uk-UA
BCD.LOG1      da-DK    fi-FI  kd_02_10df.dll  kd_02_8086.dll        memtest.efi  ro-RO         winsipolicy.p7b
BCD.LOG2      de-DE    Fonts  kd_02_10ec.dll  kd_07_1415.dll        nb-NO     ru-RU         zh-CN
bg-BG          el-GR    fr-CA  kd_02_1137.dll  kd_0C_8086.dll        nl-NL     sk-SK         zh-TW
bootmgfw.efi  en-GB    fr-FR  kd_02_14e4.dll  kdnet_uart16550.dll  pl-PL     sl-SI
bootmgr.efi   en-US    hr-HR  kd_02_15b3.dll  kdstub.dll        pt-BR     sr-Latn-RS
BOOTSTAT.DAT  es-ES    hu-HU  kd_02_1969.dll  ko-KR            pt-PT     sv-SE

The Ubuntu efi directory.
Code:
tux@ubuntu:~$ sudo ls /boot/efi/EFI/Ubuntu
BOOTX64.CSV  grub.cfg  grubx64.efi  mmx64.efi  shimx64.efi

During the installation of Ubuntu when installing grub it detects there is another OS present and installs the efi directory and files for Windows for you. If were to install another Linux distribution along side Windows and Ubuntu it would then automatically place the uefi files in another sub-directory of /boot/efi/EFI
 

Attachments

  • 2021-07-10_22_29_32.jpg
    2021-07-10_22_29_32.jpg
    76.3 KB · Views: 193
  • 2021-07-10_22_30_28.jpg
    2021-07-10_22_30_28.jpg
    83.9 KB · Views: 160
Last edited:
I see your GRUB_DISTRIBUTOR line has an error in at the end of the line - your shows
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debia>
it should read
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
if in fact it is a typo disregard but if it isn't don't forget to
Code:
sudo update-grub
when finishing the edit
 
Yes I did install the system with uefi boot and yes I see the *(asterisk) with the selected and saved boot option.
If you read my last post I showed output of what the /boot/efi/EFI directory looks like, I have attached two screenshots where you can see I'm using uefi and the asterisk on the selected boot option.
Code:
##CUSTOM##
# Uncomment to make GRUB boot from saved selection
GRUB_DEFAULT=saved

# Uncomment to make GRUB remember the last selection. This requires
# setting 'GRUB_DEFAULT=saved' above.
GRUB_SAVEDEFAULT=true
Lastly here's a link to the grub configuration on the system.

The article just explains what uefi is and where the uefi files are located on different operating systems, you don't have to know much about uefi to use it. I first installed Windows, then afterwards I installed Ubuntu, during installation the uefi part is done by the installer. As in my earlier post that looks like this under Ubuntu.

The main efi directory.
Code:
tux@ubuntu:~$ lsb_release -r
Release:    21.04

tux@ubuntu:~$ sudo ls /boot/efi/EFI
Boot  Microsoft  ubuntu
The Windows efi directory.
Code:
sudo ls /boot/efi/EFI/Microsoft/Boot
BCD          boot.stl    es-MX  it-IT           kd_02_19a2.dll        lt-LT     qps-ploc    tr-TR
BCD.LOG       cs-CZ    et-EE  ja-JP           kd_02_1af4.dll        lv-LV     Resources   uk-UA
BCD.LOG1      da-DK    fi-FI  kd_02_10df.dll  kd_02_8086.dll        memtest.efi  ro-RO         winsipolicy.p7b
BCD.LOG2      de-DE    Fonts  kd_02_10ec.dll  kd_07_1415.dll        nb-NO     ru-RU         zh-CN
bg-BG          el-GR    fr-CA  kd_02_1137.dll  kd_0C_8086.dll        nl-NL     sk-SK         zh-TW
bootmgfw.efi  en-GB    fr-FR  kd_02_14e4.dll  kdnet_uart16550.dll  pl-PL     sl-SI
bootmgr.efi   en-US    hr-HR  kd_02_15b3.dll  kdstub.dll        pt-BR     sr-Latn-RS
BOOTSTAT.DAT  es-ES    hu-HU  kd_02_1969.dll  ko-KR            pt-PT     sv-SE

The Ubuntu efi directory.
Code:
tux@ubuntu:~$ sudo ls /boot/efi/EFI/Ubuntu
BOOTX64.CSV  grub.cfg  grubx64.efi  mmx64.efi  shimx64.efi

During the installation of Ubuntu when installing grub it detects there is another OS present and installs the efi directory and files for Windows for you. If were to install another Linux distribution along side Windows and Ubuntu it would then automatically place the uefi files in another sub-directory of /boot/efi/EFI
Off subject - how so you get screen shot BFORE OS is running?
 
Status
Not open for further replies.

Members online


Latest posts

Top