Cleaning Grub

What would be the best way to remove entries in the grub menu?

I've installed more than one garuda and then removed some partitions and grub failed to recovery mode.

So I reinstalled another Garuda and it repaired the grub.. and then I did grub repairs and removed all but one partition with Garuda and grub works but now I have a bunch of entries in my grub menu

I've tried grub-customizer but I guess btrfs is somehow different

right now my grub is showing

Garuda Linux
Advanced Options for Garuda Linux
Garuda Linux
Advanced Options for Garuda Linux
UEFI Firmware Settings
UEFI Firmware Settings
Shutdown
Restart
Garuda Linux
Garuda Linux Snapshots
Garuda Linux
Advanced Options for Garuda Linux
UEFI Firmware Settings
Garuda Linux Snapshots
Shutdown
Restart
Garuda Linux

and more when I scroll...

I'd like to keep just the bold items

Welcome :slight_smile:

Use efibootmgr like in

But maybe grub customizer changed something you can’t repair.

This may actually be making the issue worse, not helping. Before you make any headway with sorting out this issue, you’ll have to undo the Grub Customizer installation.

Grub Customizer adds a file that is meant to help you remove it (it is kind of difficult to remove manually):

/etc/grub.d/backup/RESTORE_INSTRUCTIONS

I have seen it mentioned that certain permissions need to be adjusted prior to removing Grub Customizer with this method: dual boot - How to restore original grub config after uninstalling Grub Customizer in Ubuntu 22.04? - Ask Ubuntu

Another way would be to just toss the whole /etc/grub.d directory and start fresh.

Firstly, remove Grub Customizer if you haven’t already.

sudo pacman -Rns grub-customizer

Move the entire /etc/grub.d directory to backup.

sudo mv /etc/grub.d /etc/grub.d.bak

Reinstall the Grub package, to restore the needed files that have been moved to backup.

sudo pacman -S grub

Regenerate the Grub configuration file.

sudo update-grub

If you run into any errors during any of those steps, stop and address them before proceeding–otherwise you may be unable to boot, and you will need to repair your system from the live environment.

When you are ready, reboot to test that all is well. Then go ahead and delete the old directory that was moved to backup.

sudo rm -rf /etc/grub.d.bak

Check for lingering files is on the EFI partition. Removing a distro by overwriting the partition it is installed on leaves behind the directory Grub installed at /boot/efi/EFI.

sudo ls -l /boot/efi/EFI

Grub will find any grubx64.efi files in these directories and add them to your boot menu, even if the installation itself is long gone (Grub has no way of knowing). If you see any abandoned installations in this directory, go ahead and delete them. Afterward, regenerate the Grub configuration file again.


Check for old boot variables that can be deleted.

efibootmgr

This will show the boot variables currently on your system. Identify the ones no longer needed and delete them.

sudo efibootmgr -b # -B

Substitute “#” in the command above for the boot variable you wish to delete. If you have multiple boot variables for Garuda and you aren’t sure which one you are supposed to keep, you can delete them all and then re-run the Grub installation routine.

sudo grub-install

Then regenerate the configuration file again.

sudo update-grub
5 Likes

Thank you for the concise instructions!
Everything is clean now and I dont feel so dirty!

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