2

As part of my Windows 11 upgrade activities, MS says my PC does not support Secure Boot. Something also confirmed by msinfo32.exe: msinfo32 snapshot

Strangely enough, when I entered BIOS it states Secure Boot state: “Enabled”: BIOS Secure Boot Menu snapshot

I thus assumed other BIOS settings are also required to be set.

I then tried several combinations values of both this Secure Boot menu (by changing OS Type: “Other OS” to “Windows UEFI mode”) and in CSM menu: BIOS CSM Menu snapshot

But my Windows stopped booting whenever I changed CSM\Launch CSM to either “Disabled” (no matter the Secure Boot\OS Type value) or “Auto” when Secure Boot\OS Type = “Windows UEFI mode”. All other combinations didn’t seem to make any difference for Secure Boot purposes.


I didn’t mess around with Secure Boot\Key Management (should I?...): BIOS Secure Boot Key Management snapshot


Digging further, I found a SuperUser posting stating:

If OS was installed under CSM, it thinks this machine is not UEFI compatible and installs in legacy mode. If you switch to UEFI it won't boot because this is not UEFI loader expects to see. If system was installed under UEFI, it detects that and configures BIOS so it wouldn't boot if you switch to CSM afterwards, because this is not legacy BIOS loader expects to see. It is possible to configure a system to boot either way, but it's not very easy and I don't know how to do this in Windows.

As I have a custom-made machine, in which I installed Windows 10 with mostly BIOS defaults, I now suspect that my Windows was installed under CSM.


So, is there an easy way (say, by tweaking BIOS) to support Secure Boot, without requiring Windows 10 reinstallation?


EDIT:
Actual partition layout


Windows 10 Pro, 64-bit (21H1)
M/B Asus Prime Z370-P
RAM: 16GB
Intel i7 8700
GPU on board (Intel 630)
Broadcom 802.11ac PCIe
Sound Blaster X-Fi Xtreme Audio PCIe

4
  • 1
    Windows, or any OS, shouldn't be installed via CSM Mode, as the sole purpose of CSM Mode was to support distros that didn't yet support EFI boot circa <2017 (≥Win7 supports EFI boot). Have a WinPE USB drive available [Windows install USB]: Disable CSM Mode in the UEFI firmware → Boot WinPE → When the GUI loads, press Shift+F10 to access a terminal → Correctly configure Windows for EFI boot (you'll need to convert the OS partition from MBR to GPT first via a CLI utility - see Microsoft Docs or Superuser; I'll create an answer later, as I don't have time at the moment)
    – JW0914
    Commented Dec 17, 2021 at 20:02
  • @JW0914: Yes, I confirm my partition is MBR. I'll follow your suggestions. Thx!
    – caecilius
    Commented Dec 17, 2021 at 20:15
  • @caecilius - Can you indicate how many partitions you currently have on your system disk? You have installed Windows with CSM enabled, which means your NOT using GPT, which also means Secure Boot cannot be enabled until you convert to GPT. Windows 11 does not support MBR. Once I know you have less than 4 partitions I can submit an answer
    – Ramhound
    Commented Dec 18, 2021 at 0:55
  • @Ramhound - Disk 0 has 3 partitions (See Edit)
    – caecilius
    Commented Dec 18, 2021 at 1:04

1 Answer 1

3

CSM Mode should never be enabled for an OS, as its sole purpose was to support distros that didn't yet support EFI boot circa <2017 (Windows ≥7 supports EFI boot); CSM Mode emulates BIOS' 16bit architecture within a 32bit environment and doing so will cause performance degradation (boot times increase by 400%+, GPT can't be used, etc.)

  • The only reason to enable CSM Mode is when needing to access a legacy OP[tion] ROM, and once done in the OP ROM, CSM Mode should be re-disabled

To resolve:

  1. Windows 10 installation media → install on another PC → Save ISO
  2. Create bootable USB with Rufus → Reboot → Disable CSM Mode in the UEFI firmware
  3. Boot Windows install USB → When GUI loads, open terminal via Shift+F10
  4. Use mbr2gpt to convert partition table to GPT:
    1. Ascertain OS disk #: DiskPartlis diskexit
    2. mbr2gpt /convert /disk:#
      

  5. Create required UEFI-boot partitions on the OS HDD via DiskPart:
    1. DiskPartlis disksel dis # → Verify it's the OS disk: lis par
    2. Delete old boot partition: sel par # → Verify: det pardel par override
    3. Determine disk layout: lis par (optimal partition layout: WinRE, EFI, MSR, OS)
    4. Add requisite UEFI partitions:
      1. WinRE:
        Select OS partition: sel par 1 → Verify it's the OS partition: det par
        Shrink Desired=665 minimum=650
        Cre Par Pri Size=665 Id=de94bba4-06d1-4d40-a16a-bfd50179d6ac
        Format Quick Fs=NTFS Label=WinRE
        Gpt Attributes=0x8000000000000001
        
      2. EFI and MSR:
        Select OS partition: sel par 2 → Verify it's the OS partition: det par
        Shrink Desired=388 Minimum=388
        Cre Par EFI Size=100
        Format Quick Fs=FAT32 Label=EFI
        Assign Letter=Y
        Cre Par Msr Size=16
        
    5. Get OS partition drive letter: lis volexit
      (C: is usually not the OS drive letter in WinPE/WinRE)

  6. Configure EFI boot:
    ::# Create EFI directories and enter:
        MkDir "Y:\EFI\Microsoft\Boot"
        Cd /d "Y:\EFI\Microsoft\Boot"
    
    ::# Create EFI boot structure:
        BootRec /Fixboot
    
        ::# If Access Denied error occurs (C: is OS partition):
            BcdBoot C:\Windows /s C: /f UEFI
    
    ::# Resolve any other boot issues:
        BootRec /FixMBR && BootRec /RebuildBCD
    
    Remove EFI mountpoint: DiskPartSel Vol YRemoveExit

  7. Reboot via wpeutil reboot, then configure WinRE once booted back to Windows:
    1. Open an Admin Terminal: WinKey+ROpen: powershellCTRL+SHIFT+OK
    2. Mount WinRE partition via DiskPart:
      lis volsel vol # → Verify: det parAssign Letter=ZExit
    3. Extract WinRE.wim from the Windows install USB's sources\install.wim||.esd:
      # Get list of images [indexes] within the ESD/WIM:
        Dism /Get-ImageInfo /ImageFile:"E:\sources\install.wim"
      
      # Mount install.wim||.esd (usually index 1: Home | 6: Pro):
        MkDir "C:\Mount" ; Dism /Mount-Image /ImageFile:"E:\sources\install.wim" /Index:1 /MountDir:"C:\Mount" /ReadOnly
      
      # Copy WinRE.wim:
        Xcopy "C:\Mount\Windows\System32\Recovery\WindowsRE\WinRE.wim" "C:"
        # If hidden file: Xcopy /H
      
      # Unmount image, discard changes:
        Dism /Unmount-Image /MountDir:"C:\Mount" /Discard
      
    4. # Copy WinRE.wim:
        MkDir "Z:\Recovery\WindowsRE" ; Xcopy "C:\WinRE.wim" "Z:\Recovery\WindowsRE"
      
      # Disable WinRE:
        ReAgentC /Disable
      
      # Set Custom WinRE Path:
        ReAgentC /SetREimage /Path "Z:\Recovery\WindowsRE"
      
      # Enable WinRE and verify:
        ReAgentC /Enable ; ReAgentC /Info
      
      # Cleanup:
        Del "C:\WinRE.wim" ; RmDir "C:\Mount"
      
    5. Remove WinRE mount point: DiskPartsel vol zremoveexit
6
  • Will your proposed procedure, somehow, affect my disk 1 partitions or data (disk 1 is not my system disk)? Besides backups, should I physically remove my data disk1 before starting that mbr to gpt procedure and add it after procedure is complete? Anyway, if I remove my disk1 before starting the procedure and later connect it to a machine with a gpt boot disk 0, will I still be able to access my disk 1 partitions data E:, F: and G: data? Thx!
    – caecilius
    Commented Dec 19, 2021 at 2:22
  • @caecilius These steps only affect the drive to which is being worked on, regardless of how many drives are installed. mbr2gpt requires specifying a disk #, which is ascertained from #4.1 - not specifying a drive will cause it to error out (see linked to man page). Non-OS drives can be converted to GPT w/ no data loss, as mbr2gpt doesn't affect data, it's simply changing the partition table from MBR to GPT. mbr2gpt can also convert boot and WinRE partitions, however it overcomplicates the process, coupled w/ your boot & WinRE partitions not being the optimal size for EFI boot.
    – JW0914
    Commented Dec 19, 2021 at 13:29
  • I'd recommend removing the mount drive letter for the EFI partition before running the bcdboot command. Otherwise, it may bake the letter into the BCD database instead of \Device\HarddiskVolumeN as the device entry in Windows Boot Manager.This is what I observed in Windows 11. Neither bcdboot nor bootrec needed the EFI partition mounted. At the least. confirm with bcdedit /enum all. Commented Mar 13, 2022 at 18:56
  • @kkm it's necessary to mount the EFI partition in order to run BootRec /FixBoot, as you must be within the EFI directory to not receive an access denied error; AFAIK, this didn't change in Win11. The drive letter wouldn't be registered in the BCD Store since it's the GUID of the EFI partition that tells Windows where to locate the boot files.
    – JW0914
    Commented Mar 13, 2022 at 20:39
  • @JW0914, ah, thank you! If I understand you, the bcdedit /enum displays device entry as a letter if the ESP partition is mounted under a letter, but stores a pointer to it differently? If at all—I vaguely remember a GPT disk can have only one ESP, and it has a manifest GUID assigned to it in the GPT spec, so what's the point storing it?.. (Thinks aloud.) And UEFI was supposed to simplify it all… I spent a day fighting surprises after restoring to new hardware, even though my B&R software took care of system disk driver mismatch/I_B_D automagically. Your A. was crucial, thanks! Commented Mar 16, 2022 at 16:53

You must log in to answer this question.

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