When installing Ubuntu I unknowingly set my EFI mount to the windows EFI partition. Now I need to delete windows along with its EFI partition for a fresh install. I already have another partition prepped up to be the Ubuntu EFI boot partition. How do I migrate /boot/efi to that partition?
An EFI System Partition (ESP) is simply a FAT32 partition with a GUID type code of C12A7328-F81F-11D2-BA4B-00A0C93EC93B (or 0xEF on an MBR disk). Most partitioning tools have some other way of displaying the GUID type code, because GUIDs are so cumbersome. In
Thus, to create a new ESP, you would:
For making partition table changes, there's no need to be concerned with your boot mode -- you can use EFI mode or BIOS mode as you see fit. (That said, some computers make it easier to boot from USB or CD-R in one mode or another.)
I agree with oldfred that creating a new ESP is unlikely to be necessary in your scenario. If you want to completely erase the Windows boot loader from the ESP, feel free to do so -- it would be the
This example deletes boot option #4, which is identified as "Windows boot manager." (I don't recall the name that Windows uses by default; I edited this example from one of my systems on which Windows is not installed.)
Try using the Ubuntu's disk manager before installing it. Allow bios to be in CSM boot mode before installing "try ubuntu", disks, click on the partition needed format, leave blank or you can format to ext2. Restart, bios back to UEFI boot mode, install should work fine.
Using a bootable USB flash drive with your version of Linux installed including Gparted.
Boot from the flash drive by accessing boot order in your BIOS.
On my Asus laptop, the Aptio BIOS, it was necessary to disable FastBoot and SecureBoot before the BIOS would enable Flash drive booting as an option.
Once you can boot from USB, run your Distro with the "Try Ubuntu" option. Now that you are running from the Flash Drive, using Gparted to manage your partitions is fairly straightforward.
Using Gparted while logged in on your HDD Distro is risky.