1

The short version: Every Ubuntu installation I do has the bootloader going to my Windows hard drive, despite me specifically selecting the separate hard drive during installation and now I'm stuck with an option in my UEFI boot menu (launched by holding F8 at boot) called "ubuntu". This boot option is apparently located on my Windows hard drive. I can however boot into Windows just fine by selecting the Windows Boot Manager option.

Here's the context as it might help understand how I got into this situation:

I recently got a new gaming PC with a 1TB SSD running Windows and a 2TB Hard drive. I used to be exclusively an Ubuntu user so I had to go and install Ubuntu on my second 2TB hard drive. I started with Xubuntu, adding 3 partitions to my empty 2TB hard drive. One for boot, one for root and one for home. I also selected the empty 2TB hard drive for the bootloader.

This didn't work because of a bug with "rsyslog" filling my usb during installation, but with the help of the internet I tried again after disabling it, formatting the same 3 partitions and using them for the same purposes. Boot, Root and Home with the 2TB hard drive as the bootloader.

Then I needed to boot the kernel with "pci=noaer" set because of some PCIE-bus errors preventing me from booting or making it super slow.

This worked but I realized on this bigger screen that I don't like Xubuntu much so I decided to switch to standard Ubuntu to see how Gnome runs on this machine. I followed the exact same steps that I've stated above, and installed Ubuntu.

So now we've reached where I'm currently at: I have an Ubuntu installation on my 2TB hard drive, with the bootloader apparently (according to the boot menu of my PC) installed to the other hard drive that holds my Windows installation. The Ubuntu installation has loads of weird quirks, like asking for my password 3 times every time I login or use the terminal.

What's gone wrong here, and how can I properly remove Ubuntu bootloader from the Windows drive, so that it no longer shows in my boot menu, so that I can wipe the second drive and attempt to get Ubuntu finally installed.

Here's a screenshot of the drives in disk management under windows: r

Kupo
  • 141

2 Answers2

0

See launchpad bug # 1396379 and bug # 1174357 for workarounds to the problem of the installer ignoring user input for bootloader location. Add yourself to the bug's "Does this affect me?". Basically the suggestion to install from the "try Ubuntu" desktop, start a terminal, and in a timely manner during the install, unmount the /boot/efi from the Windows disk and remount the EFI from the second disk.

Where you have already written to the first disk's EFI, just copy all the files from the first EFI to the second EFI. The Windows bootloaders are not needed, but a good backup. The ubuntu setup has a ...EFI/ubuntu.grub.cfg which refers to the ubuntu root on the second disk, so will work. The second disk's EFI also should have a device bootloader in ...EFI/Boot/bootx64.efi which should be either shimx64.efi or grubx64.efi depending upon if you installed with secure boot on). Check the size to see which bootx64.efi is. If it is shimx64.efi, there needs to be a copy of grubx64.efi in the same directory (EFI/Boot).

With the second disk booting successfully by selecting the device, you may remove the unwanted "ubuntu" entry in the EFI menu with efibootmgr. Simply delete the EFI/ubuntu... directory and files if you want, but they are a backup to the second disk's EFI.


Copying the first disk's EFI files to the second disk's EFI.

Assuming you set-up or made an EFI partition on the second disk, and formatted it with a FAT filesystem, you should have an empty filesystem on the second EFI, regardless of what you specified to the installer as the bootloader location. Lets assume the EFI partition is the first on the second disk so we will refer to it as /dev/sdb1 below -- adjust if you use a different disk letter or partition number. All the UEFI bootloaders are just files, and may be copied with normal file copy tools. You should be able to boot the ubuntu on the second disk, using the first disk's EFI bootloaders. The running system will have mounted the first disk's EFI partition at /boot/efi -- this is the source of the files to copy. For mounting the second disk's EFI, use /mnt, or if /mnt is already used for anything else, make a directory in /mnt and use that for the mount.

sudo mkdir /mnt/secondefi

Mount the second disk's EFI:

sudo mount -tvfat /dev/sdb1 /mnt/secondefi

Copy all the files from the first EFI partition to the second one

sudo cp -r /boot/efi/* /mnt/secondefi

The second disk now has a fully populated EFI partition. The EFI/ubuntu/grub.cfg file always had the UUID of the Ubuntu root partition on the second disk, (causing grub to fail if this second disk is not present), so no change is necessary.

To complete the setup of the second disk, edit the /etc/fstab entry for the /boot/efi entry to use the UUID of the second disk's EFI. Pick out the second disk's EFI UUID (Not the PARTUUID) from the output:

sudo blkid

Cleanup of the installer bootloader creation. The installer will have done several things incorrectly:

1) Created an firmware entry for ubuntu pointing to the fist disk's EFI. No entry is needed when booting the (properly set-up second disk). You may delete this entry with efibootmgr, or leave it if you are leaving the bootloaders in the first disk's EFI alone.

2) The EFI/ubuntu directory on the first disk's EFI may be deleted. If you do this, you should also delete the firmware entry.

3) The first disk's EFI default/devce botloader, EFI/Boot/bootx64.efi, has been replaced with grubx64.efi (or shimx64.efi). This bootloader should normally not be used, but might be invoked as a fallback in some cases. The original Windows bootloader EFI/Microsoft/Boot/bootmgfw.efi may simply be copied back to EFI/Boot/bootx64.efi, or the backup file ...bkp copied back to bootx64.efi.

ubfan1
  • 19,049
0

run: "MSConfig" ==>> [Boot] ==>> click on "Grub Boot Loader".[Delete]. [Save].