My Hell -- Windows 8 EFI Boot Issue

eloj

2[H]4U
Joined
Dec 31, 2000
Messages
3,612
I installed Debian 7 on my machine, and that somehow upset the delicate sensibilities of my Windows 8 installation. I'm not sure how or why, but I want to fix it.

What happens is that bootmgfw.efi kicks off and I get the black screen with a Window on. There it hangs. I assume bootmgfw is showing that screen, which would mean that things are OK at least until the point where it tries to load the BCD and on. I don't exactly have a clear, detailed idea of the boot process exactly.

I have my USB stick with the Win8 install on it. The "automatic repair" does not work. It wants to restore a system restore point which I'm not keen on trying except as an absolute last resort.

The first impulse was to rebuild the BCD (that's what the Internet tells you to do), which I did (using bcdboot ...), to no avail.

What's more, the BCD actually looks okay to me now, given my very limited knowledge about how it's supposed to look.

Essentially my setup is a 120GB M4 as disk 1 where I originally installed Windows 8 in GPT/EFI mode on an 89GB partition. I had reserved ~30GB from the get go for a future linux install, so there's been no partition resize or anything here.

Booting the Win8 installation media on the USB stick in UEFI mode gives the following:

Code:
I:\EFI\Microsoft\Boot>diskpart

Microsoft DiskPart version 6.2.9200

Copyright (C) 1999-2012 Microsoft Corporation.
On computer: MININT-JU4SK5T

DISKPART> list disk

  Disk ###  Status         Size     Free     Dyn  Gpt
  --------  -------------  -------  -------  ---  ---
  Disk 0    Online          238 GB   563 MB
  Disk 1    Online          119 GB  1422 MB        *
  Disk 2    Online         1863 GB   101 MB
  Disk 3    Online         7695 MB      0 B

DISKPART> select disk 1

Disk 1 is now the selected disk.

DISKPART> list part

  Partition ###  Type              Size     Offset
  -------------  ----------------  -------  -------
  Partition 1    Recovery           300 MB  1024 KB
  Partition 2    System             100 MB   301 MB
  Partition 3    Reserved           128 MB   401 MB
  Partition 4    Primary             89 GB   529 MB
  Partition 5    Primary             27 GB    89 GB

DISKPART> list vol

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 0     C   Samsung830   NTFS   Partition    230 GB  Healthy
  Volume 1     D                NTFS   Partition     89 GB  Healthy
  Volume 2     E                RAW    Partition     27 GB  Healthy
  Volume 3     H   Recovery     NTFS   Partition    300 MB  Healthy    Hidden
  Volume 4     I                FAT32  Partition    100 MB  Healthy    Hidden
  Volume 5     F   WD20EADS 2T  NTFS   Partition   1862 GB  Healthy
  Volume 6     G   ESD-USB      FAT32  Removable   7694 MB  Healthy

I have no idea why the 27GB linux partition (volume 2) has a drive letter here, but it shouldn't be fatal. I have assigned I: to volume 4 (the ESP -- EFI System Partition) using 'assign' previously, it doesn't have a letter assigned normally (which seems to be standard).

Looks fine to me.

And here's the dump of the current (rebuilt) BCD. Note how the device partition seems ok, as does the osdevice and systemroot:

Code:
I:\EFI\Microsoft\Boot>bcdedit /store BCD /enum

Windows Boot Manager
--------------------
identifier              {bootmgr}
device                  partition=I:
path                    \EFI\Microsoft\Boot\bootmgfw.efi
description             Windows Boot Manager
locale                  en-us
inherit                 {globalsettings}
default                 {default}
resumeobject            {5664034e-bcba-11e2-aea3-a3e5f6caddca}
displayorder            {default}
toolsdisplayorder       {memdiag}
timeout                 30

Windows Boot Loader
-------------------
identifier              {default}
device                  partition=D:
path                    \Windows\system32\winload.efi
description             Windows 8
locale                  en-us
inherit                 {bootloadersettings}
isolatedcontext         Yes
allowedinmemorysettings 0x15000075
osdevice                partition=D:
systemroot              \Windows
resumeobject            {5664034e-bcba-11e2-aea3-a3e5f6caddca}
nx                      OptIn
bootmenupolicy          Standard
detecthal               Yes

My hypothesis has been that the extra partition somehow threw the BCD out of whack, but I can't see anything wrong with it.

I'm actually running out of ideas here. I have no idea what it's hanging on. My next step would probably be to open the
computer up and physically disconnect the other drives just to make sure it's not getting confused by them somehow.

I have even verified the sha1 signatures of the efi files on the ESP vs the install media, and they check out.

# sha1sum /boot/efi/EFI/Microsoft/*.efi
765ce680a932d9f36a6b09c2191c9e2cab1a89cd bootmgfw.efi
8e3d465e4eb78e5f816721699c1d7f1f63a4a5cb bootmgrefi

Haven't been able to verify this one since it's not available unpacked on the install media:
# sha1sum /media/1050D37250D35D52/Windows/System32/winload.efi
28328e1c87ecd3d45828c69ba1c21b3ed6b032c4 /media/1050D37250D35D52/Windows/System32/winload.efi

So... suggestion? Note, this is EFI, suggestions such as "bootrec /fixmbr" aren't helpful unless they come with an explanation as for why they should work.
 
Last edited:
What do you see in the EFI system partition? Mount the 100MB partition and dump the directory contents. I see some entries that I don't like, but I'm not sure if it will make a difference.


Code:
E:\>dir
 Volume in drive E has no label.
 Volume Serial Number is F66B-7381

 Directory of E:\

01/31/2013  10:44 PM    <DIR>          EFI
               0 File(s)              0 bytes
               1 Dir(s)      75,323,392 bytes free

E:\>cd EFI

E:\EFI>dir
 Volume in drive E has no label.
 Volume Serial Number is F66B-7381

 Directory of E:\EFI

01/31/2013  10:44 PM    <DIR>          .
01/31/2013  10:44 PM    <DIR>          ..
01/31/2013  10:44 PM    <DIR>          Microsoft
01/31/2013  10:47 PM    <DIR>          Boot
               0 File(s)              0 bytes
               4 Dir(s)      75,323,392 bytes free

E:\EFI>cd Microsoft

E:\EFI\Microsoft>dir
 Volume in drive E has no label.
 Volume Serial Number is F66B-7381

 Directory of E:\EFI\Microsoft

01/31/2013  10:44 PM    <DIR>          .
01/31/2013  10:44 PM    <DIR>          ..
01/31/2013  10:44 PM    <DIR>          Boot
               0 File(s)              0 bytes
               3 Dir(s)      75,323,392 bytes free

E:\EFI\Microsoft>cd Boot

E:\EFI\Microsoft\Boot>dir
 Volume in drive E has no label.
 Volume Serial Number is F66B-7381

 Directory of E:\EFI\Microsoft\Boot

01/31/2013  10:44 PM    <DIR>          .
01/31/2013  10:44 PM    <DIR>          ..
05/18/2013  05:59 PM            32,768 BCD
01/31/2013  10:47 PM    <DIR>          bg-BG
01/31/2013  10:47 PM    <DIR>          cs-CZ
01/31/2013  10:47 PM    <DIR>          da-DK
01/31/2013  10:47 PM    <DIR>          de-DE
01/31/2013  10:47 PM    <DIR>          el-GR
01/31/2013  10:47 PM    <DIR>          en-GB
01/31/2013  10:47 PM    <DIR>          en-US
01/31/2013  10:47 PM    <DIR>          es-ES
01/31/2013  10:47 PM    <DIR>          et-EE
01/31/2013  10:47 PM    <DIR>          fi-FI
01/31/2013  10:47 PM    <DIR>          fr-FR
01/31/2013  10:47 PM    <DIR>          hr-HR
01/31/2013  10:47 PM    <DIR>          hu-HU
01/31/2013  10:47 PM    <DIR>          it-IT
01/31/2013  10:47 PM    <DIR>          ja-JP
01/31/2013  10:47 PM    <DIR>          ko-KR
01/31/2013  10:47 PM    <DIR>          lt-LT
01/31/2013  10:47 PM    <DIR>          lv-LV
01/31/2013  10:47 PM    <DIR>          nb-NO
01/31/2013  10:47 PM    <DIR>          nl-NL
01/31/2013  10:47 PM    <DIR>          pl-PL
01/31/2013  10:47 PM    <DIR>          pt-BR
01/31/2013  10:47 PM    <DIR>          pt-PT
01/31/2013  10:47 PM    <DIR>          qps-ploc
01/31/2013  10:47 PM    <DIR>          ro-RO
01/31/2013  10:47 PM    <DIR>          ru-RU
01/31/2013  10:47 PM    <DIR>          sk-SK
01/31/2013  10:47 PM    <DIR>          sl-SI
01/31/2013  10:47 PM    <DIR>          sr-Latn-CS
01/31/2013  10:47 PM    <DIR>          sv-SE
01/31/2013  10:47 PM    <DIR>          tr-TR
01/31/2013  10:47 PM    <DIR>          uk-UA
01/31/2013  10:47 PM    <DIR>          zh-CN
01/31/2013  10:47 PM    <DIR>          zh-HK
01/31/2013  10:47 PM    <DIR>          zh-TW
01/31/2013  10:47 PM    <DIR>          Fonts
01/31/2013  10:47 PM    <DIR>          Resources
06/26/2012  06:05 PM             4,186 boot.stl
09/20/2012  12:31 AM         1,354,472 bootmgfw.efi
09/20/2012  12:31 AM         1,350,888 bootmgr.efi
07/25/2012  08:57 PM         1,263,856 memtest.efi
               5 File(s)      4,006,170 bytes
              39 Dir(s)      75,323,392 bytes free

E:\EFI\Microsoft\Boot>cd ..

E:\EFI\Microsoft>dir
 Volume in drive E has no label.
 Volume Serial Number is F66B-7381

 Directory of E:\EFI\Microsoft

01/31/2013  10:44 PM    <DIR>          .
01/31/2013  10:44 PM    <DIR>          ..
01/31/2013  10:44 PM    <DIR>          Boot
               0 File(s)              0 bytes
               3 Dir(s)      75,323,392 bytes free

E:\EFI\Microsoft>cd ..

E:\EFI>dir
 Volume in drive E has no label.
 Volume Serial Number is F66B-7381

 Directory of E:\EFI

01/31/2013  10:44 PM    <DIR>          .
01/31/2013  10:44 PM    <DIR>          ..
01/31/2013  10:44 PM    <DIR>          Microsoft
01/31/2013  10:47 PM    <DIR>          Boot
               0 File(s)              0 bytes
               4 Dir(s)      75,323,392 bytes free

E:\EFI>cd Boot

E:\EFI\Boot>dir
 Volume in drive E has no label.
 Volume Serial Number is F66B-7381

 Directory of E:\EFI\Boot

01/31/2013  10:47 PM    <DIR>          .
01/31/2013  10:47 PM    <DIR>          ..
09/20/2012  12:31 AM         1,354,472 bootx64.efi
               1 File(s)      1,354,472 bytes
               2 Dir(s)      75,323,392 bytes free

E:\EFI\Boot>

DISKPART> list vol

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 0     D                       DVD-ROM         0 B  No Media
  Volume 1     F   TV Shows     NTFS   Partition   1397 GB  Healthy
  Volume 2     H   Movies       NTFS   Partition   1862 GB  Healthy
  Volume 3     C   Windows 8    NTFS   Partition    217 GB  Healthy    Boot
  Volume 4         Recovery     NTFS   Partition    300 MB  Healthy    Hidden
  Volume 5     E                FAT32  Partition    100 MB  Healthy    System
  Volume 6     G   Games        NTFS   Partition    419 GB  Healthy
 
Last edited:
Pretty sure it's all there. But .. sure (I'm filtering out the ??-?? to cover the billion language specific executable directories)

Code:
root@connie:/boot/efi# ls -lR --hide=??-??

total 392
-r-xr-xr-x 1 root root 398156 Jul 26  2012 bootmgr
-rwxr-xr-x 1 root root      1 Jun  2  2012 BOOTNXT
drwxr-xr-x 6 root root   1024 May 12 15:21 EFI
drwxr-xr-x 2 root root   1024 May 19 00:31 Temp

./EFI:
total 4
drwxr-xr-x 2 root root 1024 Feb  9 11:03 Boot
drwxr-xr-x 2 root root 1024 May 11 03:15 debian
drwxr-xr-x 3 root root 1024 Feb  9 10:58 Microsoft
drwxr-xr-x 2 root root 1024 May 19 00:50 Shell

./EFI/Boot:
total 1323
-rwxr-xr-x 1 root root 1354472 Sep 20  2012 bootx64.efi

./EFI/debian:
total 115
-rwxr-xr-x 1 root root 117760 May 11 03:15 grubx64.efi

./EFI/Microsoft:
total 3
drwxr-xr-x 39 root root 3072 May 12 16:29 Boot

./EFI/Microsoft/Boot:
total 4016
-rwxr-xr-x 1 root root   32768 May 18 23:19 BCD
-rwxr-xr-x 1 root root   28672 Feb  9 10:58 BCD.LOG
-rwxr-xr-x 1 root root       0 May 14 17:18 BCD.LOG1
-rwxr-xr-x 1 root root       0 May 14 17:18 BCD.LOG2
-rwxr-xr-x 1 root root 1354472 Sep 20  2012 bootmgfw.efi
-rwxr-xr-x 1 root root 1350888 Sep 20  2012 bootmgr.efi
-rwxr-xr-x 1 root root   65536 Feb  9 11:03 BOOTSTAT.DAT
-rwxr-xr-x 1 root root    4186 Jun 27  2012 boot.stl
-rwxr-xr-x 1 root root    1628 May 18 23:17 diskpart.txt
-rwxr-xr-x 1 root root    1072 May 18 23:15 enumBCD.txt
drwxr-xr-x 2 root root    2048 Feb  9 11:03 Fonts
-rwxr-xr-x 1 root root 1263856 Jul 26  2012 memtest.efi
drwxr-xr-x 2 root root    1024 Feb  9 11:03 qps-ploc
drwxr-xr-x 3 root root    1024 Feb  9 11:03 Resources
drwxr-xr-x 2 root root    1024 Feb  9 11:03 sr-Latn-CS

./EFI/Microsoft/Boot/Fonts:
total 13056
-rwxr-xr-x 1 root root 3694080 Jun  2  2012 chs_boot.ttf
-rwxr-xr-x 1 root root 3876772 Jun  2  2012 cht_boot.ttf
-rwxr-xr-x 1 root root 1984228 Jun  2  2012 jpn_boot.ttf
-rwxr-xr-x 1 root root 2371360 Jun  2  2012 kor_boot.ttf
-rwxr-xr-x 1 root root  168212 Jun  2  2012 malgun_boot.ttf
-rwxr-xr-x 1 root root  165764 Jun  2  2012 malgunn_boot.ttf
-rwxr-xr-x 1 root root  134508 Jun  2  2012 meiryo_boot.ttf
-rwxr-xr-x 1 root root  132888 Jun  2  2012 meiryon_boot.ttf
-rwxr-xr-x 1 root root  154896 Jun  2  2012 msjh_boot.ttf
-rwxr-xr-x 1 root root  152892 Jun  2  2012 msjhn_boot.ttf
-rwxr-xr-x 1 root root  146228 Jun  2  2012 msyh_boot.ttf
-rwxr-xr-x 1 root root  142124 Jun  2  2012 msyhn_boot.ttf
-rwxr-xr-x 1 root root   36020 Jun  2  2012 segmono_boot.ttf
-rwxr-xr-x 1 root root   77088 Jun  2  2012 segoen_slboot.ttf
-rwxr-xr-x 1 root root   77404 Jun  2  2012 segoe_slboot.ttf
-rwxr-xr-x 1 root root   47452 Jun  2  2012 wgl4_boot.ttf

./EFI/Microsoft/Boot/qps-ploc:
total 189
-rwxr-xr-x 1 root root 73456 Jul 26  2012 bootmgfw.efi.mui
-rwxr-xr-x 1 root root 73456 Jul 26  2012 bootmgr.efi.mui
-rwxr-xr-x 1 root root 45296 Jul 26  2012 memtest.efi.mui

./EFI/Microsoft/Boot/Resources:
total 18
-rwxr-xr-x 1 root root 18160 Jul 26  2012 bootres.dll

./EFI/Microsoft/Boot/sr-Latn-CS:
total 150
-rwxr-xr-x 1 root root 76528 Jul 26  2012 bootmgfw.efi.mui
-rwxr-xr-x 1 root root 76528 Jul 26  2012 bootmgr.efi.mui

./EFI/Shell:
total 828
-rwxr-xr-x 1 root root 847232 May 12 15:21 shellx64.efi

./Temp:
total 0

As you can see I have Grub installed, which is perfectly happy to boot my debian install.

(The UEFI 2.0 shell unfortunately does not work properly, it dumps some device information but the screen is offset such that I suspect there's a graphics mode problem, can't see a cursor etc)
 
Last edited:
I noticed that your windows drive doesn't have the boot flag. I think at this point you just want Windows to boot right? What does your grub menu entry look like?

My BCD:

Code:
C:\Windows\System32>bcdedit  /enum

Windows Boot Manager
--------------------
identifier              {bootmgr}
device                  partition=E:
path                    \EFI\Microsoft\Boot\bootmgfw.efi
description             Windows Boot Manager
locale                  en-US
inherit                 {globalsettings}
integrityservices       Enable
default                 {current}
resumeobject            {ca3b27a9-6c3a-11e2-a28d-9e3ae2f92a9f}
displayorder            {current}
toolsdisplayorder       {memdiag}
timeout                 0

Windows Boot Loader
-------------------
identifier              {current}
device                  partition=C:
path                    \Windows\system32\winload.efi
description             Windows 8
locale                  en-US
inherit                 {bootloadersettings}
recoverysequence        {ca3b27ab-6c3a-11e2-a28d-9e3ae2f92a9f}
integrityservices       Enable
recoveryenabled         Yes
isolatedcontext         Yes
allowedinmemorysettings 0x15000075
osdevice                partition=C:
systemroot              \Windows
resumeobject            {ca3b27a9-6c3a-11e2-a28d-9e3ae2f92a9f}
nx                      OptIn
bootmenupolicy          Standard
disabledynamictick      No
 
Last edited:
I'm not currently booting Windows through GRUB, I'm using F11 for a boot menu and kicking it off from there.

Looking over the BCD differences in vimdiff, the only thing that stands out is your WBL identifier is "{current}" vs mine that is "{default}", and also that for some reason my locales are in lowercase. I wonder if it's just adapting the output to what drive you are currently on. I should check if I can just see the GUIDs for everything.

Is there a bootable flag for GPT?
 
Is there a bootable flag for GPT?

I don't think it does.Windows diskpart is displaying *some* additional information. If you can't use your current EFI shell you will have to create a boot USB stick with a shell. NOTE: I haven't done this in at least a year and I don't remember all the details. It *is* possible. I used Rod Smith as resource.

http://www.rodsbooks.com/efi-bootloaders/

I would modify the device and osdevice to partition=C:
 
When I originally installed Win8 there existed a windows installation on the then C: now F: (2TB hard drive), which is why Win8 became D: ... I could see getting rid of the "C:" label on the second SSD, but actually changing it over to C: from D: would likely cause more damage than good considering everything is set up to assume D: is the osdevice. Even if it could boot further, I'm sure all the "D:\" paths in the registry would wreck havok on the install.

At some point -- if pulling the other devices doesn't work -- I'm going to just have to give up and reinstall I guess, but that seems to involve having to call Microsoft re: re-activation of my Win8 key, because I assume there's no way of deactivating without booting.

So.. thanks for that MS. DRM, biting paying customers since the 80s. GG.
 
When I originally installed Win8 there existed a windows installation on the then C: now F: (2TB hard drive), which is why Win8 became D: ... I could see getting rid of the "C:" label on the second SSD, but actually changing it over to C: from D: would likely cause more damage than good considering everything is set up to assume D: is the osdevice. Even if it could boot further, I'm sure all the "D:\" paths in the registry would wreck havok on the install.

Ah, that makes sense.
 
I pulled my Samsung SSD (identified in pre-install as "C:") and now I'm posting this from Windows.

W. T. F.

So after boot here is what I see. The \Windows partition is now C: (!!) and has assigned D: to the linux partition (which Windows considers 'RAW')! WAT? Why would you assign a drive letter to something you can't read? This isn't DOS, damned it.

I'm FAIRLY sure I had it set up as D:\Windows and G: for the Samsung SSD that the pre-install environment assigned C: to.

Whatever, it clearly got confused for some reason. Now I've removed the "D:" assignment from my linux partition. Will reboot to make sure it still works. Then I'll probably hot-plug back the second SSD to make sure it's "G:" (for Games, it's original assignment) again and we should be good to go.

Worst case I can always copy all the data off that SSD and reinstall it from scratch.

I appreciate you taking the time to dump your BCD and hang out with me. Thanks.

EDIT: Noticed it takes a very long time to boot now, so I used xperf to generate a boot trace.

Code:
"timing pnpSystemStartDuration="1273" pnpSystemStartEndTime="112998" pnpSystemStartStartTime="111725" pnpBootStartDuration="111633" pnpBootStartEndTime="111643" pnpBootStartStartTime="9" postBootDisturbance="1300" postBootRequiredIdleTime="10000" osLoaderDuration="420" bootDoneViaPostBoot="160091" bootDoneViaExplorer="148791"

Seeing the high time for pnpBootStartDuration (times in ms) made me remember that I have "detecthal=yes" in my BCD where you did not, so I think it's safe to say that I need to go back to bcdedit and clear that.
 
Last edited:
No problem. It's always nice to have someone elses BCD dump to verify your settings. Booting more than one version of Windows is always an adventure.
 
Back
Top