PDA

View Full Version : [SOLVED] editing the Grub2 file



gilloz
December 12th, 2010, 04:42 AM
I presently dual boot with Vista Home Premium and Ubuntu 10.04 LTS. Since the installation of Ubuntu about 8 months ago, my Grub menu at boot up shows all the updates for Ubuntu 2.6.32-24, -25 and -26. How can I eliminate the first two and only leave the latest update? The Grub2 menu is getting bigger each time.

karthick87
December 12th, 2010, 04:49 AM
Install startup manager,

sudo apt-get install startupmanagerYou can find it under System>>Administration>>

http://i.imgur.com/teNnF.png
http://i.imgur.com/6viuN.png

In the second screenshot you can select how many kernels to show.Just keep it on 1.

gilloz
December 12th, 2010, 05:04 AM
Thanks karthick87 for your response. My Startup Manager does not look like yours. There are no Appearance or Security tabs in mine. Under the Advance tab, I only have Boot Menu Resolution and Create Floppy. Nothing else. Now what?

karthick87
December 12th, 2010, 05:11 AM
Install ubuntu-tweak,and clean your old kernels,

http://imgur.com/ye5uY.png

matt_symes
December 12th, 2010, 05:14 AM
Hi

This might be interesting as well. I have never used it so....


Grub Customizer is a new graphical GRUB2 settings manager. For now, it only allows you to edit the GRUB2 menu entries: reorder, rename or add/remove entries. Since these are actually scripts which generate the boot.cfg file, Grub Customizer changes the actual script order and then generates a new boot.cfg so if you then run "sudo update-grub", your customization won't be overwritten.


http://www.webupd8.org/2010/10/grub-customizer-lets-you-reorder-add-or.html

If you try it post back your impressions.

Kind regards

gilloz
December 12th, 2010, 05:15 AM
OK. Tried that and no packages are listed.

ryadav
December 12th, 2010, 05:35 AM
edit grub.cfg

make a backup first

sudo cp /boot/grub/grub.cgf /boot/grub/grub.cgf.backup

sudo nano /boot/grub/grub.cgf

look for menuentry and comment them out i.e:

#menuentry 'Ubuntu, with Linux 2.6.35-23-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
# recordfail
# insmod part_msdos
# insmod ext2
# set root='(hd0,msdos1)'
# search --no-floppy --fs-uuid --set e1791282-9347-4c24-8bfb-be54309d1159
# echo 'Loading Linux 2.6.35-23-generic ...'
# linux /vmlinuz-2.6.35-23-generic root=UUID=68081c72-09eb-446b-b536-b00e2e61eedf ro single
# echo 'Loading initial ramdisk ...'
# initrd /initrd.img-2.6.35-23-generic
#}

karthick87
December 12th, 2010, 05:39 AM
+1 on post #7

Oldhacker
December 12th, 2010, 07:09 PM
Installed Grub Customizer with no problem. However, the "Remove" option is grayed out when I highlight one of the entries.

Quackers
December 12th, 2010, 07:12 PM
You can go into synaptic package manager and enter the kernel numbers into the search box. Mark them for complete removal and apply the changes. There will be 2 entries at least for each kernel.

If you edit grub.cfg your changes will be over-written when grub is updated.

matt_symes
December 12th, 2010, 07:47 PM
Hi


If you edit grub.cfg your changes will be over-written when grub is updated.Very true. Any kernel update or grub update will revert the changes. Any time you need to manually update grub will also overwrite the changes.

Can i make a suggestion? I would keep the last two kernels in case you have a problem. You can then boot into the older kernel.

Kind regards

matt_symes
December 12th, 2010, 08:45 PM
Hi

BTW: This may be an interesting thread for you.

http://ubuntuforums.org/showthread.php?t=1287602

Kind regards

gilloz
December 13th, 2010, 02:01 AM
I want to thank everyone for coming to my rescue. I finally modified the Grub2 menu by doing what I was suppose to do several responses ago. When I opened my Ubuntu-Tweak, and clicked on Package Cleaner, I then went to the Right side and clicked on Clean Packages instead of Clean Kernels. That is why nothing was being listed. After reading post from matt_symes and went to the link, that is where I realized my error. I followed through with the instructions shown in the link and I was able to clear my Grub2 menu less one earlier Kernel. All is good now, thank you all.

Added Note: Karthick87's post had the image that would have solved my problem at the start. I just missed it. I really appreciate everyone's comments and inputs.

Quackers
December 13th, 2010, 02:28 AM
You're welcome. Enjoy :-)