UEFI and GPT Mess with Windows 10 and Linux

Operating System not found

I’ve recently bought a Dell XPS 13 9350.

Problem

I tried installing Fedora on it but the installer was not able to detect the SSD. I tried disabling UEFI and it worked. The problem was that as soon as I disabled it I was no longer able to boot into Windows 10. I tried different combinations and every change that resulted in Fedora installer seeing the drive, broke Windows 10 boot setup. I thought I would be able to enable UEFI after the setup and use Windows 10 whenever I needed it and decided to install Fedora.

How I messed up

I booted into Windows 10 and created a new partition to use for Linux by shrinking Windows partition. I disabled UEFI and went through the Fedora installation process.

After the installation I immediately tried enabling UEFI and booting into Windows. Windows 10 was no longer listed under UEFI boot options. Having not been able to get WiFi working under Linux (damn you Broadcom) yet, laptop turned into an useless non-internet device. I’ve spent hours on Windows Recovery Tool. I tried everything I could find: Start-up repair, diskpart, bcdedit, bcdboot, bootrec. Nothing worked. Whilst doing all these I broke my Fedora installation as well.

Little too late

I read somewhere that to get XPS 13 9350 dual booted with Linux all I needed to do was to switch to “AHCI” SATA mode (i.e disable RAID Intel Rapid Storage Technology) and to disable Secure Boot. Secure Boot was already disabled for me. So I switched to AHCI and continued testing.

Hours of reading and trying different things, made me kind of a UEFI expert. I realised that the disk partitioning scheme and file system were important for UEFI to work properly. I tried different tools to see the details about the disk.

How I found the solution

When I booted into Fedora live CD and ran “parted” on my disk using following commands:

$ sudo parted
(parted) select /dev/nvme0n1
(parted) print

This line of the output seemed important:

Disk Flags: pmbr_boot

I immediately googled it and the first result made me realise what the reason all this had happened:

… I had to use parted to set the protective master boot record boot flag to “on” for the disk sda as well to have the BIOS to boot from that disk.

Does the pmbr_boot flag always have to be set to “on” for a BIOS system to be able to boot from a GPT disk? Or are there some cases where it’s enough that the boot partition itself has the boot flag set?

I thought, if this flag makes BIOS boots possible on GPT disks, it might well make UEFI boots impossible! My guess is Fedora installer added that flag onto the disk.

Solution

I unset the pmbr_boot flag from the disk using the following:

$ sudo parted
(parted) select /dev/nvme0n1
(parted) disk_set pmbr_boot of

I don’t remember clearly but I think inside BIOS I needed to manually add the UEFI boot entry for Windows 10.

UEFI Windows Boot Manager entry

Resulting boot menu (when F12 pressed):

Dual UEFI boot options (Fedora and Windows Boot Manager)

Last words

Thanks for reading. If you are experiencing a similar issue with your new Windows 10 laptop, please comment. I will try to respond and update the post to help more people. Currently I think I might be the only fool that can do such a thing. If there is a question on a stack exchange site, please point me to it.

See also

4 thoughts on “UEFI and GPT Mess with Windows 10 and Linux

  1. Thanks Oliver, your finding and this great post really helped me on the same issue with my Asus X302L, Windows 10 and Fedora 23

  2. yes. i have a 9350 and uefi is a mess. i am having the exact issues trying to dual boot any linux. i had no such issues with any machine ive used before. problem is im a linux noob wanting to ditch windows for good. the boot time is also a disgrace. my last laptop 2n gen i5 booted in 13s. this dell takes over 20. i also embarrassingly returned a perfectly good ssd upgrade because this machine couldnt recognize it in raid. my next laptop, i will ignore the reviews and and look closer under the hood.

  3. I was trying to dual boot windows 10 and Kali. I’ve tried everything, but I haven’t been able to figure it out. I’ve changed the boot order (usb diskette on top), i’ve tried to select it (esc then f9). I did it a long time ago with Ubuntu but the computer just doesn’t boot the usb like it did before. To get rid of ubuntu I just deleted the partitions, could that have something to do with it? BTW i have a windows 10 hp laptop

Leave a Reply

Your email address will not be published. Required fields are marked *