update-grub to remove Windows Info

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Post Reply
bobstead
Level 1
Level 1
Posts: 36
Joined: Thu Jul 04, 2013 1:53 pm

update-grub to remove Windows Info

Post by bobstead »

Have just finally removed Win10 from my Mint 18 system, by deleting all of the windows related partitions and re-sized the Linux partition etc. As a final step I ran grub-update thinking that it would remove the windows info & I'd no longer see the start menu.

However grub-update displays:

Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.4.0-21-generic
Found initrd image: /boot/initrd.img-4.4.0-21-generic
Found Windows Boot Manager on /dev/sda1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
done

Everything is working perfectly, I've recovered the extra space which Windows was gobbling up, and I don't want to cause myself any problems, but .... I just wonder if I can remove the Windows boot manager info without breaking anything?
Thanks in advance
Last edited by karlchen on Wed Dec 28, 2016 3:05 pm, edited 1 time in total.
Reason: Title: corrected "grub-update" to read "update-grub", because this is the name of the command
User avatar
karlchen
Level 21
Level 21
Posts: 13126
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: update-grub to remove Windows Info

Post by karlchen »

Hello, bobstead.

The command is update-grub, not the other way round.

Code: Select all

$ which grub-update
$ which update-grub
/usr/sbin/update-grub
Yet, the problem in your case is not caused by reverting the order of grub and update on the commandline, because doing so would have yielded a "command not found" error message.

Code: Select all

$ sudo grub-update
[sudo] password for agnkhe: 
sudo: grub-update: command not found
The root cause simply is that the Windows EFI boot loader still exists on the EFI partition. Removing the Windows disk partitions has not removed the Windows EFI bootloader on the EFI partition.

As I do not have any EFI boot system yet, I cannot tell you how to remove the Windows entry on an EFI boot system. Sorry.

Best regards,
Karl
Image
Linux Mint 19.3 64-bit Cinnamon, Total Commander 9.51 64-bit
Haß gleicht einer Krankheit, dem Miserere, wo man vorne herausgibt, was eigentlich hinten wegsollte. (Goethe)
bobstead
Level 1
Level 1
Posts: 36
Joined: Thu Jul 04, 2013 1:53 pm

Re: update-grub to remove Windows Info

Post by bobstead »

Sorry. Had used update-grub and just reported it wrong (too many xmas glasses of wine celebrating the fact that the initial deletion of windows worked), but as you say, windows EFI boot loader still exists on the EFI partition, and I don't want to mess with it for fear of destroying the whole machine!
Thanks
fabien85
Level 7
Level 7
Posts: 1780
Joined: Tue Mar 11, 2014 4:30 pm

Re: update-grub to remove Windows Info

Post by fabien85 »

The EFI system partition (ESP) is mounted at /boot/efi.
So if you feel adventurous, you can delete the Microsoft/ directory and its content on the ESP. Quickest way to do this would be:

Code: Select all

sudo rm -r /boot/efi/EFI/Microsoft
then you would update grub once more.

Do not touch to anything else on the ESP. In particular, /boot/efi/EFI/ubuntu/ is the directory that contains your grub bootloader. So if you delete that, Mint will not boot anymore (and you will need to reinstall grub manually).

You may also want to remove traces of the windows boot entry in the firmware memory. One way to do this is to go in the firmware interface (/BIOS), go to the boot order and remove the microsoft entry. How to do that exactly depends on your computer, I cant help you there. The other way is to use efibootmgr, but again if you do something wrong you can make your computer not boot Mint anymore, so best use with caution and knowing exactly what you do.
bobstead
Level 1
Level 1
Posts: 36
Joined: Thu Jul 04, 2013 1:53 pm

Re: update-grub to remove Windows Info

Post by bobstead »

Thanks very much. Will think about it very carefully, & exercise extreme caution! May just decide to leave it well alone, as it sounds well above my newbie pay grade!
dontNull
Level 1
Level 1
Posts: 37
Joined: Fri Dec 05, 2014 9:37 pm

Re: update-grub to remove Windows Info

Post by dontNull »

Hi bobstead,

There is a not too tricky way to remove the grub entry without messing with the 'EFI system partition'.
If you are interested, you can (re)move one of the scrips that grub uses to find non linux based OS.
The Windows boot loader will still be there, but grub won't show the entry that doesn't work.
If you move instead of remove the script it is reverseable if you later decide to intsall another OS.
(I tested this on my machine to make sure it works, without deleating Windows, then reversed it.)
(I don't have a EFI system so for me the file was 30_os-prober, for you probably need to move 30_uefi-firmware, you can just move both.)

Try this in a terminal (if you want):

Code: Select all

cd /etc/grub.d
sudo mkdir dont-use
sudo mv 30_os-prober dont-use/30_os-prober
sudo mv 30_uefi-firmware dont-use/30_uefi-firmware
sudo update-grub
Jay :)
The more I learn the more I realize I don't know.
Post Reply

Return to “Installation & Boot”