After a lot of trial and error, I finally managed to do it. I think I should explain what I did in case it might help others.
To summarize (and simplify), my problem was as follows. I had Windows 7 installed on a MBR hard drive. I wanted to install Linux (CentOS 7) and have a dual-boot system. To do this, I had to change
my hard drive from MBR to GPT.
You’ll need to plan for at least two additional partitions on the hard drive, one for Linux and one for a UFI boot partition. You’ll probably also want a third partition, for swap.
You’ll also need the following:
1. System Recovery media for Windows. This can (and probably should) be the Windows installation DVD, but if you’re using Windows 7, you’ll need to create a USB drive with USB drivers using the utility provided by your motherboard’s manufacturer. (I don’t know about Windows 10.)
2. CD/DVD or USB media to install Linux.
3. A live Linux CD/DVD or USB media with at least gdisk
, and preferably gparted
(and therefore X Window). This can be the Linux installation media if it has a rescue mode. I used System Rescue CD
Of course, you’ll also need a motherboard that supports UEFI.
Here’s the procedure:
1. Boot from the Linux live media. Use gparted
if necessary to create the additional partitions you’ll need. The UFI partition can apparently be quite small; even 100 MB is enough.
2. Using the same Linux live media, change the hard drive from MBR to GPT using sgdisk -g /dev/sda
(for example). Mark the UFI partition as type EF00. If gdisk
complains, tell it to recover the hard drive information as an MBR hard drive and then re-write the partition table.
3. Format the UFI partition as FAT 32 and mark it as type EF00. This should also label it as a boot partition, but check using gparted
4. If necessary, reboot and change your BIOS options to switch to EFI mode.
5. Reboot using the Windows System Recovery media. You’ll need to install the EFI boot files in the UFI partition you just created. Telling Windows to repair your system should be enough. If not, try the instructions here
6. Now reboot using the Linux installation media. Install Linux. You’ll have to specify a UFI partition to mount at /boot/ufi
, at least with CentOS 7. Use the UFI partition you previously created. Don’t format it; this partition will be the UFI partition for both Windows and Linux.
7. During the installation procedure, Linux should automatically install Grub2 with an option to boot Linux and an option to boot from the “Windows Boot Manager”.
It doesn’t sound hard, but if you can get it right without instructions the first time, or even the third time, you’re smarter than I am.