Windows ties its boot mode and partition table type together quite tightly:
- An MBR partition table may be used if and only if the computer boots in BIOS/CSM/legacy mode.
- A GUID Partition table (GPT) may be used if and only if the computer boots in EFI/UEFI mode.
You currently have an MBR partition table. The error message you report indicates that you booted the Windows installer in EFI mode. To install to your disk, you must boot the installation disc in BIOS mode. Your firmware is almost certainly already configured to support this (see below), but you happened to follow an EFI path when booting the Windows installer. Try again by using the computer's built-in boot manager (typically accessed by hitting a function key early in the boot process). This time, though, carefully read the options. There will probably be two options for the optical drive or USB flash drive you're using. One option will include the string "UEFI" and the other won't. Select the option that lacks this string and you should boot in BIOS/CSM/legacy mode.
If you don't see a BIOS-mode boot option, it's possible that your boot medium lacks that support. A few USB flash drives seem to be unbootable in BIOS mode on some computers, in my experience, even when they've got the right data; this seems to be something electrical about the device. Thus, you might need to try another USB flash drive. It's also possible for a USB flash drive or optical disc to be missing the necessary files or data structures, in which case you may need to prepare the disc in some other way. I don't know what that way might be for a Windows installation medium. You may need to ask on a Windows forum if you think this is the problem.
Incidentally, you are almost certainly already booting Ubuntu in BIOS mode. I say this because, when Ubuntu installs in EFI mode, it uses GPT by default, but your fdisk
output and screen shot both show an MBR partition table. Furthermore, it's an MBR partition table that lacks an EFI System Partition (ESP), which is where EFI boot loaders are stored.
If you can't seem to get the Windows installer to boot in anything but EFI mode, you can convert your Ubuntu installation to boot in EFI mode, too. This process is not risk-free, so you should back up before proceeding. To try:
- Download the USB flash drive or CD-R image of rEFInd. Prepare a boot medium and test that it works. (You should be able to boot your existing Ubuntu installation with it.)
- In Ubuntu, launch
gdisk
on your hard disk (as in sudo gdisk /dev/sda
).
- In
gdisk
, type v
to verify the disk. If gdisk
reports any errors, abort by typing q
and fix the problem.
- If there are no problems, type
w
to save your changes (the conversion from MBR to GPT that gdisk
does automatically).
- Reboot into an Ubuntu live CD.
- Use GParted to resize a partition so that you've got ~550MiB of free space. This free space can be anywhere, but it's best near the start of the disk.
- In the free space, create an ESP. This should be a FAT32 partition with its "boot flag" set.
- Install Windows.
- Using the rEFInd CD or USB drive, test that you can boot both Windows and Ubuntu.
- Using rEFInd, boot to Ubuntu.
- Install a Linux boot loader. Two relatively easy options are:
- Install the rEFInd Debian package or PPA.
- Run Boot Repair to replace the BIOS-mode GRUB you've got now with an EFI-mode GRUB.
- Reboot and hope it all works.
The whole disk uses either the GUID Partition Table (GPT) or the Master Boot Record (MBR) partitioning system; you can't convert just one partition from GPT to MBR or vice-versa. That said, there is something called a hybrid MBR, in which an MBR is laid atop a GPT; but this is an ugly and dangerous hack that would be useless for your specific situation anyhow, so don't even think about it. (I only mention it so you won't try to use it if you read about it elsewhere.)
It's not clear from your post what you understand of BIOS-mode vs. EFI-mode booting. BIOS-mode is the old style of booting that's been used since the 1980s. EFI-mode booting is relatively new; it's only become common since about 2011, or a bit earlier on Macs. To boot in EFI mode, your firmware must be an EFI (or its newer variant, UEFI). Most EFIs also support BIOS-mode booting via a Compatibility Support Module (CSM), aka legacy-mode booting.
Windows ties its boot mode to the partition table type; you can only install or boot Windows in BIOS mode on an MBR disk; and in EFI mode on a GPT disk. Linux is much more flexible about this, although most distributions enforce an EFI/GPT marriage in their installers. The mode of any given boot depends on a complex interaction of factors, including firmware settings, disk layout, and user choices. On most UEFI-based PCs, EFI-mode booting is the default; BIOS-mode booting is possible only if it's enabled in the firmware setup utility. Enabling this feature greatly complicates the boot process. Given your symptoms, it's virtually certain that this feature is active on your computer.
In any event, the error message you're seeing indicates that you've booted the Windows installer in EFI mode, but your disk uses MBR. With an EFI/MBR setup, the Windows installer will refuse to proceed. If you've got a PC (not a Mac), you have two main choices:
- Getting the Windows installer to boot in BIOS mode makes sense. You may be able to do this by using your computer's boot manager to force a BIOS-mode boot. The boot manager is usually accessed by hitting Esc, Enter, or a function key as you power on the system. When you enter the boot manager, with any luck you'll see two entries for booting the Windows installer, one of which includes the string "UEFI" and the other of which doesn't. Select the entry without the "UEFI" string. This procedure isn't 100% reliable, but it usually works.
- You can convert the disk to GPT using
gdisk
, as oldfred suggested in his comment; however, you'll need to re-install your Ubuntu boot loader. If you install Windows in EFI mode (which would be the point of this conversion), you'll do well to install an EFI boot loader for Linux, too. (Booting Windows in EFI mode and Ubuntu in BIOS mode is possible but is highly inadvisable.) Several are available, as described on my Web page on this subject. Probably installing the EFI version of GRUB via Boot Repair or my rEFInd will be easiest to manage.
It's hard to say which approach is better. If Windows was pre-installed, it probably booted in EFI mode and used GPT to begin with, which means you've changed things considerably since you got the computer. The extent and reason for these changes is unclear, which makes it hard to give concrete advice. If you installed Windows yourself, there's no telling how it was initially set up. Without your complete partition table information, it's impossible to say if you might run into partitioning issues with either approach.
One further possible complication is that Windows sees a hybrid MBR as an MBR, but Linux sees such a disk as using GPT. Macs often use hybrid MBR setups to enable OS X and Windows to coexist. If this is what you've got, then neither of my preceding suggestions is 100% in order; removing the hybrid MBR in favor of a regular GPT is likely to be best. Post the output of sudo gdisk -l /dev/sda
if you've got a Mac and you want to know if this might be what's going on.
Oh, and using DiskPart in Windows to convert from GPT to MBR will trash your Ubuntu installation. In fact, I trust the Windows partitioning tools about as far as I can throw my house, so I wouldn't use them except as a last resort, and perhaps to shrink existing Windows partitions.
Best Answer
Type of partitioning of drive is critical for Windows install. Less so for Ubuntu.
Windows only installs to MBR(msdos) partitioned drives with BIOS. Windows only installs to gpt(GUID) partitioned drives with UEFI.
For both Ubuntu & Windows how you boot install media UEFI or BIOS is then how it installs. And always best to have all systems boot in same mode. Grub can only boot systems installed in same mode, but you can boot from UEFI boot menu if not in same boot mode.
If system is BIOS/MBR Windows has to have a primary NTFS formatted partition with the boot flag. Only one boot flag per device. Does not have to be sda1, but should be before the extended partition to avoid some other issues. Normal installs of Windows use two primary partitions, the 100MB boot, and main NTFS. But Windows will install to one NTFS primary partition.
With UEFI/gpt Windows requires space to install, needs several partitions.
Windows 7 DVD is BIOS, but can be copied to flash drive and converted to UEFI boot. You have to create the default UEFI boot /EFI/Boot/bootx64.efi on Windows flash drive. Files are there just need moved to correct locations and/or renamed.
Newer Windows is like Ubuntu installer that can be booted in either UEFI or BIOS boot mode.