22

I like to use the latest hardware and the latest software; thus I have a Laptop (Lenovo X220) with

  • UEFI instead of BIOS
  • an SSD instead of an HDD
  • GPT partitioning scheme instead of MBR
  • USB to boot from instead of optical disks.

I need to use both Windows and Linux. I tried to make them work alongside, but I didn't succeed.

Most Linux distribution isos don't even really work on UEFI systems booted from USB. (Not even the self-claimed cutting-edge Fedora. I also tried Linux Mint Debian Edition and Sabayon Linux (according to this guide) which did not work. Only Ubuntu worked for me.

I first installed Windows 8 which created sda1: Recovery, sda2: EFI system, sda3: msftres, sda4: NTFS Windows. Windows worked without a problem. I then created sda5: linux-swap and installed Ubuntu into sda6: btrfs. After rebooting, I was not presented GRUB2 as expected, but instead my system just booted into Ubuntu. I could no longer access Windows.

After fixing dpkg in btrfs Ubuntu, I followed the Ubuntu documentation on UEFI booting. The result left me with a broken GRUB2, but interestingly, when I wanted to select the device to boot from, I was not only presented the internal SSD, an attached USB device, or LAN, but also Grub2 (broken), Ubuntu and Windows.

The result is not very satisfying to me.

What would I have to do to fix everything? Or differently asked, what operating system should I install at what point given my possibilities and requirements, so that I have a working bootloader in my UEFI GPT system which presents me a working Linux and Windows.

2

2 Answers 2

23

OK, it was a very involving process, but I solved my problem and everything works together just as it should.

I'm documenting the solution for everyone:

  1. One must begin with GParted Live and create a fresh GPT partition table. This will wipe everything on the HDD resp. SSD. Then one must create a small 8 MB 'unpartitioned' partition and flag it with 'bios_grub'. Afterwards, one creates a 100 MB fat32 partition labeled 'EFI' and flagged 'boot'. (This is the modern and more transparent equivalent of what the MBR used to do, see here for reference.)

  2. Optional: Install a Linux distribution that works correctly on GPT UEFI systems from USB. I don't know which ones do. I installed Chakra Linux to try it out. While installing make sure to mount the 100 MB fat32 as /boot/efi. Do the rest as usual. I left some unformatted room for Windows 8 (300 GB), created a linux-swap of 1 GB afterwards, created an adjoining ext4 (25 GB) and mounted it as /. After installation it will not boot, but we will fix that with ease. Do the entire step again for installing more distributions.

  3. Install Windows 8 in the unformatted space we left in the previous step. It will automatically identify the EFI system partition, create a MSFTRES, and a NTFS where it installs itself. After installation we can only boot into Windows, but we will fix that later.

  4. Ubuntu will fix it all. While installing select the 100 MB fat32 and change it into 'use as efi'. Create an ext4, install Ubuntu. Upon rebooting we are presented a nice working GRUB2 which detects Ubuntu and Chakra Linux.

  5. Now we will configure GRUB2 to detect Windows. It is a known bug, however, Rasmus Pedersen's workaround is functional. Be aware of a typing error he made: It is /etc/default/grub without an s instead of /etc/defaults/grub. When writing "chainloader (${root})/efi/Microsoft/Boot/bootmgfw.efi" I wrote /EFI/ in capitals just to be sure. When done this will present us a working GRUB2 with a working Windows 8 entry.

  6. GRUB2 does not look very nice with so many boot options and it is not in my preferred order. Thus I install and use grub-customizer in Ubuntu as shown here. I configure it so to hide the memtest, the recovery and the old kernels, and I reorder it to put my custom script with Windows on top. Done.

4
  • very nice , thanks for this post , just one additional thing: I would like to use software RAID 0 as for windows 7 as for linux from 4 paritions I have been went through many times to configure RAID 0 within described "technology usage" except the dual boot windows 7 on RAID 0. Does anybody has experience with it ? thanks for any info. regards, Martin
    – user131527
    May 1, 2012 at 20:17
  • Thank you very much for your answer, I followed your steps, but. After I did step 5, I can't boot into windows 8 with the entry. I am sure the entry is correct, because windows 8 logo has appeared shortly but after that nothing will show up and the system will reboot automatically. Because I installed both windows 8 and Ubuntu with uefi mode, I have both uefi Ubuntu and uefi windows boot manager in my uefi. Before I install Ubuntu, the windows boot manager can boot me into windows 8. But after all what I did, it doesn't work anymore. It gives me the same error as I got from selecting the windo
    – user143171
    Jun 29, 2012 at 15:45
  • This answer was very helpful to me as a basis for my install. Aug 5, 2012 at 3:48
  • Nice share @gbag. For those going with Ubuntu and GRUB2 in place of rEFInd, according to bugs.launchpad the "Not detecting Windows Boot Entry" bug is fixed in ubuntu starting with 12.04.3 ("Saucy" rel 3).
    – tuk0z
    Jul 27, 2015 at 13:59
3

Kubuntu and LinuxMint KDE distro's worked fine for me with GPT and EFI.

Steps:

  1. Start Windows 7/8 install and configure HDD partition, it will create automatically the EFI boot, MS System Reserved, for Windows 8 also the recovery partition. Install Windows.
  2. Install your desired Linux distro with EFI support. Select manual partitioning and to install bootloader on "/" root partition, Grub 2 EFI files will be automatically installed on EFI boot partition, alongside with those of Windows.
  3. Install rEFInd and your good to go. rEFInd will do the job and offer you option to chose desired operating system at PC start. Install rEFInd info - http://www.rodsbooks.com/refind/installing.html. Before rEFInd install, you must select boot device at start with your BIOS dedicated key, or by entering in BIOS and put desired device first in list, boot Windows and configure rEFInd from Windows. Make sure that proper EFI partition is set as default boot device in BIOS.

I personally prefer Kubuntu 12.10, probably Mageia 3 will be nice to but it's a long way till 2013 spring.

Good luck.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .