My issue is quite similar to this https://forums.opensuse.org/showthread.php/537764-Upgrading-an-existing-openSUSE-installation-from-a-standard-BIOS-motherboard-to-UEFI but probably simpler.
I want to upgrade a Leap 15.0 system to Leap 15.1. Although the hardware fully supports, and is configured for, booting in secure boot UEFI mode, the system currently boots in legacy mode (don’t ask – life’s too short) but it seems that nowadays secure boot is preferred. The existing (Leap 15.0) system seems to be set up for UEFI already:
From parted -l
Model: ATA KINGSTON SV300S3 (scsi)
Disk /dev/sda: 480GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: pmbr_boot
Number Start End Size File system Name Flags
1 1049kB 8389kB 7340kB primary bios_grub
2 8389kB 436MB 428MB fat16 primary boot, esp
...
6 343GB 480GB 137GB xfs primary legacy_boot, msftdata
From gdisk -l /dev/sda
Number Start (sector) End (sector) Size Code Name
1 2048 16383 7.0 MiB EF02 primary
2 16384 851967 408.0 MiB EF00 primary
From /etc/fstab
UUID=4D09-B9A3 /boot/efi vfat umask=0002,utf8=true 0 0
From /etc/mtab
/dev/sda2 /boot/efi vfat rw,relatime,fmask=0002,dmask=0002,allow_utime=0020,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
From file -sL /dev/sda2
/dev/sda2: DOS/MBR boot sector, code offset 0x3c+2, OEM-ID "mkfs.fat", sectors/cluster 16, root entries 512, Media descriptor 0xf8, sectors/FAT 208, sectors/track 63, heads 255, hidden sectors 16384, sectors 835584 (volumes > 32 MB), reserved 0x1, serial number 0x4d09b9a3, unlabeled, FAT (16 bit)
When I tried to upgrade to Leap 15.1 the installer noticed that it had booted with UEFI but the installed system was legacy mode and it warned me in bright red text that proceeding with the upgrade was not a good idea. So I aborted the upgrade and booted Leap 15.0 and used YaST to try to change the boot loader from GRUB to GRUB for EFI. YaST didn’t like that; it gave the error:
Execution of command ""/usr/sbin/shim-install", "--config-file=/boot/grub2/grub.cfg","--no-nvram","--removable"]]" failed
Exit code: 1
Error output: Installing for i386-pc platform.
/usr/sbin/grub2-install: error: install device isn't specified.
The only anomaly that I can see in the existing installation is that /dev/sda2 is FAT16 rather than the requisite FAT32. Is that the only issue preventing the change to GRUB for EFI? Or is it more complicated than that?
Obviously if I reformat /dev/sda2 then I’ll lose its contents, but does that matter while the system is booting in legacy mode? That is, assuming that /dev/sda2’s format is the problem, if I use some partitioning tool to change it to FAT32 will the system still boot in legacy mode given the rest of /boot is on /dev/sda6? I’d rather avoid killing a working system and then having to spend time rescuing it if there is instead a right way to all this.
Your helpful advice will be gratefully received.