cancel
Showing results for 
Search instead for 
Did you mean: 
Lenovo Employee pjorgensen
Views: 1,118
Symptoms

 

Windows installs to the SATA disk instead of the NVMe drive during an Operating System Deployment with SCCM.

 
Diagnosis

 

Systems with a dual drive configuration, an NVMe drive and either a SATA mechanical disk or SATA SSD will be installed.  In some cases, the SATA disk may be enumerated as Disk 0 and the NVMe drive as Disk 1.  This can be confirmed by booting to WinPE, executing the DiskPart utility and selecting disk 0 and/or disk 1, followed by the command detail disk.  Note the type of disk displayed, which will either be SATA or NVMe.  

 

In a default standard SCCM OSD task sequence, disk 0 will be formatted and partitioned depending on the partition scheme assigned (MBR or GPT).

 

Solution

 

Ideally, Windows should be installed to the NVMe drive instead of the SATA disk.  As a workaround, the below PowerShell script, when added to your task sequence, can be used to assign the NVMe as disk 0 by dynamically setting the OSDDiskIndex action variable.  It will check if there's more than one drive installed in the system, detect if an NVMe is present, and set the variable if one is present.

 

        # ---------------------
        # Count Disks
        # ---------------------

        Write-Host "--------------------"
        Write-Host " Checking the Drive Count "
        Write-Host "--------------------"        
        $DiskCount = (Get-Disk).Number.Count
            if ($DiskCount -eq 1)
            {
                Write-Host "--------------------"
                Write-Host " Only 1 installed.  Move along "
                Write-Host "--------------------"     
            }
            elseif ($DiskCount -gt 1) {

        # ---------------------
        # If there's more than 1, check if there's an NVMe
        # ---------------------

                Write-Host "--------------------"
                Write-Host " There's more than 1 disk installed, check if it's an NVMe. "
                Write-Host "--------------------"    
                $NVMe = (Get-WmiObject -Namespace root\microsoft\windows\storage -Class msft_disk) | ?{$_.BusType -eq 17} | Select-Object -ExpandProperty Number
           
if (!($NVMe))
            {
                Write-Host "--------------------"
                Write-Host " No NVMe disk found "
                Write-Host "--------------------"
            }
# --------------------- # Initialize SMS TS environment. # --------------------- $TSEnv = New-Object -COMObject Microsoft.SMS.TSEnvironment # --------------------- # If there's an NVMe installed, set TS variable 'OSDDiskIndex'. # --------------------- } if ($NVMe) { $TSEnv.Value("OSDDiskIndex") = $NVMe Write-Host "--------------------" Write-Host " NVMe should now equal Disk 0 in the TS. " Write-Host "--------------------" }

 

Save the above code as a .ps1 file and copy to a source location.  Create a standard Package in your console, specify source folder containing the .ps1 file.  Distribute package to distribution points.

 

Create or edit an existing task sequence:

 

 

  • Add a new Format and Partition Disk step above the original Partition Disk 0 step.
    • Leave the Disk Number as 0 (This will eventually end up as the SATA disk)
    • Create a new volume.  Partition name is optional.
    • Partition type set to Primary using 100% of free space
    • Format as NTFS (Quick)

 

 

  • Add a Run PowerShell Script step
    • Browse to Package containing script
    • Enter script name
    • Set execution policy to Bypass

 Example

Capture1.PNG

 

 

Once the system has completed the OSD, you can run the following PowerShell command to confirm Disk 0 now equals the NVMe drive

 

Get-Disk | %{$_.number,$_.friendlyname}

or open Disk Management.

Was this information helpful?

Contributors