How to edit Grub 2 menu entries in Ubuntu

To edit or remove the extra menu entries from the Grub 2 loader of the Ubuntu follow the given steps. You must write down the grub menu entries which have to be removed.
Open the terminal and enter the command
$sudo nautilus
A folder window will pop up , in that goto filesystem->boot->grub->grub.cfg.
In the appearing text box, search for  menuentry 'Ubuntu, with Linux 2.6.38-8-generic (recovery mode) or look for any other grub 2 menu entries as shown at Ubuntu startup.
Search for these codes in grub.cfg and delete them. It will remove grub menu entry Memory test
menuentry "Memory test (memtest86+, serial console 115200)" {
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos9)'
    search --no-floppy --fs-uuid --set=root d37cfb85-ee78-47ea-a5a0-bef79e548152
    linux16    /boot/memtest86+.bin console=ttyS0,115200n8
}


And delete all the text present between braces, {}.
Grub 2 menu edit entries

As shown in the image delete all the text along with the menu name from the text box. Similarly search for other menu entries of grub 2 and delete it.
After deleting these menu items restart your computer and you will find the grub menu entries are removed.
NOTE: Do not delete the menuentry 'Ubuntu, with Linux 2.6.38-10-generic
You will be unable to login to your Ubuntu!

3 comments:

I may have found an easier answer to how to correct the GRUB2 issue. It was pointed out to me in this thread:
http://ubuntuforums.org/showthread.php?t=2101511
that all I needed to do to bring GRUB2 back to it's original state was to:

Boot your 10.04 and open terminal and execute:
sudo grub-install /dev/sda

This worked perfect after a long encounter at trying to remove XUbuntu 12.04 from a HDD which also contained Ubuntu 12.04.

Hope this relevant and may help someone else out. :)

Opps! correction... I meant to say "which also contained Ubuntu 10.04".

Post a Comment