LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   updating grub / EFI ? (https://www.linuxquestions.org/questions/linux-software-2/updating-grub-efi-4175690126/)

jan128 02-08-2021 09:52 AM

updating grub / EFI ?
 
In multiboot system I was under the impression that grub/efi will load the last successfully used OS.

Even when I do "shutdown" my next boot will always load the last OS installed via ISO.

Secondary - I have successfully duplicated boot-able HDD and it does not show in grub menu at all - consequently I cannot verify it actually works as boot-able OS.

I have noticed that sometime doing "update/ upgrade" the grub is also updated.

I have not have much luck in past updating grub or EFI using CLI.
I may do another ISO install to my main HDD just to be safe.
Any other suggestions ?

computersavvy 02-08-2021 10:26 AM

Quote:

Originally Posted by jan128 (Post 6217813)
In multiboot system I was under the impression that grub/efi will load the last successfully used OS.

Even when I do "shutdown" my next boot will always load the last OS installed via ISO.

The system will always boot the default OS unless you choose a different OS from the grub menu. The default OS will almost always be the last one installed. If you want to choose a different OS it has to be selected from the grub menu each time you boot.

Quote:

Secondary - I have successfully duplicated boot-able HDD and it does not show in grub menu at all - consequently I cannot verify it actually works as boot-able OS.

I have noticed that sometime doing "update/ upgrade" the grub is also updated.
1. Grub will always get updated whenever there is a kernel update that you install.

2. Duplicating a bootable HDD has its own pitfalls. The first and most important of which is the drive UUID. Having 2 drives with identical UUIDs on the same system does not ever work. I suspect that if you were to remove the original and try booting with the duplicate it would likely work. You also can change the UUID on the duplicate so the system sees it.

The second pitfall is grub. Having a second bootable drive does not automatically allow grub to see it as bootable and make its os available to boot. Grub configuration has to be updated to support that.

Quote:

I have not have much luck in past updating grub or EFI using CLI.
I may do another ISO install to my main HDD just to be safe.
Any other suggestions ?

jan128 02-08-2021 11:34 AM

https://help.ubuntu.com/community/Grub2/Setup

colorpurple21859 02-08-2021 04:05 PM

Quote:

was under the impression that grub/efi will load the last successfully used OS
Are you meaning the last installed os or the last booted os from the grub menu?

Quote:

I have successfully duplicated boot-able HDD
I don't understand what you mean by this, give details on what you did.

yancek 02-08-2021 05:09 PM

Quote:

I was under the impression that grub/efi will load the last successfully used OS
Grub will boot whichever system is set in the grub.cfg file under "default" or in /etc/default/grub file. The default entry in both files is:

Quote:

GRUB_DEFAULT=0

Brains 02-09-2021 02:06 PM

Great advice for legacy BIOS installations here.
But the OP does mention "EFI"
Grub is not part of the UEFI firmware interface.
My MSI laptop defaults to booting Windows and there is nothing efibootmgr, grub or any other software can do about it if Windows is still installed. It is controlled by the firmware interface. Some UEFI firmware interfaces will allow you to change the order and the default boot item with efibootmgr, just not all will. None the less, to change default boot item in an EFI system, try efibootmgr. Some will allow you to do it from within Windows.

computersavvy 02-09-2021 07:45 PM

If you are totally unable to get the grub menu and boot to linux from grub then I think something is wrong in the way your system was installed.

There is no distro that I have installed as dual boot with windows on the machine first but what grub puts both (or more) systems in the grub menu and any of the installed systems can be selected and booted without having to go into the bios boot menu.

Yes, there are likely some less used distros that do not do that with grub, but AFAIK all the more mainline ones handle booting that way. Ubuntu, Debian, CentOS, Fedora, Mint are some that easily configure dual boot from the grub menu.

As long as you have only one ESP partition, and your install uses the default ESP partition created during the windows install it just works that way. If you chose to create a second ESP partition then all bets are off with grub working as designed.


All times are GMT -5. The time now is 09:25 PM.