[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bad Behavior by GRUB


Le 10/01/2022 à 21:15, D.J.J. Ring, Jr. a écrit :
> GRUB now puts a "Preferred Boot" at the top of GRUB's choices so that it goes
> directly to the last successfully used operating system.

I think you are confusing the GRUB menu with the menu of the firmware.

> But here's the PROBLEM.
> As soon as my computer boots into one of the operating systems, either Slint,
> Debian, or Windows 10, GRUB adds an entry to the very top of my computer's BIOS 
> SETUP changing the boot device boot order, which previously was USB HD, then my
> hard drive, and inserts whatever operating system it last booted into, modifying
> the previous BIOS boot settings.

As I wrote in the Slint mailing list this is the expected behavior unless when
installing grub you used the --no nvram option, which prevents GRUB to write a
boot entry in the firmware's menu.

> Now on the next boot, my computer which previously booted from USB stick, now
> will boot directly into the last operating system that I used and it's
> impossible to enter BIOS Setup at all by pressing the setup key (usually F2).

If you can't enter the firmware setup in this context your firmware is buggy,
this has nothing to do with GRUB.

> What I have to do is to use the GRUB entry in Debian or Slint to go to the last
> entry which is "UEFI Firmware Settings" and this will cause my computer to
> reboot into the UEFI Firmware Settings - the same settings that I mentioned
> earier, that is accessed by a key press immediately when the BIOS name flashes
> on the screen - which now is inaccessible for even the sighted because the
> computer just directly goes to the last operating system that was used.
> Without this entry in GRUB the only ways to go back to a BIOS SETUP that allows
> me to boot to USB stick is to either boot into Windows and search for Advanced
> Boot Settings, then UEFI Firmware settings, and reboot - which will do the exact
> same thing as the bottom GRUB menu entry in Debian or Slint> Or I can take my computer apart and find the RESET button and press it and it
> will reset my firmware to the original where I again have access to Boot device
> choice - in my case by pressing F2.
> But whenever I boot into any operating system, I again lose the ability to boot
> into a USB stick because GRUB places an entry at the top of my BIOS UEFI settings!

Again, rather because your firmware is buggy:
1. That GRUB places an entry at the top of my BIOS UEFI (aka firmware) settings
is perfectly normal. But you can prevent it if you want, see at the end of this
2. That this prevent you to access your firmware settings is not normal at all,
but you should blame his faulty behavior to your firmware, not to GRUB.

> Certainly this action by GRUB should be disabled in an accessible version of
> Linux, or disabled altogether!

Not at all. If you install an OS, you most of the time expect it to start at
next boot.

But if you do not want wall, you can avoid it several ways: include a custom
boot entry in GRUB's menu or edit directly the firmware boot menu from a running
OS. The second solution is easier, so I will describe it.

As I wrote in the Slint list you can use the efibootmgr application shipped in
Slint and alos available in Debian for several purposes, among which
a) Change the order of the boot entries permanently.
b) Tell the firmware to boot a specific boot entry at next boot.

However in the Slint mailing list you wrote (my comments after the quotes)

> Jim has to run efibootmgr as root then find the USB HD on the list, which on
> your list is Boot000C* USB HDD, so he substitutes the last four number after
> Boot in the list for the USB HD and then he can boot directly into the USB stick.
> Mine was Boot0013* USB HDD:
> So I ran as root:
> efibootmgr -n 0013
> And then when I run as root:  reboot, I should boot directly to the USB stick.
> I tried, and it didn't go well at all.
> Booting brought me to EFI shell and it said:
> Failed to open \EFI\BOOT\grub.cfg
> Not found.

We do not know what is in your repair USB stick, thus cannot draw a conclusion.

It is possible that you typed a wrong number, or that you has several USB
devices plugged in and you landed in another one, or that there be an issue with
the content of the USB stick's EFI partition, or that this be the consequence of
a bug in the firmware.

> If I type exit at the EFI shell, I eventually get to a firmware boot menu and I
> use that menu to boot from a USB device which was listed containing my boot
> repair USB stick.
> The boot repair USB sticks, which allowed me to update, repair and reinstall
> GRUB on /dev/sda but now not with as good a result as before, because now if I
> boot from the hard drive (I have /sda and /sdb) I get the same errors.

Again this can be an issue with your firmware

> So I have to insert my boot repair USB stick which has a menu utility and I can
> boot to Slint, Debian or Windows from there.
> But now I have to always use the boot repair stick. I cannot boot from my hard
> drive directly.

Again, probably a firmware bug.

2) You can

Now to investigate we need several information, so please do what follows. Yiu
will need to be root or use sudo.

>From Slint, type as root: efibootmgr > efivars and send me the file efivars
>From Slint, send me the file /boot/grub/grub.cfg renamed grubslint
>From Debian, send me the file /boot/grub/grub.cfg renamed grubdebian
>From Slint, type: file /boot/efi > efislint and send me the file efislint
>From Debian type: file /boot/efi > efidebain ans send me the file efidebian
>From Slint, identify the EFI partition of the repair bot stick; mount it on /mnt
and type: find /mnt > stick and send me the file stick.


Reply to: