Well, since posting that, I have purchased a 2TB Samsung 980 Pro SSD and I have moved all my day to day virtual machines onto it. When I first set it up, I did so planning to move to UEFI boot, so I configured it as follows:
- Code: Select all
parted -/dev/nvme0n1
(parted) print
Model: NVMe Device (nvme)
Disk /dev/nvme0n1: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 269MB 268MB bios_grub
2 269MB 55.8GB 55.6GB ext4
3 55.8GB 56.4GB 537MB fat32 EFI-System boot, esp
4 56.4GB 2000GB 1944GB
The second partition was targeted to become my new system partition, and the 4th partition is encrypted, holds the VMs and will ultimately also hold most of /home and /var.
So I rolled with this framework for awhile because I was much too busy doing other things.
Today, I decided to make the conversion. So, I rsync'ed my system into the second partition, then mount -o bind all the necessary filesystems onto the mount points in the new system partition (the second partition), then I chrooted into that partition to do the work.
I made the necessary changes to the fstab in the new system partition, specifically, I created these lines:
- Code: Select all
#EFI entry
/dev/disk/by-partlabel/EFI-System /boot/efi vfat defaults,umask=000 0 2
# Entry for /dev/nvme0n1p2
LABEL=NEWSYSTEM / ext4 defaults 1 1
Then, I mounted /boot/efi.
After that, I ran this command:
- Code: Select all
grub2-install --target=x86_64-efi /dev/nvme0n1
This command ran correctly, reporting the following (expected) errors:
- Code: Select all
EFI variables are not supported on this system.
I then exited the chroot and rebooted, entered BIOS and changed the boot setting to UEFI only. Saved the configuration, and tried to boot.
The system did not find any UEFI boot volumes. After some fiddling around, I set the BIOS to accept either UEFI or mbr, and it booted using grub2, though there were no nice skins, screens, or fonts on the boot.
So, at this point I have successfully migrated my system from an old mbr SSD running grub to a new gpt SSD running grub2, but I have not managed to get it to boot as UEFI.
Having hunted around on the internet, I am seeing people claiming there are lots of files in the /boot/efi directory, but I do not have that.
For instance, this link https://www.redhat.com/sysadmin/bios-uefi shows the following:
- Code: Select all
[root@localhost ~]# du /boot/efi
8 /boot/efi/System/Library/CoreServices
12 /boot/efi/System/Library
16 /boot/efi/System
2508 /boot/efi/EFI/fedora/fonts
17988 /boot/efi/EFI/fedora
2748 /boot/efi/EFI/BOOT
20740 /boot/efi/EFI
20764 /boot/efi
[root@localhost ~]# df -h /boot/efi
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 623M 237M 340M 42% /boot
[root@localhost ~]# find /boot/efi -name shim\*
/boot/efi/EFI/fedora/shimx64.efi
/boot/efi/EFI/fedora/shim.efi
/boot/efi/EFI/fedora/shimia32.efi
/boot/efi/EFI/fedora/shimx64-fedora.efi
/boot/efi/EFI/fedora/shimia32-fedora.efi
I have nothing resembling that in my /boot/efi. Here is what I show:
- Code: Select all
4.0K /boot/efi/dracut
4.0K /boot/efi/EFI/EFI/mageia
8.0K /boot/efi/EFI/EFI
128K /boot/efi/EFI/mageia
140K /boot/efi/EFI
412K /boot/efi/grub
2.4M /boot/efi/grub2/i386-pc
124K /boot/efi/grub2/locale
2.5M /boot/efi/grub2/fonts
5.0M /boot/efi/grub2
126M /boot/efi
The i386 entry is spurious when I entered a command incorrectly, I believe. I have not attempted to remove it because maybe it does belong there. Not sure, and the system does boot.
So, I seem to be missing some files needed for UEFI, but I don't see what they could be. Does anyone here know?
Now, while I describe a nice, clean, straightforward progression in this post, in reality it was much messier, with a fair amount of fumbling, following different recipes, and starting over. So it is entirely possible that there is some artifact of a previous attempt somewhere that is breaking things for me now; I don't know.
Can anyone steer me at this point?