Announcement

Collapse
No announcement yet.

UEFI + Windows 7 + Kubuntu 13.04

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    UEFI + Windows 7 + Kubuntu 13.04

    Hello, predictably, I have problems after attempting to install Kubuntu alongside existing Windows 7 installation in UEFI mode. Getting UEFI to run with Windows 7 was pain in the back alone, so I decided to wait a year before trying the Dual Boot setup, in vain, it seems.

    The problem is that the installation process did not detect the existing Windows installation and happily installed Kubuntu without asking too many question, making the Windows 7 installation inaccessible. I have read there are problems with Ubiquity failing to detect Windows installs on SSD disks, but too late. Now I am not familiar with UEFI too much, so I came here to ask a few quick questions about how to recover from this state. Please provide only helpful answers, yes, I did make some reading and googling, but nothing seems too easy with UEFI.

    First the facts:
    - The mainboard is Asrock Z77 Extreme 4 with the latest firmware 2.80, Both Kubuntu and Windows 7 Home installs are 64bit. All the disks are in GPT format - I had to painfully migrate them after finding out the hard way that Windows 7 won't boot in UEFI mode with MBR disks present.
    - I installed the Kubuntu and Windows to DIFFERENT physical disks, both SSD. That's why I was a bit reckless, I did not think there would be problems with separate disks setup

    The installation now boots right to Kubuntu. All my existing NTFS disks with windows files are intact and readable.

    Now a few questions:
    1) I presume that the UEFI boot partition was overwritten but the installer, and no, I don't have a backup, but is it still possible to recover somehow? I tried the Windows 7 DVD, but the repair process says the installed version is unrecognized
    2) I found the C:\Windows\Boot\EFI directory, there are efi files there, is it still possible to use them to boot via "Chainloader" or similar mechanism as with the old BIOS system?

    Sorry for being inaccurate and in haste, I am really starting to become frustrated, and I am in no mood to plough through pages and pages of not-so-relevant disaster cases similar to mine.

    If you have practical and constructive info, I would be extremely grateful. Thank you in advance.

    #2
    Okay, made some progress, by examining the disk structure in gparted, I have found out that the old EFI boot partition was most likely not deleted by the Kubuntu installer, under /boot/efi/EFI, I now have 3 directories called Boot, Kubuntu and Microsoft. The Boot and Microsoft directories have dates that match the Windows installation date, and seem to contain the EFI boot files, the Kubuntu directory is new. So not it will be just a matter of configuring a new menu item to Grub to give me the option to boot from the old MS EFI files besides the new Kubuntu boot... right?

    Comment


      #3
      Eventually, I was able to solve my problem. I will describe it here because I have a feeling I was not the only person encountering this situation.

      Using gparted, I was able to locate the disk and partition /boot/efi resided on, and I was able to tell enter a new GRUB menu entry for booting it. Into /etc/grub.d/40_custom I entered the following option:

      Code:
      menuentry "Windows 7"  {
        insmod part_gpt
        insmod fat
        insmod search_fs_uuid
        insmod chain
        search --fs-uuid --no-floppy --set=root 2445-77E8
        chainloader (${root})/efi/Microsoft/Boot/bootmgfw.efi
      }
      The uuid of the boot partition (in my case "2445-77E8") can by found by:

      Code:
      sudo /usr/sbin/grub-probe -t fs_uuid -d /dev/sda1
      Don't forget to do
      Code:
      sudo update-grub
      after editing menu entries.

      After rebooting, I was able to attempt to boot my old Windows installation, only I was greeted by error 0xc000000f - BCD configuration not found. Allegedly, the file /EFI/Microsoft/Boot/BCD was missing. After a moment of despair, I searched again the MS Boot directory and found that a file called BCD.Backup.0001 is present, with time of modification matching with the time of my botched Kubuntu installation. I copied the backup back with
      Code:
      cp BCD.Backup.0001 BCD
      , and after a reboot, my Windows installation booted correctly.

      You may notice that the computer will subsequently boot straight to Windows every time, and this can be solved by putting the "Kubuntu" option in the UEFI BIOS back to the highest priority.

      In conclusion, I suspect that the Kubuntu installer renamed BCD file to BCD.Backup.0001 to prevent the system to booting to Windows after installing Kubuntu and rebooting.

      Comment


        #4
        One last caveat I have encountered.

        Each time you boot to Windows using this setup, the Windows will rearange the EFI boot order so that the Windows Boot Manager is once again on top, thus bypassing the grub menu. This behavior cannot be easily disabled (at least I did not find how), so to counter this, you can modify the BCD information using the bcdedit command to tell Windows to boot with Grub instead of its own manager.

        You can mount the EFI partition in Windows:

        Code:
        mountvol s: /S
        Then look up in which directory in S:\EFI\ your kubuntu boot manager resides (it was in S:\EFI\kubuntu\brubx64.efi in my case), then set it for BCD by:

        Code:
        bcdedit /set {bootmgr} path \EFI\kubuntu\bootx64.efi
        Using just the bcedit command, you can display your current BCD settings.

        After this, your computer should boot to Grub menu, even though Windows is the first EFI boot option.

        Comment


          #5
          I would encourage you to investigate an alternate boot manager called rEFInd. It automatically detects all installed operating systems on all available partitions and presents them in a list during boot. Hardly any configuration is required, and it completely eliminates the ongoing pain that is GRUB + UEFI. I use it exclusively on all my machines now, and have purged GRUB completely.

          Comment

          Working...
          X