MBR to UEFI Upgrade

I’ve recently built a new PC and upgraded from an Intel Core i7 4770k and Z87 chipset, to a Core Ultra 9 285K and Z890 chipset. I was dual booting Windows on one SSD, and Fedora on a separate SSD.

I pulled the SSD with Fedora from the old machine and moved it over to the new box (and installed Windows on a new m.2 drive to keep the dual boot setup). However, the new BIOS shows the SSD as attached (complete with model number and capacity), but won’t recognize it as bootable. I understand this is a UEFI vs Master Boot Record issue. It seems the new BIOS and chipset also no long supports a Compatibility Service Module (CSM).

My plan (unless someone here can suggest a better option) is to re-install the latest Fedora on the SSD, using a live USB booted via UEFI. The drive has an LUKS-encrypted partition with /home, and everything else in the default partition layout. I’d remove those other partitions and just keep my home partition as I reinstall.

So, with this plan, my questions are.. 1) Is there an easier/better strategy to make this drive UEFI bootable? 2) If I reinstall, will the installer be able to remove and recreate the other partitions while leaving my encrypted home partition alone? Will the LUKS passphrase encryption still work once I’m done?

There’s noting irreplaceable on the home partition, but I’d really rather not take the time to reconfigure my development environments that are setup in my directory.

Since working with partitions is dangerous, I would just strongly suggest making sure you have a backup on another drive of the home partition you want to keep. You could use something like CloneZilla to make a complete backup of your entire drive or just the home partition you want to keep, or you could use something like rsync or even just a file copy.

However, I’m not sure if you can leave an MBR partition on a drive and convert that drive to GPT as the whole drive needs to be changed to the new partition scheme. Note that GPT is the partition scheme used by UEFI, so I think that’s technically what you need to do. So you’ll likely have to back your home partition up on another drive and then restore it anyway.

I recall Windows had a way to convert a drive from MBR to GPT. Not sure if there is an easier way to convert a Linux drive but you may want to google that. Again, make sure you have home backed up.

That is the easy part and this can be done by the gdisk program. The dificault part is to make room for the ESP and install the grub and shim parts. You would also need to add an entry to the UEFI boot menu, which can be done from a live system using efibootmgr. Clean install is much easier.

Here I documented exactly the steps I made for the MBR to GPT part. The less complicated one. For me it was complicated enough to understand all this expressions. So that is why i wrote them down.

So I guess you try to use the Windows ESP from the m.2 to also boot from Fedora, right? Then you just need what I made, to replace the MBR wit GPT. This way the installer is able to se the second SDD which still has MBR right.

Please show us the partition layout from the new computer two disks. M.2 & SDD with

sudo gdisk -l /dev/sda  # replace sda with your naming convention from your HD's/OS as it is seen.

The most difficult part will be maintaining the encrypted /home if you have to move data.

If you give us the asked information, we will be able to give you more tips.

I followed this guide that I found on a RedHat blog. It worked well enough, but I had trouble with un-mounting /boot. It was still showing as busy even though there was nothing using it (not mounted, no open file handles showing with lsof, etc). I ended up having to boot into single-user mode and then /boot was free to be resized. It left me without a grubconfig installed, but I was able to find the existing config and re-add it from the grub shell (a little nerve wracking). Once that was done, I swapped over to UEFI boot mode in the BIOS settings on the old PC (it could do both) and it booted up just fine. Swapped the drive back to the new PC and it still isn’t seen as bootable. :-/ Not sure why, but I’ll probably just find a USB drive I can put a live image on and re-install from there.

If /boot/efi is still mounted, then /boot is busy. You can run umount -R /boot to unmount both with one command.

You also need to create the UEFI boot entry on the new PC. On some systems, you can select the disk device from the UEFI menu and that would install the UEFI boot entry and then boot the system. It is a good idea to always have a Live system available as you never know when you might need it.