none
Choose SSD for OS and HDD for data RRS feed

  • Question

  • Hello, 

    We receive more and more computers with SSD m2 slot for the OS and one mechanical drive for data.

    Now the problem is if we use MDT, the mechanical drive is seen as sata0 so Windows deploys to it.

    How can I setup conditions to set the SSD as the OS drive ?  

    Tuesday, August 29, 2017 12:25 PM

All replies

  • I have seen this behavior on Dell Optiplex 7040 while installing from USB drives. When doing PXE boot M2 drive would end up being the sata0 drive.

    Here is how you could implement the desired behavior:

    Put this script into your deployment share. Note: You may need to modify the value for model / M2 drive.

    <#
     
    ************************************************************************************************************************
     
    Created:    2016-05-03
    Version:    1.0
     
    Author:     Anton Romanyuk, Login Consultants Germany GmbH (C) 2016
    
    Purpose:    Used to verify that SSD is indeed first boot device on a Dell Inc. system with two hard drives.
    			If necessary, sets a variable needed to switch installation drives.
     
    ************************************************************************************************************************
     
    #>
    
    # Determine where to do the logging 
    $tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment 
    $logPath = $tsenv.Value("LogPath")  
    $logFile = "$logPath\$($myInvocation.MyCommand).log"
    $Model = $TSenv.Value("Model")
    $disks = @()
     
    # Start the logging 
    Start-Transcript $logFile
    Write-Host "Logging to $logFile"
     
    # Start Main Code Here
    
    Write-Host "$($myInvocation.MyCommand) - Retrieving physical disks"
    
    $Section = "Check Model"
    
    Write-Host "$($myInvocation.MyCommand) - Model set to $Model"
    
    Switch ($Model){
    "OptiPlex 7040"{
    	Write-Host "$($myInvocation.MyCommand) - Retrieving physical disks"
    	#W8.1 ADK is using a different naming scheme for physical disks - PhysicalDisk0 (SSD) and PhysicalDisk1 (HDD), so we need to use Get-Disk cmdlet instead of Get-PhysicalDisk
    	#Note: we need to make sure that SSD is not the first boot device, so we need to evaluate the disk number as well
    	$disks = Get-Disk | Select-Object Number,FriendlyName
    	Write-Host "$($myInvocation.MyCommand) - Processing retrieved physical disks."
    	Write-Host "$($myInvocation.MyCommand) -" $disks
    
    	foreach($disk in $disks)
    	{
    	    if($disk.FriendlyName -like "NVMe PM951*" -and $disk.Number -gt "0") {
    			Write-Host "$($myInvocation.MyCommand) - NVMe PM951 NVMe SAMSUNG M.2 SSD drive detected and it is not the first boot device."
    			$TSenv.Value("IsNVMe") = "TRUE"
    			Exit 0
    		}
    		if($disk.FriendlyName -like "NVMe PM951*" -and $disk.Number -eq "0") {
    			Write-Host "$($myInvocation.MyCommand) - NVMe PM951 NVMe SAMSUNG M.2 SSD drive detected and it is the first boot device. No change required."
    			Exit 0
    		}
    	}
    }
    Default
        {
            Write-Host "$($myInvocation.MyCommand) - $Model does not have an M.2 SSD drive installed, exit" 
            Exit 0
        }
    }
    
    # Stop logging 
    Stop-Transcript

    Add custom property IsNVMe  to your Custom Settings.

    Run this PowerShell script in WindowsPE before running the format disk step:

    Next: duplicate the Format and Partition Disk (UEFI) step and adjust the steps as follows:

    This should do the trick.


    Blog - http://www.vacuumbreather.com / http://www.wcsaga.com

    • Proposed as answer by Anton Romanyuk Tuesday, August 29, 2017 1:32 PM
    Tuesday, August 29, 2017 1:31 PM
  • Hello,

    thanks for your reply. I will try it ! 

    But I see you do it for a specific computer. At least I've got a base where to go. 

    Tuesday, August 29, 2017 1:46 PM
  • You can easily modify the script to support multiple models. It is basically copying and pasting...:-)

    EDIT: Copy paste this bit and change model name / M2 SSD caption to reflect your configuration in order to support multiple systems.

    "OptiPlex 7040"{
    	Write-Host "$($myInvocation.MyCommand) - Retrieving physical disks"
    	#W8.1 ADK is using a different naming scheme for physical disks - PhysicalDisk0 (SSD) and PhysicalDisk1 (HDD), so we need to use Get-Disk cmdlet instead of Get-PhysicalDisk
    	#Note: we need to make sure that SSD is not the first boot device, so we need to evaluate the disk number as well
    	$disks = Get-Disk | Select-Object Number,FriendlyName
    	Write-Host "$($myInvocation.MyCommand) - Processing retrieved physical disks."
    	Write-Host "$($myInvocation.MyCommand) -" $disks
    
    	foreach($disk in $disks)
    	{
    	    if($disk.FriendlyName -like "NVMe PM951*" -and $disk.Number -gt "0") {
    			Write-Host "$($myInvocation.MyCommand) - NVMe PM951 NVMe SAMSUNG M.2 SSD drive detected and it is not the first boot device."
    			$TSenv.Value("IsNVMe") = "TRUE"
    			Exit 0
    		}
    		if($disk.FriendlyName -like "NVMe PM951*" -and $disk.Number -eq "0") {
    			Write-Host "$($myInvocation.MyCommand) - NVMe PM951 NVMe SAMSUNG M.2 SSD drive detected and it is the first boot device. No change required."
    			Exit 0
    		}
    	}
    }


    Blog - http://www.vacuumbreather.com / http://www.wcsaga.com


    • Edited by Anton Romanyuk Tuesday, August 29, 2017 2:23 PM added code example
    Tuesday, August 29, 2017 2:04 PM
  • My blog post on how to programmatically override the target disk on machines:

    https://keithga.wordpress.com/2013/09/18/ztiselectbootdisk-wsf/

    Although this script was written *before* NVMe drives. :)


    Keith Garner - Principal Consultant [owner] - http://DeploymentLive.com


    Tuesday, September 5, 2017 5:11 AM
    Moderator
  • Hello Keith,

    your solution seems what I need. I will try it, right now.

    Editing each machine name is not viable for me. It's due to the way my firm works. They buy and I don't know what they buy and I'm suppose to install within the day for many different configurations.

    In older version of MDT we can choose the disk, basically I need the same thing.

    Tuesday, September 5, 2017 1:32 PM