Installing on separate drive from Windows in UEFI

I’ve just built a new desktop with two SSDs, one for Windows 8 and the other for OpenSUSE 13.1 (for dual-boot). Unfortunately, GRUB2 refused to install because the drive containing the /boot/efi partition didn’t have a GUID Partition Table. Finding no option to create one, I booted back into Windows, shrank its partition, then went back into OpenSUSE install to put my /boot/efi on the newly freed space (after partitioning it to FAT). But the installer still complained of not having a GPT. How can Windows boot from the drive if there’s no GPT?

Is there any way to get this dual-boot to work? And without touching the existing Windows installation if at all possible.

P.S. I can’t set by BIOS to any sort of legacy mode. It’s UEFI-only.

Something seems amiss here.

If your system only supports UEFI, and if you have Windows 8 installed, then Windows 8 should be running as a UEFI system. And, in that case, Windows 8 should already be using an EFI partition. You should be able to mount that as “/boot/efi”. Opensuse uses very little space on that partition, so there should be enough space there. On my system, it is using around 4M.

You mean the Windows “System Reserved” partition? Or the actual Windows install partition? Mount one of those as /boot/efi?

Here’s the output of “gdisk -l /dev/sda” on my system. “/dev/sda” is the Disk where Windows is installed.


# gdisk -l /dev/sda
GPT fdisk (gdisk) version 0.8.10

The protective MBR's 0xEE partition is oversized! Auto-repairing.

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 1953525168 sectors, 931.5 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 0110ECE8-B04B-4D35-9B90-EE6575DACEFD
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 1953525134
Partitions will be aligned on 2048-sector boundaries
Total free space is 953212861 sectors (454.5 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048         1026047   500.0 MiB   EF00  EFI system partition
   2         1026048         1107967   40.0 MiB    FFFF  Basic data partition
   3         1107968         1370111   128.0 MiB   0C01  Microsoft reserved ...
   4         1370112         2394111   500.0 MiB   2700  Basic data partition
   5         2394112       972857343   462.8 GiB   0700  Basic data partition
   6       972857344       973574143   350.0 MiB   2700  
   7      1926782976      1953523119   12.8 GiB    2700  Microsoft recovery ...

The EFI partition is labelled “EFI system partition” (but I think that’s just a label), and has partition code listed as EF00.

I tried “parted -l /dev/sda” but it seems to ignore the “/dev/sda” and give info for all disks. Here’s the section of “parted -l” output that is relevant to “/dev/sda”


Model: ATA WDC WD10EZEX-75Z (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name                          Flags
 1      1049kB  525MB   524MB   fat32        EFI system partition          boot
 2      525MB   567MB   41.9MB  fat32        Basic data partition          hidden
 3      567MB   701MB   134MB                Microsoft reserved partition  msftres
 4      701MB   1226MB  524MB   ntfs         Basic data partition          hidden, diag
 5      1226MB  498GB   497GB   ntfs         Basic data partition
 6      498GB   498GB   367MB   ntfs                                       hidden, diag
 7      987GB   1000GB  13.7GB  ntfs         Microsoft recovery partition  hidden, diag

One difference is that the “parted” output shows the file system type, and it should be “fat” (either “fat32” or “fat16”) for the EFI partition.

I hope that helps you recognize which partition to use.

In my case, that would be “/dev/sda1” as the EFI partition that should be mounted as “/boot/efi”.

In my case, I actually created an addition EFI partition on the linux disk ("/dev/sdb") and am using that. Different UEFI implementations vary on how they deal with multiple EFI partitions. I used 500M size for “/dev/sdb1” (my additional EFI partition).

Yes, this is just an (arbitrary) partition name.

and has partition code listed as EF00

These codes are meaningless outside of gdisk, so probably just add to confusion for beginners.

On Windows EFI System Partition is not normally visible, unless explicitly mounted using “mountvol x: /s” where ‘x’ is arbitrary drive letter. This mount is temporary IIRC (until reboot).

I tried “parted -l /dev/sda” but it seems to ignore the “/dev/sda” and give info for all disks…

“parted /dev/sda print”

I’m pretty sure that “gdisk” translates that to a specific GUID, so it should reflect that the partition has the appropriate GUID for an EFI partition.

“parted /dev/sda print”

Thanks.

OK, I’ve got OpenSUSE installed and booting on my other hard drive. Rather than using custom partitioning from the beginning, I told it to use /dev/sda and then edited the partition setup for /home mounted on my third drive (large mechanical). This created a GPT label on sda and a vfat-formatted /boot/efi partition on it as well. However GRUB2 doesn’t have an entry for booting Windows. And even stranger, fdisk reports that /dev/sdb has no GPT and is only old-fashioned MBR, with no MS EFI partition. There were no options for EFI/GPT or MBR in the Windows installation, and I’m using an EFI-only motherboard, so I assumed it was EFI.

os-prober didn’t see Windows, and manually creating a Windows entry for grub with a script in /etc/grub.d with “set root=(hd1,2)” (in the menuentry block, etc) didn’t work. Neither did (hd1,1). That’s both of the only partitions on sdb. Can GRUB2-EFI even work with a non-GPT Windows install?

I can still get to both OSes with my BIOS’ boot selection, so I suppose it’s not critical, but it is inconvenient (and tricky with the short time to hit the F key on BIOS).

Probably not.

One option is to switch opensuse to using traditional BIOS booting.

Yast → System → Bootloader

and then switch to using “grub2” for booting.

That would probably leave your system able to boot opensuse either in UEFI mode or in traditional BIOS mode (or CSM mode). But you could make BIOS/CSM booting the default, and that should give you a Windows 8 menu entry.

It may require manually removing EFI boot menu entry for openSUSE with efibootmgr before reboting, otherwise firmware will likely continue to use it. Or setting legacy BIOS as first in boot order.

Well switching to grub2 (non-efi) didn’t break anything with regards to booting OpenSUSE. That still works fine. However os-prober still does not see my Windows install. And my attempt to create my own Windows entry still doesn’t work (volume not found error; (hd1,2) is the second partition of the second disk, right?). Perhaps I can do a disk-by-id like the OpenSUSE boot has? I know how to find the Windows drive’s ID.

I also have the output of fdisk for you to consider, since I’ve got the linux side up to a working state:

>fdisk -l
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.


Disk /dev/sda: 120.0 GB, 120034123776 bytes, 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: gpt




#         Start          End    Size  Type            Name
 1         2048       321535    156M  EFI System      primary
 2       321536      4530175      2G  Microsoft basic primary
 3      4530176    234440703  109.6G  Microsoft basic primary


Disk /dev/sdc: 500.1 GB, 500107862016 bytes, 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0xcf5cf38f
                                                                                                                                                             
   Device Boot      Start         End      Blocks   Id  System                                                                                               
/dev/sdc1            2048   734005247   367001600    7  HPFS/NTFS/exFAT                                                                                      
/dev/sdc2       734005248   976773119   121383936   83  Linux                                                                                                
                                                                                                                                                             
Disk /dev/sdb: 120.0 GB, 120034123776 bytes, 234441648 sectors                                                                                               
Units = sectors of 1 * 512 = 512 bytes                                                                                                                       
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x550169a3


   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048      718847      358400    7  HPFS/NTFS/exFAT
/dev/sdb2          718848   234029055   116655104    7  HPFS/NTFS/exFAT

And specifically for /dev/sdb (Windows drive):

>gdisk -l /dev/sdb
GPT fdisk (gdisk) version 0.8.7


Partition table scan:
  MBR: MBR only
  BSD: not present
  APM: not present
  GPT: not present




***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory. 
***************************************************************


Disk /dev/sdb: 234441648 sectors, 111.8 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 2D3AE360-0DFF-426F-AF36-245425F4E608
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 234441614
Partitions will be aligned on 2048-sector boundaries
Total free space is 414573 sectors (202.4 MiB)


Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          718847   350.0 MiB   0700  Microsoft basic data
   2          718848       234029055   111.3 GiB   0700  Microsoft basic data

Any new ideas for Grub?

You can’t really chain load on an EFI machine particularly if secure boot is on. Mixing modes is very messy. Can you boot Windows from the BIOS boot menu. That may end being the way you choose an OS.

Secure boot is disabled. I can indeed boot Windows from the BIOS selector; that’s how I’ve been doing it. It’s just inconvenient- I have to be right on that F11 key to pick the OS, as UEFI on an i7 goes by quick. At least restarts to try again are also fast.

Well everyone, I’ve got things fixed. As it turns out, there’s an open-source tool called gptgen that allows you to non-destructively convert MBR disks to GPT/UEFI. There were even online instructions written by someone on the Microsoft TechNet wiki for using it to convert an existing Windows install to GPT, then using an install disk to delete the system reserved partition and creating a new EFI part and a new MSR one, then writing boot files for it.

That whole process went swimmingly, I rebooted into Windows to verify that it worked, then rebooted into OpenSUSE (manually with the BIOS). I set grub back to grub2-efi, ran os-prober, and it quickly found Microsoft UEFI bootloader. So all I have to do is set the OpenSUSE drive to default in my BIOS and I’ve got a working dual-boot.

Thank you everyone who gave me helpful information and advice in the previous replies. It’s much appreciated.