Terminal commands for manual GRUB re-installation

When you run into problems installing MX Linux XFCE
Message
Author
finickyrelic
Posts: 41
Joined: Tue Dec 04, 2018 10:47 pm

Terminal commands for manual GRUB re-installation

#1 Post by finickyrelic »

I use the MX Boot Repair tool often to fix GRUB issues cause by other distributions (especially Debian when it takes over my GRUB installation; for some reason the GRUB installed by Debian can never boot Arch based distros correctly).

I'm interested in learning the Terminal commands used by MX Boot Repair to "Reinstall GRUB bootloader" on my ESP. I looked int he MX Users Manual but didn't find them there.

I am aware of sudo update-grub but suspect there is something else.

tony37
Posts: 1306
Joined: Sat Jul 18, 2020 12:34 pm

Re: Terminal commands for manual GRUB re-installation

#2 Post by tony37 »

The basic command is

Code: Select all

sudo grub-install
And then you can add some parameters, more info about those you can find with

Code: Select all

man grub-install
For example, when I use Boot Repair to reinstall my current grub, the command used is:

Code: Select all

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=MX19.3 --recheck
(you can find that in /var/log/mx-boot-repair.log)

finickyrelic
Posts: 41
Joined: Tue Dec 04, 2018 10:47 pm

Re: Terminal commands for manual GRUB re-installation

#3 Post by finickyrelic »

(you can find that in /var/log/mx-boot-repair.log)
Thank you! I didn't even realize there was a log file for MX Boot Repair that I could've referenced.

I just looked in my /boot/efi directory and see that there are two MX-related directories - MX19 as well as MX19.3

What is the purpose of both of these and can the MX19 be safely deleted?

tony37
Posts: 1306
Joined: Sat Jul 18, 2020 12:34 pm

Re: Terminal commands for manual GRUB re-installation

#4 Post by tony37 »

The name used by grub-install for the boot-loader can vary depending on which program you're using, so the original bootloader id can be different from one that was created later with MX Boot Repair. I suppose you're currently using the 'MX19.3' bootloader but to check that you can use

Code: Select all

sudo efibootmgr
and 'BootCurrent: ...' will tell you which bootloader is in use. And then you could delete the other bootloader in /boot/efi/EFI

Post Reply

Return to “Installation”