Convert exixting Ubuntu 20.04 disk to UEFI

I use Ubuntu 20.04 as my only system in my laptop. Ubuntu resides on an SSD disk booting in legacy mode (i.e. BIOS, or MBR mode).
I have now bought a new laptop with Windows 10 pre-installed which of course boots in UEFI mode.
Since my new laptop has a slot for a second SATA disk, I want to keep the Windows 10 system and exploit the second slot to boot my old SSD Ubuntu disk from there, thus having a dual boot laptop.
I tried different configurations with the BIOS in my new PC but could not boot Ubuntu in legacy mode, even if it is supposed to do so.
Reading in help.ubuntu.com and here in askubuntu, I could only find a statement in which it says that the two systems must have the same booting mode.
I am not quite sure if this is my real problem, but I would like to give it a try, so I need to convert my Ubuntu disk to UEFI. Instructions are quite vague (they always suppose a fresh install), so I would like to know if it is possible to make my disk a UEFI disk without losing the possibility to boot back to my old laptop in legacy mode, and what is more important, without breaking my system (I have upgraded it through time from 16.04 and through different laptops, always managing to keep my installation safe).


Contrary to popular belief, there's nothing in a legacy install of Ubuntu that wont boot/run in UEFI mode. No "conversions" necessary. You probably should do a few things like:

  1. Add the /boot/efi mount point for the EFI (so any future updates of grub/shim will work).
  2. Add the fstab line to mount /boot/efi (totally non-critical to running).
  3. Change grub-pc to grub-efi so the grub.cfg which gets created will also boot Windows in UEFI mode. That's right, the legacy grub.cfg will still boot Ubuntu just fine.

I did such a legacy SSD to UEFI, setting up an EFI partition on the ssd, but my case was the first disk was still legacy. The same mode installation is necessary if you want to boot both Windows and Ubuntu from grub (because the mode decision has already been made by the time grub runs). I default to my UEFI ssd, and boot the hard disk via the EFI boot menu selection if I want to run Windows (or a legacy Ubuntu) off the first disk.


See https://help.ubuntu.com/community/UEFI for all the usual requirements on an EFI partition (ESP). (primary, FAT32, boot flag).

The choice you have to make is whether to use the primary disk's ESP or make a new ESP on the sdd. grubx64.efi + shimx64.efi take less than 6MB, so even if you double that for copies in .../EFI/Boot, you can fit the Ubuntu bootloaders into 12MB of free space. The drawback to using the first disk's ESP is that grub is now split across the two disks, and needs both to boot. Not really an issue if you don't plan on removing the SDD.

If you do plan on removing the SDD, expect the first disk to stil boot Windows, and maybe the removed SDD to boot on another machine, you should put an ESP on the SDD (100-200MB, FAT, boot flag, etc.). With the SDD first boot order, it will boot grub, which will boot either Ubuntu or Windows. Without the SDD, your laptop should just boot Windows (no grub).