Attention grub update

I thought to update grub it was update-grub? What does that do vs this:

That isn’t something that is part of EOS though you can install it from AUR.

What is does is usually something like sudo grub-mkconfig -o /boot/grub/grub.cfg

Ah right now I get it I didn’t know it was a wrapper.

Anyways just wanted to understand when I update grub, I have to run just sudo grub-install and sudo grub-mkconfig -o /boot/grub/grub.cfg?

Thanks for the correct answer, so better to be careful.

It is important to be clear which operation/command we mean when we (loosely) talk about “installing grub” or “updating grub”.

This installs the grub package:

sudo pacman -S grub

This updates the grub package if a new version is available:

sudo pacman -Syu

This updates the grub bootloader:

sudo grub-install  # may need system specific parameters!

This updates the /boot/grub/grub.cfg file

sudo grub-mkconfig -o /boot/grub/grub.cfg

If I installed my Arch system with:

grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB --removable

after GRUB package gets updated, do I do that same command but with --no-nvram flag appended?

I’ve relatively old model laptop, recently I plugged 16GB ram in it with EndeavorOS, problem is BIOS only supports “legacy boot” but somehow my system installed grub in /boot directory.

That’s normal.
For a Legact/MBR/Bios system, the bootloader itself is written to the MBR of the disk.
The Grub’s boot files will be written to /boot/grub directory:

ls -al /boot/grub
total 56
drwxr-xr-x. 6 root root  4096 Jan 20 14:17 .
dr-xr-xr-x. 4 root root  4096 Jan 20 00:46 ..
drwxr-xr-x. 2 root root  4096 Oct  2 16:14 fonts
-rw-------. 1 root root  8352 Jan 20 14:17 grub.cfg
-rw-r--r--. 1 root root  1024 Oct  3 01:36 grubenv
drwxr-xr-x. 2 root root  4096 Jan  9 13:18 locale
drwxr-xr-x. 3 root root  4096 Jan 16 23:33 themes
drwxr-xr-x. 2 root root 20480 Jan  9 13:18 x86_64-efi

I think you would want sudo grub-install --efi-directory=/boot --removable --no-nvram.

You might be able to omit --efi-directory as well but you would have to test that.

There are grub files that are always installed to the boot directory but that is different than the image that gets written to the MBR for a legacy install

The archlinux support staff on the subrebbit always says you shouldn’t do this. They claim it is unnecessary and that the August issue was EOS specific. But everywhere else you look- here, Arch newsletter, Archwiki, Arch forum support staff, grub upstream- says that you should run grub-install after update. Thank you for explaining this issue clearly in this thread.
My way of handling this has been simply running these commands after I see grub got an update.

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

Yes, you should run grub-install after grub updates, says Arch forum support staff
Example 2 of this

No, you do not need to run grub-install after grub updates, say Reddit support staff
example 2 of this

I’m not 100% sure and don’t want to make a mistake before I do the update

❯ ls -al /boot/grub
drwxr-xr-x    - root 10 Jun  2022  fonts
.rw------- 6,6k root 17 Dez  2022  grub.cfg
.rw-r--r-- 1,0k root 10 Jun  2022  grubenv
drwxr-xr-x    - root 10 Nov  2022  locale
drwxr-xr-x    - root  9 Nov  2022  themes
drwxr-xr-x    - root 10 Nov  2022  x86_64-efi
  1. sudo grub-install --target=x86_64-efi --efi-directory=/boot

  2. sudo grub-mkconfig -o /boot/grub/grub.cfg

to be on the safe side, i would like to ask again if these steps are correct in this order

yeah, my grub file doesn’t contain .efi file.

ls -al /boot/grub

drwxr-xr-x 6 root root  4096 Oca 19 15:17 .
drwxr-xr-x 3 root root  4096 Oca 20 12:23 ..
drwxr-xr-x 2 root root  4096 Oca 19 15:16 fonts
-rw------- 1 root root  8480 Oca 19 15:17 grub.cfg
-rw-r--r-- 1 root root  1024 Oca 19 15:16 grubenv
drwxr-xr-x 2 root root 12288 Oca 19 15:16 i386-pc
drwxr-xr-x 2 root root  4096 Oca 19 15:16 locale
drwxr-xr-x 3 root root  4096 Oca 19 15:16 themes

/boot/

ls -al /boot/

drwxr-xr-x  3 root root     4096 Oca 20 12:23 .
drwxr-xr-x 17 root root     4096 Oca 19 23:59 ..
drwxr-xr-x  6 root root     4096 Oca 19 15:17 grub
-rw-------  1 root root 57589115 Oca 20 12:23 initramfs-linux-fallback.img
-rw-r--r--  1 root root 24651813 Oca 20 12:23 initramfs-linux.img
-rw-------  1 root root 54093930 Oca 19 15:16 initramfs-linux-lts-fallback.img
-rw-------  1 root root 22925572 Oca 19 15:16 initramfs-linux-lts.img
-rw-r--r--  1 root root  5678080 Kas  8 22:02 intel-ucode.img
-rw-r--r--  1 root root 11197248 Oca 20 12:23 vmlinuz-linux
-rw-r--r--  1 root root 10677248 Oca 18 14:24 vmlinuz-linux-lts

If your efi directory mounted at /boot? That is not typical. What does findmnt --real show?

The MBR is a reserved location on the disk itself. It isn’t in a file in your filesystem.

yep, my bad!

I used GPT on rufus but my laptop boots on Legacy, how that happened?

Sure. Mine is a UEFI system.

That means you booted the ISO in legacy mode.

here you go. thats why im asking. im not sure about

❯ findmnt --real
TARGET                     SOURCE            FSTYPE OPTIONS
/                          /dev/nvme0n1p2    ext4   rw,noatime
├─/run/media/swh/SDD       /dev/sdc1         ext4   rw,relatime
├─/run/media/swh/Mediathek /dev/sda1         ext4   rw,relatime
├─/run/media/swh/Stuff     /dev/sdb          ext4   rw,relatime
├─/boot/efi                /dev/nvme0n1p1    vfat   rw,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=as
├─/srv/nfsv4/Share         /dev/sda1[/Share] ext4   rw,relatime
└─/srv/nfsv4/Filme         /dev/sdb[/Filme]  ext4   rw,relatime

You probably just need:

sudo grub-install --no-nvram
sudo grub-mkconfig -o /boot/grub/grub.cfg