PDA

View Full Version : [kubuntu] how to edit Grub2 menu entries



SGC622
October 22nd, 2010, 05:18 PM
i have been running Kubuntu 10.04 on my primary hard drive, and i have a second 1.5TB HD that i use for storage. so shrunk the secondary HD partition and created a second 50GB partition and i installed Ubuntu 10.10 on it and told it to rewrite the mbr on my primary HD.

Where i am at:
i took the menu entry from my Kubuntu "grub.cfg" and the entry from my Ubuntu "grub.cfg" and put them in the 40_custom file. so now when i boot-up my computer, it shows both installations at the bottom of Grub2s menu list. with all the menu entries that Grub automatically adds.

What i would like to know is how do i make it so that the Grub2 menu only shows the entries that i add to the 40_Custom file and not the randomly generated list aswell.

Thank you in advace.
Scott

drs305
October 22nd, 2010, 05:22 PM
The menu is generated by the scripts in /etc/grub.d If you make the file unexecutable, those menu items won't appear.

10_linux - default linux listings
20_memtest86+ - memtest86+
30_os-prober - linux, Windows, OSX, etc on other partitions.
If you look at /boot/grub/grub.cfg you will see it is divided into sections, with the OS sections divided by the inputs from the above script files.

You can remove the executable bit for any or all of the above with:

sudo chmod -x /etc/grub.d/<filename>

oldfred
October 22nd, 2010, 06:13 PM
If you just copy entries into 40_custom, you will have to edit on each kernel update. Ranch Hand posted this which uses the link file in / (root) that is updated with each kernel update.

From Ranch hand
Note that this does not define the kernel. It defines the partition. It boots the newest bootable kernel that it finds at that partition.

Change to your drive & partition:
menuentry "Daily on sda13" {
set root=(hd0,13)
linux /vmlinuz root=/dev/sda13 ro quiet splash
initrd /initrd.img
}

SGC622
October 22nd, 2010, 06:40 PM
that did it, thank you so much!(drs305) and thank you oldfred, i will look into that and try it for my next upgrade