Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Possible Duplicate:
Make grub keep its default boot under kernel updates

I've got dual boot system - Ubuntu 9.10 and Windows 7.

Whenever the GRUB loaded, the menu showed lots of options, for example, the past kernels, memory tests, and windows 7.

I want to make this menu smaller, because I need to press downward arrow about 6 times to go to the Windows 7 option. I aware that the GRUB is version 1.97~beta4 and after spending some time on Ubuntu official site I still can't figure out how to change it.

share|improve this question

marked as duplicate by quack quixote, Ivo Flipse Feb 10 '10 at 18:43

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
duplicate (not exact same question, but answers will apply to both): superuser.com/questions/102692/… –  quack quixote Feb 10 '10 at 16:34

2 Answers 2

The answer appears to be:

  • Remove old kernels via Synaptic, and their boot entry will be automatically removed
  • You can kill other extraneous entries by making their entries in /etc/grub.d/ non-executable

So to get rid of the memtest entry, you would run:

sudo chmod -x /etc/grub.d/20_memtest86+
  • My reading of /etc/grub.d/README is that Grub determines the order of menu entries based on the leading number of its filename. I don't have any dual-boot systems to verify this on, but Windows should have its own entry file here. So if you wanted to keep the memtest entry, but have the Windows entry display first, you'd rename the files so that the Windows entry had a lower numerical tag on the filename
  • After you make your changes, run update-grub at the CLI to commit them.

Answers pulled from this guide to Grub 2 at the Ubuntu Forums.

share|improve this answer

Edit the file /boot/grub/menu.lst as root with your favourite text editor. Find the section that looks something like this:

  • title Debian
  • root (hd0,0)
  • kernel /vmlinuz-2.6.26-2-686 root=/dev/sda2 ro
  • initrd /initrd.img-2.6.26-2-686
  • title Debian (single-user mode)
  • root (hd0,0)
  • kernel /vmlinuz-2.6.26-2-686 root=/dev/sda2 ro single
  • initrd /initrd.img-2.6.26-2-686

Every title corresponds to one entry on the boot menu. To disable an entry, simply comment out the appropriate lines. So to remove the entry in my example above named Debian (single user mode) I would edit the file to look like this:

  • title Debian
  • root (hd0,0)
  • kernel /vmlinuz-2.6.26-2-686 root=/dev/sda2 ro
  • initrd /initrd.img-2.6.26-2-686
  • # title Debian (single-user mode)
  • # root (hd0,0)
  • # kernel /vmlinuz-2.6.26-2-686 root=/dev/sda2 ro single
  • # initrd /initrd.img-2.6.26-2-686

Do this for all entries you want hidden from the boot menu. To restore an entry, simply remove the #.

Edit: Only now I realized you were using Grub 2. Sorry about that, the above only applies to Grub 1 (aka Grub Legacy). On the Grub Wiki I found this grub.cfg example config. Interpreting it, you should be able to comment out the appropriate entries much like I showed above.

Editing

  • menuentry "My Linux Kernel on (hd0,1)" {
  • set root=(hd0,1)
  • linux /vmlinuz root=/dev/hda1
  • initrd /initrd
  • }
  • menuentry "Chainload my OS" {
  • set root=(hd0,3)
  • chainloader +1
  • }

into

  • menuentry "Linux" {
  • set root=(hd0,1)
  • linux /vmlinuz root=/dev/hda1
  • initrd /initrd
  • }
  • # menuentry "Other OS" {
  • # set root=(hd0,3)
  • # chainloader +1
  • # }

should work, I think. Be aware that I have no idea if this will work, and might be harmful in some way. Proceed with caution.

share|improve this answer
    
He's using GRUB2, editing the menu.lst won't change anything. –  Bobby Jan 11 '10 at 15:10
    
changing Grub2's grub.cfg won't be permanent, as it's auto-generated from scripts in /etc/grub.d which get run from update-grub (manually or automatically from the package manager, eg, when installing a new kernel package). –  quack quixote Feb 10 '10 at 16:10

Not the answer you're looking for? Browse other questions tagged or ask your own question.