7

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

1

7 Answers 7

8

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

0
4

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.

1

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

1

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.

0
1

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

0

If I remember corretly, you need to edit /boot/grub/menu.lst on your linux drive and remove the windows 7 entry (it's a text file)

The entry looks something like this:

title Windows 7
root (hd1,0)
savedefault
makeactive
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1 
1
  • 1
    That would be correct for grub 1, but Ubuntu 10.04 uses grub 2, which has a more complicated scheme, generated from files in /etc/grub.d Jun 3, 2010 at 10:44
0

you should be able to simply run sudo update-grub however if you only need to remove a specific windows partition from grub2, everything i tried re-envoked the OS prober, which put the partition right back as an option. disabling the OS prober was not a fit because I did have windows partitions i wanted listed as options. the only solution i found was to edit the /boot/grub/grub.cfg file manually, using # to comment out the entirety of the entry for the undesired partition. note that any other updates to grub.cfg will require re-commenting-out the undesired partition.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .