Editing boot entries in grub

Hi everyone! I wanna customize a grub by editing boot entries to make it look pretty :slight_smile:

I currently have EOS on NVMe drive and Ubuntu Server on SSD. Both of them have entries named “Advanced Options for …”.

How can I remove these entries from grub?

It must be this section in /etc/default/grub:

# Uncomment to disable submenus in boot menu
GRUB_DISABLE_SUBMENU='false'

Comment it out to remove the Subentries. And don’t forget a

*here was a wrong command, please ignore it*

after your editing.

Edit: I made an alias “sudo update-grub”, thanks to @ddnn for watching and correcting my mistake! Please use the following command to activate your changes.

If you have multiple kernels, which you should, then you won’t be able to easily boot from a working kernel in the event that the one you normally use is having issues.

Having the LTS and Current kernel is generally a good idea.

This should be the below command for Arch-based distros. Unless you have it aliased, or you’re using an AUR package that runs it like that.

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

Thanks for correction!

1 Like

I tried commenting this line in grub config, but somehow this menus are still appearing

It should end up like this in the end:

GRUB_DISABLE_SUBMENU='true'
1 Like

Sorry for my stupidity :sweat_smile:

Submenus are disabled now, but more entries appeared in grub’s selection (image below)

How can I remove it and leave just two entries named “Ubuntu Server” and “EndeavourOS Linux”

Yes, that’s what should happen. It takes them out of the submenu, and puts them at the top level. Did you mean that you want to have neither submenus nor the recovery entries?

1 Like

Yea I want to remove recovery entries. for most of my problems I usually use LiveCDs and terminal to fix problems (expect Firefox one).

So I don’t need those

It kinda seems like you’d need to edit the grub.cfg file directly, which is probably not recommended at all. In fact, the file requires sudo to even view it, and clearly says “DO NOT EDIT THIS FILE”.

If you choose to do it anyway, it would be this:

sudo nano /boot/grub/grub.cfg

Anyway, one of our more experienced guys will see your post eventually, and may be able to tell you how to do it.

Is there a more safe way to edit entries?

Yes, do it from scratch.
https://wiki.archlinux.org/title/GRUB#Custom_grub.cfg
and
https://wiki.archlinux.org/title/GRUB/Tips_and_tricks

Makes sense :thinking:

I also saw a parameter in /etc/default/grub that should remove recovery entries. It’s name is “GRUB_DISABLE_RECOVERY”. But if it’s vaule is “true” grub is acting like it didn’t see this parameter

Is it commented like this?

#GRUB_DISABLE_RECOVERY=true

If yes, remove the comment like this:

GRUB_DISABLE_RECOVERY=true

No it’s not commented.

It wasn’t even commented when I was inspecting grub’s config file

1 Like

This may or may not work, but try using just a “y”

GRUB_DISABLE_RECOVERY=y

Both articles I linked show cases where just a “y” is used, so maybe it works.
Or maybe someone needs to update either article.

Here’s the official (FULL) documentation from Grub for custom setups from scratch: https://www.gnu.org/software/grub/manual/grub/grub.html#Multi_002dboot-manual-config

if you do not use the fallback images you could also remove the image generation for these.
https://discovery.endeavouros.com/installation/dracut/2022/12/

Disable the generation of the fallback initrd

Edit config file located at /etc/eos-dracut.conf or /etc/kernel-install-for-dracut.conf and set NO_DRACUT_FALLBACK to NO_DRACUT_FALLBACK="true"

2 Likes

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