Remove windows 7 entry from grub

I recently installed ubuntu 10.04 LTS and formatted my windows 7 hdd, but the windows 7 entry is still showing in grub. How can I remove the entry from grub?

Greetz


You should edit the /etc/default/grub and add the following line:

GRUB_DISABLE_OS_PROBER=true

save it and perform

sudo update-grub .

It will remove Windows from your GRUB menu list.

Hide/remove Windows entry from Grub menu list


The problem with these answers is that they do not address the underlying problem - when Windows is installed, it scans all drives on the system and 'litters' qualifying drives with 'Recycle' folders and other Microsoft OS what-nots, that Grub then takes to be an existing M$ OS.

Including the "GRUB_DISABLE_OS_PROBER=true" line will prevent ALL other operating systems from being detected, including other Linux OS's.

So the best fix is simply to delete these additional files/folders that Windows has created prior to running "update-grub". Window's menu-items will no longer be present in the Grub menu.


Ubuntu 10.04 LTS uses Grub2, which no longer uses the /boot/grub/menulist.lst file for configuration.

Instead, you should edit the file /etc/default/grub.

If your hard disk still contains a Windows partition, add the line:

GRUB_DISABLE_OS_PROBER=true

to prevent Windows being added to your grub menu.

To write the change, run

sudo update-grub

which will write a new /boot/grub/grub.cfg file.

You can then run

cat /boot/grub/grub.cfg

to check that your Windows entry has disappeared.

Further information can be found on this page: https://help.ubuntu.com/community/Grub2


If the entry was manually created, all you need to do is remove the corresponding file in /etc/grub.d/ using the command:

sudo rm /etc/grub.d/<filename>

Make sure you know what you're doing, you don't want to delete the wrong file as it will cause boot problems.

Also, you might not want to disable os-prober if you have a dual- or multi-boot system.


Disabling os-prober wasn't correct solution in my case - I had 2 Windows entries and just wanted to remove one incorrect. I was able to achieve desired effect using following Grub configuration:

1.Check UUIDs for the disks using the command:

sudo blkid

2.Update /etc/default/grub file by adding the line:

GRUB_OS_PROBER_SKIP_LIST="UUID_OF_DISK_YOU_DONT_WANT_SCAN1 UUID_OF_DISK_YOU_DONT_WANT_SCAN2"

3.Regenerate Grub configuration:

sudo grub2-mkconfig -o /boot/grub2/grub.cfg

NOTE: grub2-mkconfig due to some reasons still displays information about the ignored disk, but it wasn't generated to final /boot/grub2/grub.cfg file.

I've posted this as an answer for similar question here: https://unix.stackexchange.com/questions/408464/update-grub-brings-back-manually-removed-menu-entries/466359#466359