Results 1 to 9 of 9

Thread: How to remove an entry from the GRUB 2 menu?

  1. #1
    Join Date
    May 2005
    Location
    Amsterdam
    Beans
    38
    Distro
    Ubuntu 10.04 Lucid Lynx

    Question How to remove an entry from the GRUB 2 menu?

    Hi all,

    I want to remove an entry for Windows Vista (actually for HP_RECOVERY) from my GRUB 2 menu in Ubuntu 9.10. In the Grub 2 Basics elsewhere on these forums I read that I then need to remove a file or part of a file in /etc/grub.d . However, the only file there that contains the text "Windows" is a rather complicated bit of code that seems to be designed to automatically detect OS's.

    Code:
    root@schmauck:/etc/grub.d# ls
    00_header      05_debian_theme  20_memtest86+  40_custom
    00_header.bak  10_linux         30_os-prober   README
    root@schmauck:/etc/grub.d# grep -li windows *
    30_os-prober
    How do I remove an entry?
    Last edited by Daan; December 23rd, 2009 at 11:43 AM. Reason: typo

  2. #2
    Join Date
    Sep 2009
    Beans
    8,874
    Distro
    Ubuntu Development Release

    Re: How to remove an entry from the GRUB 2 menu?

    Have you upgraded your windows set up and the HP recovery is not relevant? A little more of a explanation might help.

  3. #3
    Join Date
    Aug 2008
    Location
    Jawja
    Beans
    2,486
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: How to remove an entry from the GRUB 2 menu?

    If you have eliminated Windows or upgraded you may need to open a terminal and enter:
    Code:
    sudo update-grub2
    I believe that would make any changes needed.

  4. #4
    Join Date
    May 2005
    Location
    Amsterdam
    Beans
    38
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How to remove an entry from the GRUB 2 menu?

    Hi,

    Thanks for your responses.

    I installed Ubuntu as soon as I got my new laptop. The installer gave me a GRUB menu with two entries for "Vista": one on sda1, where Windows actually is, and one for sda3, a partition labeled "HP_TOOLS". I want to remove this last entry, because on my previous HP laptop there were also additional entries for Vista in the GRUB menu, but choosing one of them resulted in GRUB being skipped at next boot, and the system entering an infinite loop of reboots without actually entering any OS as I know them. So I want to remove the entry for sda3, if there is an easy way.

    Code:
    root@schmauck:/home/daan# update-grub2
    Generating grub.cfg ...
    Found linux image: /boot/vmlinuz-2.6.31-16-generic
    Found initrd image: /boot/initrd.img-2.6.31-16-generic
    Found linux image: /boot/vmlinuz-2.6.31-15-generic
    Found initrd image: /boot/initrd.img-2.6.31-15-generic
    Found linux image: /boot/vmlinuz-2.6.31-14-generic
    Found initrd image: /boot/initrd.img-2.6.31-14-generic
    Found memtest86+ image: /boot/memtest86+.bin
    Found Windows Vista (loader) on /dev/sda1
    Found Windows Vista (loader) on /dev/sda3
    done
    root@schmauck:/home/daan#

  5. #5
    Join Date
    Jun 2009
    Location
    Open Linux Forums
    Beans
    2,710

    Re: How to remove an entry from the GRUB 2 menu?

    backup your current 30_os-prober and open it with an editor:
    Code:
    $sudo cp /etc/grub.d/30_os-prober /etc/grub.d/30_os-prober.original  && sudo chmod -x /etc/grub.d/30_os-prober.original
    gksu gedit +83 /etc/grub.d/30_os-prober &
    search for this section in the file:
    for OS in ${OSPROBED} ; do
    DEVICE="`echo ${OS} | cut -d ':' -f 1`"
    LONGNAME="`echo ${OS} | cut -d ':' -f 2 | tr '^' ' '`"
    LABEL="`echo ${OS} | cut -d ':' -f 3 | tr '^' ' '`"
    BOOT="`echo ${OS} | cut -d ':' -f 4`"

    if [ -z "${LONGNAME}" ] ; then
    LONGNAME="${LABEL}"
    fi
    add this after this section:
    Code:
    # Added to remove Windows Recovery
    if [ "$LONGNAME" = "Windows Vista (loader)" ] && [ "${DEVICE}" = "/dev/sda3" ] ; then
    continue
    fi
    # End Added
    save and run:
    Code:
    $sudo update-grub
    NOTE: you may have to check the exact menu entry and amend it accordingly in the to be added piece of code:
    Code:
    $cat /boot/grub/grub.cfg | grep Vista

  6. #6
    Join Date
    May 2005
    Location
    Amsterdam
    Beans
    38
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How to remove an entry from the GRUB 2 menu?

    Thanks, that is very useful. I have followed your directions, and now

    Code:
    root@schmauck:/etc/grub.d# update-grub
    Generating grub.cfg ...
    Found linux image: /boot/vmlinuz-2.6.31-16-generic
    Found initrd image: /boot/initrd.img-2.6.31-16-generic
    Found linux image: /boot/vmlinuz-2.6.31-15-generic
    Found initrd image: /boot/initrd.img-2.6.31-15-generic
    Found linux image: /boot/vmlinuz-2.6.31-14-generic
    Found initrd image: /boot/initrd.img-2.6.31-14-generic
    Found memtest86+ image: /boot/memtest86+.bin
    Found Windows Vista (loader) on /dev/sda1
    done
    root@schmauck:/etc/grub.d#

  7. #7
    Join Date
    Jun 2009
    Location
    Open Linux Forums
    Beans
    2,710

    Re: How to remove an entry from the GRUB 2 menu?

    you're welcome
    fijne feestdagen

  8. #8
    Join Date
    May 2007
    Location
    New Zealand
    Beans
    35
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: How to remove an entry from the GRUB 2 menu?

    Thanks from me too. I had the same problem with an Asus laptop and this fix worked a treat.

  9. #9
    Join Date
    Mar 2010
    Beans
    1

    Re: How to remove an entry from the GRUB 2 menu?

    Just the same as robfish. Thanks a lot, mate!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •