While unknown as to what version this issue started with, the problem is replicated in WinPE v10.0.17763.1 but is not replicated in v10.0.14393.0. After much testing it appears that current WinPE detects an NVMe in an m.2 socket as a different type of disk (as expected) but then gives priority to other interfaces when it comes to disk numbering. The issue has been seen on 5 different boards so far, two different chipset manufacturers and 3 different board manufacturers.
Using a fixed driver set, WinPE v10.0.14393.0, booting via USB with a board where the only disk installed is in an M.2 socket, either SATA SSD or NVME, WinPE will give the M.2 device Disk 0 and the USB key Disk 1.
Using the same driver set, and WinPE v10.0.17763.1, booting via USB with a board where the M.2 socket has a SATA SSD, the M.2 device is Disk 0 and the USB key is Disk 1. If the device in the M.2 socket is an NVMe, the M.2 Device is Disk 1 and the USB key is Disk 0.
That is the problem. I have collected information relating to how the devices are detected on v10.0.17763.1, using a NUC10i3FNK with M.2 SATA and M.2 NVMe. In each scenario the USB key is removed prior to running the diskpart or wmic commands.
---------
NUC10i3FNK with Crucial MX500 M.2 SATA SSD
---------
Microsoft DiskPart version 10.0.17763.1
Copyright (C) Microsoft Corporation.
On computer: MININT-U8KOB3F
DISKPART> list disk
Disk ### Status Size Free Dyn Gpt
-------- ------------- ------- ------- --- ---
Disk 0 Online 232 GB 0 B *
DISKPART> sel disk 0
Disk 0 is now the selected disk.
DISKPART> detail disk
CT250MX500SSD4
Disk ID: {A5BFEC98-EA08-4F09-9568-043A4150E9C2}
Type : SATA
Status : Online
Path : 1
Target : 0
LUN ID : 0
Location Path : PCIROOT(0)#PCI(1700)#ATA(C01T00L00)
Current Read-only State : No
Read-only : No
Boot Disk : No
Pagefile Disk : No
Hibernation File Disk : No
Crashdump Disk : No
Clustered Disk : No
Volume ### Ltr Label Fs Type Size Status Info
---------- --- ----------- ----- ---------- ------- --------- --------
Volume 0 N Windows NTFS Partition 232 GB Healthy
Volume 1 SYSTEM FAT32 Partition 260 MB Healthy Hidden
X:\windows\system32>wmic /namespace:\\root\microsoft\windows\storage path msft_disk get Model,BusType
BusType Model
11 CT250MX500SSD4
---------
NUC10i3FNK with Samsung 950 PRO M.2 NVMe
---------
X:\windows\system32>diskpart
Microsoft DiskPart version 10.0.17763.1
Copyright (C) Microsoft Corporation.
On computer: MININT-A7B045E
DISKPART> list disk
Disk ### Status Size Free Dyn Gpt
-------- ------------- ------- ------- --- ---
Disk 1 Online 476 GB 0 B *
DISKPART> sel disk 1
Disk 1 is now the selected disk.
DISKPART> detail disk
AMD-RAID Samsung SSD 950 SCSI Disk Device
Disk ID: {6D23D8C0-4EA4-4923-9E0E-8988913D7006}
Type : RAID
Status : Online
Path : 8
Target : 2
LUN ID : 0
Location Path : UNAVAILABLE
Current Read-only State : No
Read-only : No
Boot Disk : No
Pagefile Disk : No
Hibernation File Disk : No
Crashdump Disk : No
Clustered Disk : No
Volume ### Ltr Label Fs Type Size Status Info
---------- --- ----------- ----- ---------- ------- --------- --------
Volume 0 D Windows NTFS Partition 476 GB Healthy
Volume 1 Recovery NTFS Partition 500 MB Healthy
Volume 2 SYSTEM FAT32 Partition 260 MB Healthy Hidden
DISKPART> exit
Leaving DiskPart...
X:\windows\system32>wmic /namespace:\\root\microsoft\windows\storage path msft_disk get Model,BusType
BusType Model
8 Samsung SSD 950
The NUC10i3FNK is set to AHCI and RAID is not an option. Yet the WinPE will detect the NVMe as BusType 8 aka RAID and have no location path. There is only one M.2 socket in the system and no settings were changed in between testing the SSD vs NVMe except for obviously removing one and installing the other.
Normal WinPE is not able to run the WMIC command listed above. It requires WinPE-WMI, WinPE-NetFX, WinPE-Scripting, WinPE-PowerShell and WinPE-StorageWMI WinPE_OCs .cab files, installing the StorageWMI last.
WinPE component reference:
https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-add-packages--optional-components-reference
WMI MSFT\_Disk class:
https://docs.microsoft.com/en-us/previous-versions/windows/desktop/stormgmt/msft-disk