Over the past year, I’ve been asked several times about how I’d manage OSD when a computer has several disk drives. I’ve dealt with this mostly on the server side of OSD, but from time to time, I have a device with a couple of drives.
So when it comes to workstations, I go by this rule, the OS goes on the fastest disk available, and if they are all fast, it goes on the smallest disk available. That’s what I default to, and it’s pretty much 99% correct. I try to automate for the majority before I start automating for the 1 offs.
For the one offs, I’d recommend building something into your front end, or create some simple popups to ask the user which disk to use, but I’m not going to cover that here.
In the Task Sequence, choosing and formatting of the disks is controlled by variables, so lets take a look at the Task Sequence Steps
So the format step, you can have it format the disk number based on a Variable that stores the disk number. [OSDDiskNumber in this example] Then on your primary Windows partition, you can set a variable, which I set to OSDisk, which gets used later in the Apply Operating System Step:
So at this point, we just need to populate that variable OSDDiskNumber, which we can do with a PowerShell step.
I have a small script that looks for NVMe drives, and will use that as the primary, then falls back to the smallest disk.
garytown/OSD/Set-DiskNumber.ps1 at master · gwblok/garytown (github.com)
#Script Returns the Disk Number for the Desired Disk for installing Windows to during OS
#Get NVMe Disk
$BusType = 'NVMe'
$Disks = Get-Disk | Where-Object {$_.BusType -Match $BusType}
#If Non-Found, just use the smallest disk size:
if (!($disks)){
$DiskNumber = (get-disk | Where-Object {$_.size -eq ((get-disk | Where-Object {$_.BusType -notmatch "USB"}).size | measure -Minimum).Minimum}).Number
}
#If found, get the smallest one (just incase there is more than one)
else{
$DiskNumber = ($Disks | Where-Object {$_.size -eq ((get-disk | Where-Object {$_.BusType -match $BusType}).size | measure -Minimum).Minimum}).Number
}
return $DiskNumber
Edit the script for your own needs.
Running the script, you can see it ruturns disk number 1, not disk 0. While both disks are NVMe, it’s the smaller of the two, so the logic in the script returns disk 1
So we embed the script, and have the output dumpted out the the variable
So now we have the disk in the multi disk system that we want to format and install the OS on, and following the process layed out here, it will detect the correct drive, then format it, and have the OS applied.
If you’re looking for more information on the formating step and how I do it, find more info here:
OSD Partition Setup, Mike Terrill Edition (The Optimized Way). – GARYTOWN ConfigMgr Blog
Let me know if you want any additional details, or need additional senarios covered, and I’ll see what I can do.
GARYTOWN.COM
Deja vu, I think Keith has some VBScripts that are similar to this 🙂
https://keithga.wordpress.com/?s=ZTISelectBootDisk.wsf