2

I'm trying new distributions, and I want to clean all my Ubuntu installation. I have a dual boot W 8.1 - Ubuntu. This is what I've done so far:

1 - I changed my boot priority from BIOS.
2 - I cleared the partitions (swap and main) in which I had installed the OS. I used Windows's Disk Manager for this.
3 - I repaired the windows installation (going to the system console and executing bootrec /fixmbr and bootrec /fixboot). I followed this: https://askubuntu.com/a/215350/332527.

After completing all this steps, my bios keeps showing me this:

enter image description here

I suppose some Ubuntu files are still installed somewhere (in fact, I can still access grub, which I should not be able to). What should I do?

PS: If I access Windows 8.1 Restart options (shift + click on restart), and I go to Use a device, I have a Ubuntu option that loads up Grub2.

  • You have to remove the ubuntu folder in the efi partition first, or UEFI may add it again. Then use efibootmgr to remove entry in UEFI. Some UEFI systems may let you change entries in UEFI. Then you can delete partitions with Ubuntu or reuse for whatever. http://askubuntu.com/questions/63610/how-do-i-remove-ubuntu-in-the-bios-boot-menu-uefi – oldfred Jul 25 '15 at 13:54

1 Answers1

0

As the first step boot into live disk:

Then install efibootmgr:

sudo apt update
sudo apt install efibootmgr

Then load the kernel efivars module:

sudo modprobe efivars

Then run sudo efibootmgr to check your boot entries. It will return something like this:

BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0001,0000,0004,0002,0003
Boot0000* Windows Boot Manager
Boot0001* ubuntu
Boot0002* Hard Drive
Boot0003* CD/DVD Drive
Boot0004* ubuntu

Then delete which you don't want to be shown in BIOS.

So for example we want to remove Ubuntu from BootOrder. So run this commands (in my example Ubuntu is refer to 1 and 4 boot order but you must to replace this numbers with your own):

sudo efibootmgr -b 1 -B 
sudo efibootmgr -b 4 -B 

Then you should also delete the ubuntu subdirectory in the EFI partition to prevent the UEFI firmware from restoring the entry into the BootOrder.

To do that, first find your EFI partition. So run this command:

sudo fdisk -l

(The EFI partition has EFI System under the Type column.)

For example in my case /dev/sda2 is EFI partition :

/dev/sda1        2048     923647     921600   450M BIOS boot
/dev/sda2      923648    1128447     204800   100M EFI System
/dev/sda3     1128448    1161215      32768    16M Microsoft reserved
/dev/sda4     1161216  425428991  424267776 202.3G Microsoft basic data
/dev/sda5   425428992 1347025381  921596390 439.5G Microsoft basic data
/dev/sda6  1347026944 1395853311   48826368  23.3G Linux swap
/dev/sda7  2166228992 3907025693 1740796702 830.1G Microsoft basic data
/dev/sda8  1395853312 2166228991  770375680 367.4G Linux filesystem

So mount EFI partition on an empty folder anywhere.

    sudo mkdir /mnt/boot
    sudo mount /dev/sda2 /mnt/boot

Now find the directory Ubuntu or any other distro's name in this partition. It is mostly under efi/ubuntu.

Remove that directory and its contents by commands like this:

cd /mnt/boot/efi/
sudo rm -r ubuntu