Removing unwanted entries from grub menu

Important files

  • /boot/grub/grub.cfg: This file contains the final entries that will be loaded by grub menu. This is the file that is updated once you run a update-grub command.
  • /etc/grub.d/40_custom, /etc/grub.d/25_custom: In my case, this was the file that contained many EFI files entries that were being added to grub menu.
  • /etc/default/grub: Grub configuration file that contains the setting that are used by grub while loading menu entries.

How to remove unwanted entries

Entries will begin with menuentry like this:

menuentry 'System setup' $menuentry_id_option 'uefi-firmware' {
    fwsetup
}

You can remove this type of entries from the file /etc/grub.d/40_custom or /etc/grub.d/25_custom.

Once done, reload the entries in grub menu using:

sudo update-grub

Check before reboot
You can check the entries that will be listed in grub before doing the reboot, using the file:

gedit /boot/grub/grub.cfg