Home Ubuntu How to edit Grub Bootloader and remove unwanted entries in Ubuntu

How to edit Grub Bootloader and remove unwanted entries in Ubuntu

by Kiran Kumar
Published: Updated:
Editing Grub in Ubuntu

Grub is the bootloader in most Linux distros that manage the operating systems installed in a computer. If you have installed multiple operating systems like for instance, you have a dual-boot PC running Microsoft Windows and Ubuntu. You should see both entries during the boot process.

In recent days, the use of M.2 and PCI Express NVMe Solid State Drives has increased. So it makes the situation a little complicated when dealing with multiple operating systems on the same PC, especially involving all the different types of media.

One such problem occurred on my test PC. I have Windows 10 and Ubuntu installed on the M.2 NVMe SSD to benefit from the lightning-fast transfer speeds within the operating system. I also have a normal SSD installed which is only for storing the data. I had successfully installed Windows, Ubuntu, and the Grub on the NVMe drive.

Ubuntu Grub

Ubuntu Grub

After a kernel update in Ubuntu, I noticed a new duplicate entry in the Grub pointing to Windows on the SSD. That didn’t make any sense. I don’t have Windows installed on the SSD! Anyway, I tried to select it and see what happens during the boot. Obviously, the screen was blank.

I need to get rid of this duplicate entry. The usual “sudo update-grub” will not fix the issue. Boot Repair can’t fix it either. For some reason, it also thinks Windows is installed on the sda1 drive. Here is what I did to clean up the Grub.

Editing Grub to delete the entries in Ubuntu

Step 1) Launch the “Terminal.” You can use the Ctrl+Alt+T keyboard shortcut.

Step 2) Enter the following command to add the PPA to install “Grub Customizer.”

sudo add-apt-repository ppa:danielrichter2007/grub-customizer

Step 3) Update the system

sudo apt-get update

Step 4) Install the Grub Customizer package.

sudo apt-get install grub-customizer

Step 5) Launch Grub Customizer from the Apps menu.

Step 6) Right-click on the option that you wish to delete and select “Remove.” In my case, I want to delete the “Windows 10 (on /dev/sda1)”

Grub-Customizer User Interface

Grub-Customizer User Interface

Step 7) Click “Save.” The application has the revert functionality and puts the deleted entries in the right pane. You can anytime revert the changes – even after reboot!

Step 8) Restart the PC for new settings to take effect. My Grub got cleaned up from the messier-looking duplicate Windows entry. I’m happy!

Updated Grub

Updated Grub

You may also like

8 comments

Ian Q October 25, 2018 - 4:07 PM

So far so good

Reply
unyil November 30, 2018 - 4:35 AM

i lovee thisss

Reply
bongcheese June 10, 2019 - 9:57 AM

Upvote for this. Thanks this is sweet as bro, did the job perfectly

Reply
Jonathan Gossage June 21, 2019 - 7:59 PM

This does not work if you are using the Ubuntu install disk. You get the error grub-mkconfig could’t be executed successfully. /usr/bun/grub-probe: failed to get canonical path of /cow.

Reply
neoselen September 1, 2019 - 11:57 PM

in the software, File -> change environment then select the right device and partition you want to change.
i installed windows after linux, and didn’t wanted to erase anything but reinstall grub.

Reply
Michael Mutale January 10, 2020 - 1:44 PM

Is it also possible using this app to add a new entry in grub. In my case I installed Bliss OS (Android 9) on a new partition but it’s not showing in the boot menu. Thanks

Reply
Brian Horsley July 15, 2020 - 10:36 AM

You have to udate this.
When I installed it on mint 19.3 it worked ok, now I have upgraded to mint 20 it was removed from the ppa, then when I tried to install it using the above commands, it tells me that v20 does not support “focal” in the ppa.

Reply
George Pon April 27, 2021 - 12:49 AM

how do you get rid of the removed items. using pclinux

Reply

Leave a Comment

fl_logo_v3_footer

ENHANCE YOUR LINUX EXPERIENCE.



FOSS Linux is a leading resource for Linux enthusiasts and professionals alike. With a focus on providing the best Linux tutorials, open-source apps, news, and reviews written by team of expert authors. FOSS Linux is the go-to source for all things Linux.

Whether you’re a beginner or an experienced user, FOSS Linux has something for everyone.

Follow Us

Subscribe

©2016-2023 FOSS LINUX

A PART OF VIBRANT LEAF MEDIA COMPANY.

ALL RIGHTS RESERVED.

“Linux” is the registered trademark by Linus Torvalds in the U.S. and other countries.