Question on bootrec /scanos


RH247a

Active member
Member
Local time
5:04 AM
Posts
47
OS
Windows 11
My Win11 main Laptop (3yrs old) runs normal, recently updated with no issues. My external backup drives (USB HDD Not SSD) had held their drive letter assignments for about 2 years previously. Then a couple days ago I noticed my backup drive letter assignments were not holding on boot up. I saw Bree's posted solution of Diskpart to this and it appears to have fixed it.
However, before I saw Bree's posted solution, I had been doing net searches at what I might should check. Somewhere I saw something about running bootrec /scanos. Ok yea I had not yet found better suited ones like chkdsk c: /f /offlinescanandfix and then SFC /scannow and then DISM /Online /Cleanup-Image /RestoreHealth
So anyhow I recently ran bootrec /scanos just to see what it would report. I did this via Settings->System->Recovery->Troubleshoot->Advanced Options
and typed in bootrec /scanos It looked kinda like this,
---
X:\windows\system32\bootrec /scanos
Total Identified Windows Installations: 0 <-Is this normal (?) I'm still booting windows 11 Home with no problem.
Operation Completed sucessfully
---
I checked some other stuff wondering if I have a problem. Everything appears to running ok.
Appreciate any inpuit on anything that seems wrong with what's showing.
Code:
DISKPART> LIST DISK
  Disk ###  Status         Size     Free     Dyn  Gpt
  --------  -------------  -------  -------  ---  ---
  Disk 0    Online          953 GB   770 MB        *  <-Includes Drive C
  Disk 1    Online          931 GB      0 B  <-My USB Bakup Drive
DISKPART> SELECT DISK 1
Disk 1 is now the selected disk.
DISKPART> uniqueid disk
Disk ID: F3F2E8B8 <-My USB Bakup Drive
--
DISKPART> SELECT DISK 0
Disk 0 is now the selected disk.
DISKPART> uniqueid disk
Disk ID: {57A258CB-5467-4DFE-B989-7C8898D0238F}  
--
Microsoft DiskPart version 10.0.26100.1150
DISKPART> list disk
Disk ###     Status       Size     Free    Dyn  Gpt
--------  -------------  -------  -------  ---  ---
Disk 0      Online        953 GB   770 MB        *

DISKPART> select disk 0
Disk 0 is now the selected disk.
DISKPART> list volume
Volume ###  Ltr  Label   Fs       Type    Size   Status  Info
Volume 0      C              NTFS  Partition 749 GB  Healthy  Boot <-Win11
Volume 1      V   VMs    NTFS  Partition 202 GB  Healthy
Volume 2                      FAT32  Partition 100 MB  Healthy  System
Volume 3                       NTFS  Partition 873 MB  Healthy  Hidden
-
DISKPART> list part
Partition ###  Type              Size     Offset
-------------  ----------------  -------  -------
Partition 1    System             100 MB  1024 KB
Partition 2    Reserved            16 MB   101 MB
Partition 3    Primary            749 GB   117 MB <-Win 11 Partition
Partition 4    Recovery           873 MB   749 GB
Partition 5    Primary            202 GB   750 GB

DISKPART> detail part
Partition 3           <-Win 11 Partition
Type    : ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
Hidden  : No
Required: No
Attrib  : 0000000000000000
Offset in Bytes: 122683392
--------------------
PS C:\WINDOWS\system32> bcdedit
Windows Boot Manager   
----
identifier              {bootmgr}
device                  partition=\Device\HarddiskVolume1
path                    \EFI\Microsoft\Boot\bootmgfw.efi
description          Windows Boot Manager
locale                  en-US
inherit                 {globalsettings}
default                 {current}
resumeobject         {976657cf-156b-11f0-965e-eabe4e45cacc}
displayorder            {current}
toolsdisplayorder      {memdiag}
timeout                   30

Windows Boot Loader
-------------------
identifier              {current}
device                  partition=C:
path                    \WINDOWS\system32\winload.efi
description          Windows 11
locale                   en-US
inherit                    {bootloadersettings}
recoverysequence        {2043638d-2ec0-11f0-9697-d7232d9bf080}
displaymessageoverride  Recovery
recoveryenabled         Yes
isolatedcontext         Yes
allowedinmemorysettings 0x15000075
osdevice                partition=C:
systemroot              \WINDOWS
resumeobject            {976657cf-156b-11f0-965e-eabe4e45cacc}
nx                              OptIn
bootmenupolicy        Standard
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    Laptop
    Manufacturer/Model
    HP 17" Laptop, Acer Aspire 5
"Scan all disks for installation compatible with Windows and display the entries that are currently NOT in the boot configuration store."

Your system disk is present in the BCD, so it doesn't need to be added.
 

My Computer

System One

  • OS
    Windows 7
In Windows RE drive letter assignment may change (and often does).

Each time a computer is rebooted into Windows RE it may change.




In Windows RE run this command: bootsect /nt60 all > post a share link







Please run diskparinfo.bat > post a share link








This link may be useful:





In Windows RE it reads the HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices key to identify known devices.
If a partition doesn't have a stored letter or if a collision occurs, it assigns the next available letter in sequence.





mountvol /r


/rRemoves volume mount point directories and registry settings for volumes that are no longer in the system, preventing them from being automatically mounted and given their former volume mount point(s) when added back to the system.








All changes are lost when Windows PE reboots, including changes to drivers, drive letters, and the Windows PE registry.

 
Last edited:

My Computer

System One

  • OS
    Windows 10
    Computer type
    Laptop
    Manufacturer/Model
    HP
    CPU
    Intel(R) Core(TM) i7-4800MQ CPU @ 2.70GHz
    Motherboard
    Product : 190A Version : KBC Version 94.56
    Memory
    16 GB Total: Manufacturer : Samsung MemoryType : DDR3 FormFactor : SODIMM Capacity : 8GB Speed : 1600
    Graphics Card(s)
    NVIDIA Quadro K3100M; Intel(R) HD Graphics 4600
    Sound Card
    IDT High Definition Audio CODEC; PNP Device ID HDAUDIO\FUNC_01&VEN_111D&DEV_76E0
    Hard Drives
    Model Hitachi HTS727575A9E364
    Antivirus
    Microsoft Defender
    Other Info
    Mobile Workstation
X:\windows\system32\bootrec /scanos
Total Identified Windows Installations: 0 <-Is this normal (?) I'm still booting windows 11 Home with no problem.

As @garlin mentioned, your Windows installation is already present in the BCD store, so it does not need to be added again. This is normal if your system is already booting correctly.

bootrec /ScanOs
- Scans all disks for Windows installations that are not currently present in the Boot Configuration Data (BCD) store.
- Reports detected installations only; it does not add them to the BCD store.
- If "Total identified Windows installations: 0" is reported, it means no Windows installations were found that are missing from the BCD store.

bootrec /RebuildBcd
- Scans all disks for Windows installations that are not currently present in the Boot Configuration Data (BCD) store.
- Prompts the user to add detected installations to the existing BCD database.
- If "Total identified Windows installations: 0" is reported, it means no Windows installations were found that are missing from the BCD store.

In Windows RE run this command: bootsect /nt60 all > post a share link

I noticed you suggested "bootsect /nt60 all". OP has a Windows 11 UEFI/GPT setup. I thought bootsect only applies to legacy BIOS/MBR scenarios.
 

My Computers

System One System Two

  • OS
    Windows 11 Pro
    Computer type
    PC/Desktop
    CPU
    AMD Ryzen 9 9950X3D
    Motherboard
    ASRock B650E Taichi Lite
    Memory
    Kingston FURY Beast 64GB (2x32GB) DDR5 6000MT/s
    Graphics Card(s)
    ASUS TUF Gaming Radeon RX 9070 OC Edition 16GB GDDR6
    Hard Drives
    Solidigm P44 Pro 2TB M.2 NVMe SSD
  • Operating System
    Windows 11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Lenovo Legion Pro 7i Gen 10 16"
    CPU
    Intel Core Ultra 9 275HX
    Memory
    64GB (2x 32GB) DDR5-6400
    Graphics card(s)
    NVIDIA GeForce RTX 5080 16GB GDDR7 Laptop GPU
    Hard Drives
    2x 1TB M.2 NVMe SSD (SK Hynix)
I noticed you suggested "bootsect /nt60 all". OP has a Windows 11 UEFI/GPT setup. I thought bootsect only applies to legacy BIOS/MBR scenarios.


Code:
ALL
Updates the master boot code on all partitions. The ALL option does not necessarily update the boot code for each volume. Instead, this option updates the boot code on volumes that can be used as Windows boot volumes, which excludes any dynamic volumes that are not connected with an underlying disk partition. This restriction is present because boot code must be located at the beginning of a disk partition.



It will report success at command completion.

But it does little to nothing except fixing bootrec /fixboot access denied on GPT drives.
 

My Computer

System One

  • OS
    Windows 10
    Computer type
    Laptop
    Manufacturer/Model
    HP
    CPU
    Intel(R) Core(TM) i7-4800MQ CPU @ 2.70GHz
    Motherboard
    Product : 190A Version : KBC Version 94.56
    Memory
    16 GB Total: Manufacturer : Samsung MemoryType : DDR3 FormFactor : SODIMM Capacity : 8GB Speed : 1600
    Graphics Card(s)
    NVIDIA Quadro K3100M; Intel(R) HD Graphics 4600
    Sound Card
    IDT High Definition Audio CODEC; PNP Device ID HDAUDIO\FUNC_01&VEN_111D&DEV_76E0
    Hard Drives
    Model Hitachi HTS727575A9E364
    Antivirus
    Microsoft Defender
    Other Info
    Mobile Workstation
But it does little to nothing except fixing bootrec /fixboot access denied on GPT drives.

bootrec /fixboot

Google Gemini:

Is it intended for GPT drives?​

The short answer is no, not primarily. The bootrec suite of commands was originally designed for the older MBR (Master Boot Record) partitioning scheme used by legacy BIOS systems. On a GPT (GUID Partition Table) drive, which is the standard for modern UEFI systems, the boot process works differently:

  1. GPT/UEFI Logic: Instead of looking for a code snippet in a "boot sector" on a specific partition, a UEFI system looks for a dedicated EFI System Partition (ESP) containing .efi files.
  2. The "Access Is Denied" Error: If you try to run bootrec /fixboot on a GPT drive, you will almost always receive an "Access is denied" error. This isn't necessarily because your drive is locked; it’s because the command is trying to interact with the disk in a way that GPT/UEFI doesn't support.
 

My Computers

System One System Two

  • OS
    Windows 11 Pro
    Computer type
    PC/Desktop
    CPU
    AMD Ryzen 9 9950X3D
    Motherboard
    ASRock B650E Taichi Lite
    Memory
    Kingston FURY Beast 64GB (2x32GB) DDR5 6000MT/s
    Graphics Card(s)
    ASUS TUF Gaming Radeon RX 9070 OC Edition 16GB GDDR6
    Hard Drives
    Solidigm P44 Pro 2TB M.2 NVMe SSD
  • Operating System
    Windows 11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Lenovo Legion Pro 7i Gen 10 16"
    CPU
    Intel Core Ultra 9 275HX
    Memory
    64GB (2x 32GB) DDR5-6400
    Graphics card(s)
    NVIDIA GeForce RTX 5080 16GB GDDR7 Laptop GPU
    Hard Drives
    2x 1TB M.2 NVMe SSD (SK Hynix)
"Scan all disks for installation compatible with Windows and display the entries that are currently NOT in the boot configuration store."

Your system disk is present in the BCD, so it doesn't need to be added.

As @garlin mentioned, your Windows installation is already present in the BCD store, so it does not need to be added again. This is normal if your system is already booting correctly.

bootrec /ScanOs
- Scans all disks for Windows installations that are not currently present in the Boot Configuration Data (BCD) store.
- Reports detected installations only; it does not add them to the BCD store.
- If "Total identified Windows installations: 0" is reported, it means no Windows installations were found that are missing from the BCD store.

bootrec /RebuildBcd
- Scans all disks for Windows installations that are not currently present in the Boot Configuration Data (BCD) store.
- Prompts the user to add detected installations to the existing BCD database.
- If "Total identified Windows installations: 0" is reported, it means no Windows installations were found that are missing from the BCD store.
Thanks for replies Garlin and Celery on my confusion with bootrec /scanos.
(Also to all others, I no longer have any issues with my USB drive letter assignments holding. This is my 4th reboot and they are holding ever since I did Bree's posted solution of Diskpart enable automount)

Garlin and Celery please excuse my confusion with bootrec terminology. I think I understand your implied premise ("your system disk is present in the BCD") you're talking about the entire Disk 0 including Partition 1, System 100 MB, 1024 KB, and not just the C: Partition. Correct ?

Also on READMEs on bootrec /scanos wherein it says,
"it scans all disks for Windows installations not currently in the boot configuration data". <- I understand that it's looking ONLY for Windows installations not currently in the Boot config data. I.e. other Win Installs that got installed without getting in the BCD.

The next part of the READMEs says,
"you use it to identify if Windows exists on your drive before rebuilding boot data". <- Ok this statement by itself is not confusing, but maybe could have said "if Windows Intalls Not in Boot Data exist . . . "
--
But the the next part of Readme text confuses me some when it says,
"If this command finds zero Windows installations, your problem is more serious than boot configuration. You might have drive failure or severely corrupted system files".

This seems backward to me. That seems to imply that my Total Identified Windows Installations: 0 was a problem. If I understand that 0 is not a problem then it would seem more like, Total Identified Windows Installations: 1 <-would be a problem, not 0

I must have a mental block on my perception of what the Readme is saying or else it's ambigous.
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    Laptop
    Manufacturer/Model
    HP 17" Laptop, Acer Aspire 5
If you have a working system, and your Windows volume is known to the boot manager, /scanos returns (0).

When you create a dual-boot setup by locally installing a new copy of Windows, Setup adds the new Windows to BCD. But if you grabbed an external drive with an existing copy of Windows, BCD has no previous knowledge of this Window's existence. So /scanos would return (1).

It's just scanning for Windows volumes, and informing your BCD isn't set up to show the missing volumes as bootable options.
 

My Computer

System One

  • OS
    Windows 7
You can usually ignore bootrec /scanos and bootrec /rebuildbcd on UEFI systems and use the bcdboot command instead if you need to repair the boot.

While bootrec /rebuildbcd only rebuilds the BCD store, bcdboot recreates the BCD and copies the required boot files to the EFI system partition, which makes it more reliable in many cases.

How to use the BCDBOOT command on a UEFI/GPT system
Post #17.
 

My Computers

System One System Two

  • OS
    Windows 11 Pro
    Computer type
    PC/Desktop
    CPU
    AMD Ryzen 9 9950X3D
    Motherboard
    ASRock B650E Taichi Lite
    Memory
    Kingston FURY Beast 64GB (2x32GB) DDR5 6000MT/s
    Graphics Card(s)
    ASUS TUF Gaming Radeon RX 9070 OC Edition 16GB GDDR6
    Hard Drives
    Solidigm P44 Pro 2TB M.2 NVMe SSD
  • Operating System
    Windows 11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Lenovo Legion Pro 7i Gen 10 16"
    CPU
    Intel Core Ultra 9 275HX
    Memory
    64GB (2x 32GB) DDR5-6400
    Graphics card(s)
    NVIDIA GeForce RTX 5080 16GB GDDR7 Laptop GPU
    Hard Drives
    2x 1TB M.2 NVMe SSD (SK Hynix)
If you have a working system, and your Windows volume is known to the boot manager, /scanos returns (0).

When you create a dual-boot setup by locally installing a new copy of Windows, Setup adds the new Windows to BCD. But if you grabbed an external drive with an existing copy of Windows, BCD has no previous knowledge of this Window's existence. So /scanos would return (1).

It's just scanning for Windows volumes, and informing your BCD isn't set up to show the missing volumes as bootable options.

You can usually ignore bootrec /scanos and bootrec /rebuildbcd on UEFI systems and use the bcdboot command instead if you need to repair the boot.

While bootrec /rebuildbcd only rebuilds the BCD store, bcdboot recreates the BCD and copies the required boot files to the EFI system partition, which makes it more reliable in many cases.

How to use the BCDBOOT command on a UEFI/GPT system
Post #17.
Ok I'm beginning to see the bigger picture thanks you guys, which better enables me to get past any description confusion on my part. I'm new to reading these boot tools (obviously) and I thank you for pointing me in the right direction. I guess in my brain it's akin to hearing someone for the first time, saying park on the driveway and drive on the Parkway). Fortunately for me I have no urgent problems now. I will make a note of Celery's advice on the bcdboot use.

However if you would be so kind, I have one or two other curiosity questions of what partitions different items are stored. If you could comment on the below I'd be obliged.

I see from Garlin's last reply that the boot manager is stored on Windows Volume which I assume is (bootmgfw.efi) and (Drive C) partition which on mine is labeled Primary. And that sounds logical.

1. But what's up with my BCDEdit return showing
Code:
PS C:\WINDOWS\system32> bcdedit
Windows Boot Manager   
----
identifier              {bootmgr}
device                  partition=\Device\HarddiskVolume1
path                    \EFI\Microsoft\Boot\bootmgfw.efi
description             Windows Boot Manager
. .
? I must be misunderstanding what->(=\Device\HarddiskVolume1) means since my DISKPART shows Volume 1 which is my Data & VMs Partition.
Code:
Volume 0      C       NTFS  Partition 749GB Healthy Boot
Volume 1      V  VMs  NTFS  Partition 202GB Healthy
--------------

Additionally on the bcdedit return it showed
Code:
Windows Boot Loader        
----
identifier              {current}
device                  partition=C:
path                    \WINDOWS\system32\winload.efi
. . .
osdevice                partition=C:
systemroot              \WINDOWS
So that does appear on Drive C:
----------------

2. Also where is the BCD stored by windows (and/or the default bootloader) or in other words where would one direct bootrec /rebuildbcd ?

I watched a Youtube video of a guy using bootrec /rebuildbcd and from where I was sitting it appeared he went to the 100mb hidden partition that looked to have the same parameters as the one labeled System on my Win11 Laptop-> Volume 2 FAT32 Partition 100MB Healthy System,
Partition 1 System 100 MB 1024KB
wherein he first assigned a drive letter to it and changed to :\efi\microsoft\boot then unhid BCD, then renamed it for backup, then did bootrec /rebuildbcd to fix a Total Windows Installations: 1

-----------(Full readouts of my Laptop below)-----------
Code:
DISKPART> select disk 0
Disk 0 is now the selected disk.
DISKPART> list volume
Volume ###  Ltr  Label  Fs    Type    Size  Status  Info
Volume 0      C       NTFS  Partition 749GB Healthy Boot 
Volume 1      V  VMs  NTFS  Partition 202GB Healthy
Volume 2              FAT32 Partition 100MB Healthy System 
Volume 3              NTFS  Partition 873MB Healthy Hidden
-
DISKPART> list part
Partition ###  Type              Size     Offset
-------------  ----------------  -------  -------
Partition 1    System             100 MB  1024 KB
Partition 2    Reserved            16 MB   101 MB
Partition 3    Primary            749 GB   117 MB 
Partition 4    Recovery           873 MB   749 GB
Partition 5    Primary            202 GB   750 GB
----
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    Laptop
    Manufacturer/Model
    HP 17" Laptop, Acer Aspire 5
I watched a Youtube video of a guy using bootrec /rebuildbcd and from where I was sitting it appeared he went to the 100mb hidden partition that looked to have the same parameters as the one labeled System on my Win11 Laptop-> Volume 2 FAT32 Partition 100MB Healthy System,
Partition 1 System 100 MB 1024KB
wherein he first assigned a drive letter to it and changed to :\efi\microsoft\boot then unhid BCD, then renamed it for backup, then did bootrec /rebuildbcd to fix a Total Windows Installations: 1

The same result can usually be achieved more easily with the bcdboot command. It rebuilds the BCD store and recreates the necessary boot files automatically, so you don’t need to manually rename or replace the existing BCD file.

In a UEFI system, Windows boot files (e.g. bootmgfw.efi and BCD) are located on the EFI system partition.

Google Gemini:

The EFI System Partition (ESP): This is a small, FAT32-formatted partition that the UEFI firmware looks for to find bootloaders.

bootmgfw.efi: This is the Windows Boot Manager. It is the primary executable that the UEFI firmware launches to start the Windows boot process.

BCD (Boot Configuration Data): This is the database that contains configuration parameters and tells the Boot Manager where the operating system (the C: drive) is located.



Path for Boot Manager: \EFI\Microsoft\Boot\bootmgfw.efi
Path for BCD: \EFI\Microsoft\Boot\BCD
 

My Computers

System One System Two

  • OS
    Windows 11 Pro
    Computer type
    PC/Desktop
    CPU
    AMD Ryzen 9 9950X3D
    Motherboard
    ASRock B650E Taichi Lite
    Memory
    Kingston FURY Beast 64GB (2x32GB) DDR5 6000MT/s
    Graphics Card(s)
    ASUS TUF Gaming Radeon RX 9070 OC Edition 16GB GDDR6
    Hard Drives
    Solidigm P44 Pro 2TB M.2 NVMe SSD
  • Operating System
    Windows 11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Lenovo Legion Pro 7i Gen 10 16"
    CPU
    Intel Core Ultra 9 275HX
    Memory
    64GB (2x 32GB) DDR5-6400
    Graphics card(s)
    NVIDIA GeForce RTX 5080 16GB GDDR7 Laptop GPU
    Hard Drives
    2x 1TB M.2 NVMe SSD (SK Hynix)
PS C:\WINDOWS\system32> bcdedit
Windows Boot Manager
----
identifier {bootmgr}
device partition=\Device\HarddiskVolume1
path \EFI\Microsoft\Boot\bootmgfw.efi
description Windows Boot Manager
. .
[/CODE]
? I must be misunderstanding what->(=\Device\HarddiskVolume1) means since my DISKPART shows Volume 1 which is my Data & VMs Partition.
Code:
Volume 0      C       NTFS  Partition 749GB Healthy Boot
Volume 1      V  VMs  NTFS  Partition 202GB Healthy

The confusion is that Windows supports several different methods for enumerating (naming) disk volumes.

diskpart shows one method for volume numbering, and \Device\HarddiskVolume uses an entirely different number.

diskpart's numbering scheme is private to diskspart, and only exists while you're inside the tool for the purpose of selecting a designated volume. Outside of diskpart, Windows will use the volume's unique GUID or sometimes the HarddiskVolume.

Code:
PS C:\Users\GARLIN\Downloads> .\WhatsMyVolume.ps1

Disk Partition DriveLetter FileSystem HarddiskVolume        GUID
---- --------- ----------- ---------- --------------        ----
               D:                     \\.\CdRom0\           \\?\Volume{1ad23074-85c8-11ee-83ad-806e6f6e6963}\
0    1                     FAT32      \\.\HarddiskVolume7\  \\?\Volume{a9fe4592-51db-462a-8bee-a94bb6b07488}\
0    3                     NTFS       \\.\HarddiskVolume9\  \\?\Volume{8a0a1a93-2d63-4048-b6c3-f3933032cb4d}\
0    4         F:          NTFS       \\.\HarddiskVolume10\ \\?\Volume{5a0aaf37-c23e-48d8-9bd6-b0b58485a1b0}\
1    1                     FAT32      \\.\HarddiskVolume1\  \\?\Volume{6215f152-f2c9-41b2-8c4d-dcd333ca73a2}\
1    3                     NTFS       \\.\HarddiskVolume3\  \\?\Volume{cf240be4-d7a7-45a6-ae58-1053bdedfcb1}\
1    4         C:          NTFS       \\.\HarddiskVolume4\  \\?\Volume{0289eaa4-e6f8-4956-999f-45fcb0d1c575}\
2    1         E:          NTFS       \\.\HarddiskVolume5\  \\?\Volume{d913675c-bfeb-486f-beee-5f9ea7d3a165}\
2    2         A:          NTFS       \\.\HarddiskVolume6\  \\?\Volume{dab248d8-6e5c-4eb5-82c9-e52b2b80ec02}\
Code:
DISKPART>
  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 0     D                       DVD-ROM         0 B  No Media
  Volume 1     F   My Drive     NTFS   Partition   7214 MB  Healthy
  Volume 2                      FAT32  Partition    260 MB  Healthy    Hidden
  Volume 3                      NTFS   Partition    700 MB  Healthy    Hidden
  Volume 4     C                NTFS   Partition     99 GB  Healthy    Boot
  Volume 5                      FAT32  Partition    260 MB  Healthy    System
  Volume 6                      NTFS   Partition    499 MB  Healthy    Hidden
  Volume 7     E   New Volume   NTFS   Partition   1024 MB  Healthy
  Volume 8     A   New Volume   NTFS   Partition   1022 MB  Healthy
 

My Computer

System One

  • OS
    Windows 7
Thanks guys, you've really helped me grapple with this. All I remember is the old Dos days where (if I remember correctly) Bios loaded the 1st sector on the disk (holding what installed Dos put there) to a certain memory address then jumped to that IP address and let the processor go with it.

So with UEFI it goes something like this:
The UEFI bios looks to drive it booted on to find a bootloader (which on an UEFI installed Windows OS) is on the EFI System Partition (ESP) FAT32 formatted. There the UEFI Bios looks to \EFI\Microsoft\Boot\bootmgfw.efi
This is the Windows Boot Manager and it looks to the BCD (at \EFI\Microsoft\Boot\BCD) to find where the default booting operating system is located (usually C: drive).
(And I'm guessing the other file bootmgr.efi that I see on some install USBs is a UEFI system fall back or whatever)
--
Now as to aspect of finding the correct system drive letter
for a booted Windows (including WinPE or WinRE):

So apparently DISKPART is really only good for verifying size.

Does WinPE and WinRE match what their File Explorer shows?

Is the WhatsMyVolume.ps1 script available for download?

Is it similar or better than Powershell's Get-Disk cmdlet with Get-Partition and Get-Volume?
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    Laptop
    Manufacturer/Model
    HP 17" Laptop, Acer Aspire 5
The UEFI bios looks to drive it booted on to find a bootloader (which on an UEFI installed Windows OS) is on the EFI System Partition (ESP) FAT32 formatted. There the UEFI Bios looks to \EFI\Microsoft\Boot\bootmgfw.efi
This is the Windows Boot Manager and it looks to the BCD (at \EFI\Microsoft\Boot\BCD) to find where the default booting operating system is located (usually C: drive).
(And I'm guessing the other file bootmgr.efi that I see on some install USBs is a UEFI system fall back or whatever)
Windows boot manager, normally \EFI\Microsoft\Boot\bootmgfw.efi (or \EFI\Boot\bootx64.efi as the fallback) reads the BCD to understand which is the default Windows volume or whether it should present you with a list of other boot volumes.

So apparently DISKPART is really only good for verifying size.
diskpart is what it says, a disk layout tool. You can manage the different partitions, and change their attribute types.
Other than that, it's very limited.

Windows does a mapping of partitions -> volumes -> maybe a drive letter.

Using a special folder path like \\.\HarddiskVolume1\ or \\?\Volume{6215f152-f2c9-41b2-8c4d-dcd333ca73a2}\, you can access the volume's filesystem without using a drive letter. For example, you can read and copy files from the EFI or RE.

Does WinPE and WinRE match what their File Explorer shows?
WinPE only exists as a RAM disk-mounted filesystem. It understands those other path formats, but unfortunately the default image doesn't come with any useful tools so you can decipher them. WinRE is slightly more full-fledged compared to WinPE, but is still a stripped down Windows environment solely intended for running recovery-type tools.

Is the WhatsMyVolume.ps1 script available for download?

Is it similar or better than Powershell's Get-Disk cmdlet with Get-Partition and Get-Volume?
PS has a bunch of disk management cmdlets (ie. Get-Disk, Get-Partition, Get-Volume, etc.). But trying to chain the results can be a real pain.

Like if you know a given partition or volume, how do you map it back to a physical disk, partition, drive letter, etc.? Some of those attributes are directly exposed, while others, you have to get the GUID (unique ID), and use that to build a table of matching values.

You would think finding the HarddiskVolume path would be easy... Oh no, I had to track down some Pinvoke method to expose an older Win32 API. Many times you wish the PS folks would have just added those features in the native cmdlets. :cautious:
 

Attachments

My Computer

System One

  • OS
    Windows 7
Thanks Garlin for the clarifications.
A good while back I remember reading on some UEFI site (like you say) the bootx64.efi was the fallback but I didn't see it on a WinInstall USB that I had stored. It only had bootmgfw.efi and bootmgr.efi. I think I also read (at least on a Windows install disk) the bootmgfw.efi and bootx64.efi were identical files (same contents).

Anyhow I'll look into reading on using \\.\HarddiskVolume1\ and
\\?\Volume{6215f152-f2c9-41b2-8c4d-dcd333ca73a2}\

I surmise that's possibly part of the NT Object Manager namespace or something like that. In my case I'm guessing I'd use the resumeobject number {976657cf-156b-11f0-965e-eabe4e45cacc} from bcdedit's return.

I thank you MUCH for all the guidance you given me on this. It does not appear the Youtube videos I've watched use any of GUID procedures. They just look at the size parameters in diskpart and Diskmgmt and then assign any drive letter and then check the dir contents to verify it has the :\efi\microsoft\boot and then unhide (attrib) the BCD. But I can see where this could get hairy in some scenarios.

And thanks for script I'm downloading it now to take a look at.
I also going to watch some more of the bcdboot commands on UEFI systems like Celery said. So far I've mainly watched the bootrec stuff.
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    Laptop
    Manufacturer/Model
    HP 17" Laptop, Acer Aspire 5
Just remember, the exact paths will be different for everyone. GUID's are randomly generated.
 

My Computer

System One

  • OS
    Windows 7

Latest Support Threads

Back
Top Bottom