Anxiety about `grub-install`

So I installed the recent 2024-01-02 stable update. Since Manjaro has upgraded from grub to grub2 I see multiple recommendations to run grub-install in the forum. But here’s the problem: I don’t how to run grub-install and I don’t want to risk breaking anything without getting some guidance first. I also have LUKS encryption and I don’t know if this will cause issues or not.

I’m not sure which logs or information to post so please tell me if needed. I installed Manjaro on December 18, 2021 with LUKS encryption (not sure if LUKS2, it’s whatever was default when I installed). I’m booting from UEFI and Secure Boot is disabled. I’m running the second latest LTS kernel (6.1.69-1). I also made some changes to /etc/default/grub at one point to improve security. Here is the output:

# GRUB boot loader configuration

GRUB_DEFAULT=saved
GRUB_TIMEOUT=1
GRUB_DISTRIBUTOR="Manjaro"
GRUB_CMDLINE_LINUX_DEFAULT="cryptdevice=UUID=[redacted] root=/dev/mapper/luks-[redacted] splash apparmor=1 security=apparmor udev.log_priority=3 slab_nomerge init_on_alloc=1 init_on_free=1 page_alloc.shuffle=1 pti=on randomize_kstack_offset=on vsyscall=none debugfs=off module.sig_enforce=1 lockdown=confidentiality quiet loglevel=0 random.trust_cpu=off intel_iommu=on efi=disable_early_pci_dma"
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 'menu' to change timeout behavior,
# press ESC key to display menu.
GRUB_TIMEOUT_STYLE=hidden

# 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=auto

# 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.
GRUB_COLOR_NORMAL="light-gray/black"
GRUB_COLOR_HIGHLIGHT="green/black"

# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/usr/share/grub/background.png"
GRUB_THEME="/usr/share/grub/themes/manjaro/theme.txt"

# 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

# Uncomment this option to enable os-prober execution in the grub-mkconfig command
GRUB_DISABLE_OS_PROBER=false

# Uncomment to ensure that the root filesystem is mounted read-only so that
# systemd-fsck can run the check automatically. We use 'fsck' by default, which
# needs 'rw' as boot parameter, to avoid delay in boot-time. 'fsck' needs to be
# removed from 'mkinitcpio.conf' to make 'systemd-fsck' work.
# See also Arch-Wiki: https://wiki.archlinux.org/index.php/Fsck#Boot_time_checking
#GRUB_ROOT_FS_RO=true

I want to know two things. Firstly, can someone guide me through grub-install? I find the information quite confusing surrounding it and don’t want to mess up my system by any chance. Secondly, is it really necessary? I ask this because I want to know if future updates could break something due to an older grub.

Thank you so much to anyone who helps! :smiley:

??
manjaro has been on grub (version 2.xxx) for a very long time.

Well the thing is that the original command (grub-install) is considered ‘tricky’ by some.
Something like the following command would be needed

grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=manjaro --recheck --force

depending on partitions and system type, etc.

But instead install-grub script was created and put in the repos to try and automate this.
So once you have it installed

sudo pacman -Syu install-grub

Then it will run whenever necessary to update the grub bootloader installed on disk.
You might run it once first

sudo install-grub

Thats it.


See above.
Also see the wiki sections

Yes. If you keep super old grub on the bootloader at some point it will break due to system library changes.

3 Likes

Consider “TimeShift” as a “WayBackMachine” - if something goes wrong

Good suggestions above. I strongly suggest you install TimeShift first & make a back-up. It’s super easy to use & takes the sweat out of updates. There is a small risk associated with encrypted disks but I suggest you take these two suggestions, starting with the TimeShift one. It has worked well for me.

All the best!

1 Like

At some point, if Grub changes to use a new option in grub.cfg, your Grub bootloader will no longer be able to interpret this file correctly. The Arch-wiki explicitly warns against this.

For example at some time, there were changes to Grub that allowed zstd compression to be used. At some point later the standard was switched to zstd compression. After that, individual systems were no longer bootable (because they were not maintained).

It is not beneficial to postpone necessary maintenance work out of fear. (Fear is not a good advisor)

My comment is OFFTOPIC!!!

Fear is the little brother of PANIC…

1 Like

If your system works you dont need to reinstall grub. There are a lot of info out there how grub is maintained on Manjaro. You can also try install-grub which covers most of the cases automatically.

2 Likes

Fear is not a good advisor

Very true :slightly_smiling_face:

Thank you. I’ve updated everything and ran install-grub. Everything is working normally :slightly_smiling_face:

1 Like

This topic was automatically closed 3 hours after the last reply. New replies are no longer allowed.