How to edit Grub Bootloader and remove unwanted entries in Ubuntu

Editing Grub is risky when done manually. Here is an easy graphical way of editing the grub entries!

Grub is the bootloader in most of the 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 the entries during the boot process.

In the recent days, the use of M.2 and PCI Express NVMe Solid State Drives have increased and so it makes the situation a little complicated when you are 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 so that I can 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. 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 “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

Kiran Kumar
Hi there! I'm Kiran Kumar, founder of FOSSLinux.com. I'm an avid Linux lover and enjoy hands-on with new promising distros. Currently, I'm using Ubuntu as a daily driver and run several other distros such as Fedora, Solus, Manjaro, Debian, and some new ones on my test PC and virtual machines. I have a day job as an Engineer, and this website is one of my favorite past time activities especially during Winter ;). When I'm not writing for FOSSLinux, I'm seen biking and hiking on scenic trails. Hope you enjoy using this website as much as I do writing for it. Feedback from readers is something that inspires me to do more, and spread Linux love!. If you find a time, drop me an email or feedback from the 'Contact' page. Or simply leave a comment below if you found this article useful. Have a good day!

5 COMMENTS

  1. 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.

    • 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.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

STAY CONNECTED

24,266FansLike
192FollowersFollow

LATEST ARTICLES

terminate frozen app
For dealing with a frozen app or desktop, you can't use the CTRL+ALT+DEL in Linux system. Instead, there are powerful alternatives that come in handy in frustrating situations. We pick the best methods available for you.
essential linux commands
Last week, we shared with you several "cool and fun" commands to get comfortable and confident with the Linux command-line. In our quest to further aid Linux users with mastery of the command line, or CLI, we present you with a variety of command-line utilities essential for all Linux users, regardless of proficiency level.
best linux distros for laptops
Whether buying a Linux pre-installed laptop or selecting a Linux distro for your existing laptop, there are many things to consider. Let's take you through some of the best Linux distros that are optimized for Laptops in this 2019 edition of the article. Read on.