Ade Malsasa Akbar contact
Senior author, Open Source enthusiast.
Tuesday, June 14, 2022 at 22:36

Do you want to change Ubuntu's GNU GRUB menu at startup time? Either it is disabling it completely or just editing the text to suit your needs, you can do it all. Here's the tutorial for you made simple.

Subscribe to UbuntuBuzz Telegram Channel to get article updates.

 

About Bootloader

Ubuntu's bootloader is called GRUB 2, the bootloader of GNU operating system. Bootloader is the software that starts at booting time to 'wake up' your operating system and display list of OSes if you have more than one. You see it when turning on your computer and GNU GRUB version 2.x appears on screen showing menu of OSes you can choose. This tutorial is written for GRUB 2 only and does not apply to GRUB 1 (also called GRUB Legacy).

GRUB (www.gnu.org/s/grub) is a part of the GNU Operating System

The Basics

Your bootloader is actually a file located at /boot/grub/grub.cfg containing lines of codes you can edit. Other than that, we may also need to edit another file located at /etc/default/grub.

Contents of grub.cfg file:

Contents of /etc/default/grub file:

 

Hiding Bootloader Menu

You might want computer to boot directly into Ubuntu without showing bootloader menu at all. In that case, you should hide it by editing the /etc/default/grub file as the following example.

Step 1. Open the file with administrator right:

$ sudo nano /etc/default/grub

Step 2. Write a new line of code to disable GRUB menu as the following example:

GRUB_DISABLE_OS_PROBER=true


Step 3. Save the file by pressing Ctrl+O then Enter.

Step 4. Reboot. 

Your computer should now boot directly into Ubuntu and does not show GRUB menu anymore.

To unhide menu, remove the GRUB_DISABLE_OS_PROBER line and change 'hidden' into 'menu' without ticks for GRUB_TIMEOUT_STYLE.


Hiding Entries

You might want to make an entry disappear from bootloader. To do so, you edit grub.cfg file as the following example. 

Step 1. Open the configuration file with administrator right:

$ sudo nano /boot/grub/grub.cfg

Step 2. Find entries that looks like lines of code below:

menuentry 'Ubuntu' 
submenu 'Advanced options ...'
menuentry 'Ubuntu, with Linux version X ...'
menuentry 'Ubuntu, with Linux version X ... (recovery mode)'
menuentry 'Ubuntu, with Linux version Y ...'
menuentry 'Ubuntu, with Linux version Y ... (recovery mode)'
menuentry 'Fedora'
menuentry 'openSUSE'
menuentry 'Windows'
menuentry 'macOS'

Step 3. To hide one entry of operating system, for example to hide Fedora, openSUSE, Windows or macOS, type # in the beginning of each line like example below. 

#menuentry 'Fedora' 
#menuentry 'openSUSE'
#menuentry 'Windows'
#menuentry 'macOS'

Step 4. To hide Advanced Options entry is different, as you need to write # in the beginning of submenu entry as well as its multiple menuentry. For example, to hide Advanced Options of Ubuntu, write # before submenu and write also # before every of its menuentries.

#submenu 'Advanced options ...' 
#menuentry 'Ubuntu, with Linux version X ...'
#menuentry 'Ubuntu, with Linux version X ... (recovery mode)'
#menuentry 'Ubuntu, with Linux version Y ...'
#menuentry 'Ubuntu, with Linux version Y ... (recovery mode)'
 
Step 5. Save by pressing Ctrl+O and Enter. 
 
Step 6. Restart. 
 
Your computer should show GRUB bootloader much cleaner without showing things you do not want to see anymore.
 

Rename Entries

You might want to edit names of entries from bootloader. For example, because by default it shows just "Ubuntu" you want to rename it specifically to "Ubuntu 22.04 Jammy Jellyfish". You can do it by editing /etc/boot/grub.cfg.

Step 1. Open the file with administrator right:

$ sudo nano /etc/boot/grub.cfg

Step 2. Find the entry like following example:

menuentry 'Ubuntu' 
menuentry 'Fedora'
menuentry 'openSUSE'
menuentry 'Windows'
menuentry 'macOS'

Step 3. Edit the name of entry you want to change. For example, from Ubuntu to Ubuntu 22.04 Jammy Jellyfish. You can also personalize it as you wish with your pet name, for example.

menuentry 'Ubuntu 22.04 Jammy Jellyfish' 
menuentry 'Fedora'
menuentry 'openSUSE'
menuentry 'Windows'
menuentry 'macOS'

Step 4. Save by pressing Ctrl+O and Enter. 

Step 5. Reboot. 

Your bootloader now should display names as you wish.


Afterword

Up to this point, you should have the ability to hide, edit and rename your own bootloader on Ubuntu. As you can see yourself, this is pretty simple and does not include ability to add pictures nor animation into GRUB 2. All in all, this simple ability is already enough for just customizing GNU GRUB for daily purposes and doing business selling Ubuntu computers for example. See you next time. 

 

References

https://www.gnu.org/software/grub

https://www.gnu.org/software/grub/manual/grub/grub.html#Simple-configuration

https://askubuntu.com/questions/81660/how-can-i-edit-my-grub-bootloader-entries-hide-rename-remove


This article is licensed under CC BY-SA 3.0.