You are not logged in.

#1 2023-02-05 20:26:12

GoluDholu
Member
Registered: 2022-11-05
Posts: 27

[Solved] What to do when GRUB updates?

So my GRUB package updated. From last time's experience, I fear I will end up breaking my system if I reboot without performing grub-install. However, I do not remember what flags I had when installing the OS. Also, I have dual-boot with Windows 11.

I can see the following instructions:

$ grub-install ...
$ grub-mkconfig -o /boot/grub/grub.cfg

From the installation instructions at https://wiki.archlinux.org/title/GRUB, I can see that I have to run some variant of the following command

grub-install --target=x86_64-efi --efi-directory=esp --bootloader-id=GRUB

So the first task is to identify what is my efi-directory, aka esp.

Output of ls /boot

efi   initramfs-linux-lts-fallback.img  intel-ucode.img
grub  initramfs-linux-lts.img           vmlinuz-linux-lts

Output of ls /boot/efi:

Boot   bootmgr   BOOTNXT   EFI  'System Volume Information'

Output of /boot/efi/EFI

Boot  Dell  grub  Microsoft

So it appears my esp is /boot/efi. Is this correct?

Now we need to identify the bootloader-id, which I think is just grub (lowercase) from the directory listing.

Finally, the commands I need to run are:

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub
grub-mkconfig -o /boot/grub/grub.cfg

Last edited by GoluDholu (2023-02-06 16:55:35)

Offline

#2 2023-02-05 20:36:50

Fixxer
Member
From: Poland
Registered: 2011-08-29
Posts: 232

Re: [Solved] What to do when GRUB updates?

Post output of commands:

efibootmgr
grep efi /etc/fstab
cat /etc/default/grub

Offline

#3 2023-02-05 21:55:11

korokos
Member
From: Turkey
Registered: 2013-01-12
Posts: 9
Website

Re: [Solved] What to do when GRUB updates?

What should UEFI users do after the update? I always run the commands below and no error occuring.

$ sudo grub-install /dev/sda
$ sudo grub-mkconfig -o /boot/grub/grub.cfg

Is this a correct way of action?

Offline

#4 2023-02-05 22:27:43

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [Solved] What to do when GRUB updates?

^ The UEFI version of grub-install does not accept a block device as an argument so that would be ingnored and the default for --efi-directory (/boot/efi/?) would be presumed.

Are you sure it is a UEFI system?

[ -e /sys/firmware/efi ] && echo UEFI || echo non-UEFI

Jin, Jîyan, Azadî

Offline

#5 2023-02-06 02:53:11

GoluDholu
Member
Registered: 2022-11-05
Posts: 27

Re: [Solved] What to do when GRUB updates?

Fixxer wrote:

Post output of commands:

efibootmgr
grep efi /etc/fstab
cat /etc/default/grub

Output of efibootmgr

BootCurrent: 0001
Timeout: 2 seconds
BootOrder: 0001,0002,0000
Boot0000* UEFI PC711 NVMe SK hynix 512GB FJACN61791020CL24 1    PciRoot(0x0)/Pci(0x6,0x0)/Pci(0x0,0x0)/NVMe(0x1,AC-E4-2E-00-16-9E-5B-91)/HD(1,GPT,cdbe6109-54ba-4b7c-99ee-8ae5ba5820bb,0x800,0xfa000)/File(\EFI\Boot\BootX64.efi){auto_created_boot_option}
Boot0001* grub    HD(1,GPT,cdbe6109-54ba-4b7c-99ee-8ae5ba5820bb,0x800,0xfa000)/File(\EFI\grub\grubx64.efi)
Boot0002* Windows Boot Manager    HD(1,GPT,cdbe6109-54ba-4b7c-99ee-8ae5ba5820bb,0x800,0xfa000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)57494e444f5753000100000088000000780000004200430044004f0042004a004500430054003d007b00390064006500610038003600320063002d0035006300640064002d0034006500370030002d0061006300630031002d006600330032006200330034003400640034003700390035007d0000000e000100000010000000040000007fff0400

grep efi /etc/fstab

UUID=1AE0-F296          /boot/efi     vfat          rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro    0 2

# GRUB boot loader configuration

GRUB_DEFAULT="0"
GRUB_TIMEOUT="5"
GRUB_DISTRIBUTOR="Arch"
GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet"
GRUB_CMDLINE_LINUX=""

# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"

# Uncomment to enable booting from LUKS encrypted devices
#GRUB_ENABLE_CRYPTODISK="y"

# Set to 'countdown' or 'hidden' to change timeout behavior,
# press ESC key to display menu.
GRUB_TIMEOUT_STYLE="menu"

# Uncomment to use basic console
GRUB_TERMINAL_INPUT="console"

# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT="console"

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `videoinfo'
GRUB_GFXMODE="1280X800"

# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX="keep"

# Uncomment if you want GRUB to pass to the Linux kernel the old parameter
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"
#GRUB_DISABLE_LINUX_UUID="true"

# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY="true"

# Uncomment and set to the desired menu colors.  Used by normal and wallpaper
# modes only.  Entries specified as foreground/background.
export GRUB_COLOR_NORMAL="light-gray/black"
export GRUB_COLOR_HIGHLIGHT="black/light-gray"

# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/path/to/wallpaper"
#GRUB_THEME="/path/to/gfxtheme"

# Uncomment to get a beep at GRUB start
#GRUB_INIT_TUNE="480 440 1"

# Uncomment to make GRUB remember the last selection. This requires
# setting 'GRUB_DEFAULT=saved' above.
#GRUB_SAVEDEFAULT="true"

# Uncomment to disable submenus in boot menu
#GRUB_DISABLE_SUBMENU="y"

# Probing for other operating systems is disabled for security reasons. Read
# documentation on GRUB_DISABLE_OS_PROBER, if still want to enable this
# functionality install os-prober and uncomment to detect and include other
# operating systems.
GRUB_DISABLE_OS_PROBER="false"

GRUB_FONT="/boot/grub/unicode.pf2"

Offline

#6 2023-02-06 06:28:59

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [Solved] What to do when GRUB updates?

So the EFI system partition is mounted under /boot/efi/ and the bootloader ID would appear to be "grub".

FWIW I would have used 'lsblk -f' & 'parted --list' to find the ESP mountpoint (parted will show the 'boot, esp' "flags" for the relevant partition).

And please use code tags rather than quote tags when posting terminal output.


Jin, Jîyan, Azadî

Offline

#7 2023-02-06 16:54:39

GoluDholu
Member
Registered: 2022-11-05
Posts: 27

Re: [Solved] What to do when GRUB updates?

It worked flawlessly. Thank you all.

Offline

Board footer

Powered by FluxBB