Ubuntu 12.04 LTS has a new grub2 boot menu that is much cleaner and easier to use than the old one. The new menu is based on the Grub Legacy boot menu, but it has been redesigned to be more user-friendly. The main difference between the old and new menus is that the new one is organized into sections, such as System Tools, Boot Options, and so on. This makes it easier for users to find what they are looking for. Another improvement is that the menu now uses icons instead of text labels. This makes it easier to understand and use, especially for people who are not familiar with Linux or Unix systems. Overall, the new Ubuntu grub2 boot menu is a great improvement over the old one. It’s easy to use and provides a more user-friendly interface. ..
Grub2 is a step forward in a lot of ways, and most of the annoying menu.lst issues from the past are gone. Still, if you’re not vigilant with removing old versions of the kernel, the boot list can still end up being longer than it needs to be.
Note: You may have to hold the SHIFT button on your keyboard while booting up to get this menu to show. If only one operating system is installed on your computer, it may load it automatically without displaying this menu.
Remove Old Kernel Entries
The most common clean up task for the boot menu is to remove old kernel versions lying around on your machine.
In our case we want to remove the 2.6.32-21-generic boot menu entries. In the past, this meant opening up /boot/grub/menu.lst…but with Grub2, if we remove the kernel package from our computer, Grub automatically removes those options.
To remove old kernel versions, open up Synaptic Package Manager, found in the System > Administration menu.
When it opens up, type the kernel version that you want to remove in the Quick search text field. The first few numbers should suffice.
For each of the entries associated with the old kernel (e.g. linux-headers-2.6.32-21 and linux-image-2.6.32-21-generic), right-click and choose Mark for Complete Removal.
Click the Apply button in the toolbar and then Apply in the summary window that pops up. Close Synaptic Package Manager.
The next time you boot up your computer, the Grub menu will not contain the entries associated with the removed kernel version.
Remove Any Option by Editing /etc/grub.d
If you need more fine-grained control, or want to remove entries that are not kernel versions, you must change the files located in /etc/grub.d.
/etc/grub.d contains files that hold the menu entries that used to be contained in /boot/grub/menu.lst. If you want to add new boot menu entries, you would create a new file in this folder, making sure to mark it as executable.
If you want to remove boot menu entries, as we do, you would edit files in this folder.
If we wanted to remove all of the memtest86+ entries, we could just make the 20_memtest86+ file non-executable, with the terminal command
Followed by the terminal command
Note that memtest86+ was not found by update-grub because it will only consider executable files.
However, instead, we’re going to remove the Serial console 115200 entry for memtest86+…
Open a terminal window Applications > Accessories > Terminal. In the terminal window, type in the command:
The menu entries are found at the bottom of this file.
Delete the menu entry for serial console 115200.
Note: Commenting out the menu entry will not work — it must be deleted. Copy it to a different file if you’re worried you might need it later.
Save and close this file. In the terminal window you opened, enter in the command
Note: If you don’t run update-grub, the boot menu options will not change!
Now, the next time you boot up, that strange entry will be gone, and you’re left with a simple and clean boot menu.
Conclusion
While changing Grub2’s boot menu may seem overly complicated to legacy Grub masters, for normal users, Grub2 means that you won’t have to change the boot menu that often. Fortunately, if you do have to do it, the process is still pretty easy.
For more detailed information about how to change entries in Grub2, this Ubuntu forum thread is a great resource. If you’re using an older version of Ubuntu, check out our article on how to clean up Ubuntu grub boot menu after upgrades.