Ubuntu: (U)EFI > Ubuntu vs Windows 8 - problems with booting Windows [duplicate]



Question:

I have a problem with a screwed dual-boot of ubuntu 13.04 and windows 8 on a new DELL XPS 12 (EFI/grub2) System not loading windows8 at all,... here is a story:

I've got a new DELL XPS 12 System with preinstalled Windows8 on (U)EFI Firmware (I have never dealt with EFI before).

There are 5-6 partitions over there :

  • EFI
  • Windows 8
  • Hibernate
  • Ubuntu 13.04
  • Windows Data
  • Repair

but it worked as expected for few weeks.

I decided then to install a new Ubuntu 13.04 x64 on top of Windows8 with dual boot. Somehow (don't ask) I screwed Windows 8 partitions and got only a new Ubuntu installed on a new partition I've created before but lost the access/boot as well as a way to read any of the NTFS Windows partitions I had. I tried to fix that all during the next few days by using TestDisk, BootRepair and few other tools quite successfully and now I am close to a final solution yet not there, needing some help.

Here is the actual situation:

  • Ubuntu 13.04 x64 installed and working as expected with grub2 loader
  • From ubuntu I'have all the NTFS partitions readable so my Windows 8 and Windows Data partition are there
  • On computer boot in EFI mode (NO secureboot though) grub2 loads and Ubuntu starts up with no issues
  • The problem is that Windows8 does NOT boot from grub2 stating "...EFI" file not found
  • Comparing the issues with some others I've read here seems I have Windows 8 EFI file screwed as my bootx64 and bootmdfw efis are 121KB big and not 1.3MB as some reported/supposed for Windows 8
  • Boot-Repair does not help neither does win8 repair liveUSB wit bootxxx /fixmbr /fixboot options whatsoever

Here are my Boot-Repair paste file as well as list of my actual partitions/efi files...

boot-repair report --> http://paste.ubuntu.com/5668969/

list of partitions  ------------------               Partition    Start Sector    End Sector  # of Sectors System  EFI        > /dev/sda1           2,048     1,026,047     1,024,000 EFI System partition  Win8-OS    > /dev/sda2       1,026,048   132,098,047   131,072,000 EFI System partition  Win8-Hyber > /dev/sda3     132,098,048   150,530,047    18,432,000 EFI System partition  Ubuntu 13.4> /dev/sda4     150,530,048   236,510,511    85,980,464 Data partition (Windows/Linux)  Win8-Data  >/dev/sda5     236,513,280   500,118,157   263,604,878 Data partition (Windows/Linux)  ------------------    list efi files  --------------  /boot/efi:  total 5  drwxr-xr-x 3 root root  512 gen  1  1970 .  drwxr-xr-x 5 root root 4096 mag  8 10:09 ..  drwxr-xr-x 5 root root  512 mag 14 01:25 EFI    /boot/efi/EFI:  total 3  drwxr-xr-x 5 root root 512 mag 14 01:25 .  drwxr-xr-x 3 root root 512 gen  1  1970 ..  drwxr-xr-x 2 root root 512 mag 13 17:02 Boot  drwxr-xr-x 3 root root 512 mag 14 01:25 Microsoft  drwxr-xr-x 2 root root 512 mag  6 10:18 ubuntu    /boot/efi/EFI/Boot:  total 239  drwxr-xr-x 2 root root    512 mag 13 17:02 .  drwxr-xr-x 5 root root    512 mag 14 01:25 ..  -rwxr-xr-x 1 root root 121856 mag 13 17:02 bootx64.efi  -rwxr-xr-x 1 root root      0 mag 13 17:02 bootx64.efi.grb  -rwxr-xr-x 1 root root 121856 mag  8 10:09 bootx64.efi.old    /boot/efi/EFI/Microsoft:  total 2  drwxr-xr-x 3 root root 512 mag 14 01:25 .  drwxr-xr-x 5 root root 512 mag 14 01:25 ..  drwxr-xr-x 2 root root 512 mag 14 01:25 Boot    /boot/efi/EFI/Microsoft/Boot:  total 2759  drwxr-xr-x 2 root root     512 mag 14 01:25 .  drwxr-xr-x 3 root root     512 mag 14 01:25 ..  -rwxr-xr-x 1 root root 1350888 mag 14 01:25 bootmgfw.efi  -rwxr-xr-x 1 root root       0 mag 13 17:02 bootmgfw.efi.grb  -rwxr-xr-x 1 root root 1350888 mag 14 01:24 bootmgr.efi  -rwxr-xr-x 1 root root  121856 mag 13 17:02 bootx64.efi  -rwxr-xr-x 1 root root       0 mag 13 17:02 bootx64.efi.grb    /boot/efi/EFI/ubuntu:  total 120  drwxr-xr-x 2 root root    512 mag  6 10:18 .  drwxr-xr-x 5 root root    512 mag 14 01:25 ..  -rwxr-xr-x 1 root root 121856 mag 13 17:02 grubx64.efi  --------------  

I will appreciate any guideline / help from you guys.

Thanks in advance, B.


Solution:1

First, your partition type codes are messed up. Your first three partitions are all flagged as EFI System Partitions (ESPs), but only the first one should be of that type. Your partition #2 should almost certainly be of "Microsoft Basic Data" type. I'm not sure about your partition #3. You can change partition type codes with gdisk, using its t option. Be sure to save your changes via the w option when you're done. In gdisk, change the type code for partition #2 to 0700. I'm not sure about partition #3, though.

If changing the type code doesn't work, try using the rEFInd CD or USB flash drive. (You can get these from the rEFInd downloads page.) If you boot into rEFInd and it enables you to boot Windows, then install rEFInd using the Debian package or binary .zip file. This will supplement or bypass GRUB 2 (as you see fit) for booting Linux, and bypass GRUB for booting Windows.


Solution:2

I have to say it is very frustrating to see all the these tools (boot-repair, rEFInd, etc.) being recommended over and over and again and again, while the cause is unclear and the actual issues being treated like witchcraft.

Food for thought: Running 100 tools while not understanding the issue, might in some cases solve your problem, but might also not solve your problem or make things worse.


You are right, apart from the multiple EFI System Partitions your setup is missing some files. A proper setup looks like this:

livewire@za21:~$ ll /media/livewire/Windows\ 8/EFI/  insgesamt 12  drwx------ 1 livewire livewire     0 Jan 28 09:13 ./  drwx------ 1 livewire livewire 12288 Mai 16 03:11 ../  drwx------ 1 livewire livewire     0 Jan 28 09:13 Boot/  drwx------ 1 livewire livewire     0 Jan 27 22:31 Microsoft/  livewire@za21:~$ ll /media/livewire/Windows\ 8/EFI/Boot/  insgesamt 1324  drwx------ 1 livewire livewire       0 Jan 28 09:13 ./  drwx------ 1 livewire livewire       0 Jan 28 09:13 ../  -rw------- 1 livewire livewire 1354480 Jul 26  2012 bootx64.efi  livewire@za21:~$ ll /media/livewire/Windows\ 8/EFI/Microsoft/Boot/  insgesamt 4044  drwx------ 1 livewire livewire    8192 Jan 28 09:13 ./  drwx------ 1 livewire livewire       0 Jan 27 22:31 ../  -rw------- 1 livewire livewire   40960 Jan 28 09:13 BCD  -rw------- 1 livewire livewire   36864 Jan 28 09:13 BCD.LOG  -rw------- 2 livewire livewire       0 Jan 28 09:13 BCD.LOG1  -rw------- 2 livewire livewire       0 Jan 28 09:13 BCD.LOG2  drwx------ 1 livewire livewire       0 Jan 28 09:13 bg-BG/  -rw------- 1 livewire livewire 1354480 Jul 26  2012 bootmgfw.efi  -rw------- 1 livewire livewire 1350896 Jul 26  2012 bootmgr.efi  -rw------- 1 livewire livewire   65536 Jan 27 22:07 BOOTSTAT.DAT  -rw------- 1 livewire livewire    4186 Jun 27  2012 boot.stl  drwx------ 1 livewire livewire       0 Jan 28 09:13 cs-CZ/  drwx------ 1 livewire livewire       0 Jan 28 09:13 da-DK/  drwx------ 1 livewire livewire       0 Jan 28 09:13 de-DE/  drwx------ 1 livewire livewire       0 Jan 28 09:13 el-GR/  drwx------ 1 livewire livewire       0 Jan 28 09:13 en-GB/  drwx------ 1 livewire livewire       0 Jan 28 09:13 en-US/  drwx------ 1 livewire livewire       0 Jan 28 09:13 es-ES/  drwx------ 1 livewire livewire       0 Jan 28 09:13 et-EE/  drwx------ 1 livewire livewire       0 Jan 28 09:13 fi-FI/  drwx------ 1 livewire livewire    4096 Jan 28 09:13 Fonts/  drwx------ 1 livewire livewire       0 Jan 28 09:13 fr-FR/  drwx------ 1 livewire livewire       0 Jan 28 09:13 hr-HR/  drwx------ 1 livewire livewire       0 Jan 28 09:13 hu-HU/  drwx------ 1 livewire livewire       0 Jan 28 09:13 it-IT/  drwx------ 1 livewire livewire       0 Jan 28 09:13 ja-JP/  drwx------ 1 livewire livewire       0 Jan 28 09:13 ko-KR/  drwx------ 1 livewire livewire       0 Jan 28 09:13 lt-LT/  drwx------ 1 livewire livewire       0 Jan 28 09:13 lv-LV/  -rw------- 1 livewire livewire 1263856 Jul 26  2012 memtest.efi  drwx------ 1 livewire livewire       0 Jan 28 09:13 nb-NO/  drwx------ 1 livewire livewire       0 Jan 28 09:13 nl-NL/  drwx------ 1 livewire livewire       0 Jan 28 09:13 pl-PL/  drwx------ 1 livewire livewire       0 Jan 28 09:13 pt-BR/  drwx------ 1 livewire livewire       0 Jan 28 09:13 pt-PT/  drwx------ 1 livewire livewire    4096 Jan 28 09:13 qps-ploc/  drwx------ 1 livewire livewire       0 Jan 28 09:13 Resources/  drwx------ 1 livewire livewire       0 Jan 28 09:13 ro-RO/  drwx------ 1 livewire livewire       0 Jan 28 09:13 ru-RU/  drwx------ 1 livewire livewire       0 Jan 28 09:13 sk-SK/  drwx------ 1 livewire livewire       0 Jan 28 09:13 sl-SI/  drwx------ 1 livewire livewire       0 Jan 28 09:13 sr-Latn-CS/  drwx------ 1 livewire livewire       0 Jan 28 09:13 sv-SE/  drwx------ 1 livewire livewire       0 Jan 28 09:13 tr-TR/  drwx------ 1 livewire livewire       0 Jan 28 09:13 uk-UA/  drwx------ 1 livewire livewire       0 Jan 28 09:13 zh-CN/  drwx------ 1 livewire livewire       0 Jan 28 09:13 zh-HK/  drwx------ 1 livewire livewire       0 Jan 28 09:13 zh-TW/  

The language resources are not that important for basic boot functionality, but bootmgfw.efi, bootmgr.efi, BOOTSTAT.DAT and BCD. One of the latter files (it must be BCD, because a GUID like string is clearly visible among other data when I put the file in an editor) contains configuration data (e.g. which partition to use for boot) and needs to be generated, which is the rather tricky part as I only know the Windows command for doing that. The other files are easy to find as they are stored in C:\Windows\Boot\ on typical installations.

If you're lucky you'll find a working MBR (C:\Boot\) or EFI (C:\EFI\) boot configuration on the Windows 8 partition or the Windows boot partition that can be booted by GRUB. For booting the MBR configuration I recommend installing Ubuntu in MBR mode to a USB stick, booting it and let GRUB os-prober find the configuration to boot Windows and fix the issue in Windows. For EFI you can write a custom GRUB entry. Read my comment on: Grub errors during UEFI dual boot for Windows 8 (can't find command 'drivemap')

From within Windows you can reinstall the EFI boot loader and configuration to the location of your choice with bcdboot C:\Windows /s C: /f uefi. In this case /s C: will install to C:, you should replace it with the drive letter of the ESP you want to use.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »