OSD Partition Setup, Mike Terrill Edition (The Optimized Way).

I recently rebuilt my TS and due to my habit of pasting pictures and results on twitter, it gets scrutinized, mocked, and maybe at times even a bit of praise.  The nice thing is, I have hundreds of eyes looking it over and, lets just say, offering helpful suggestions.

In my new TS, I tried to implement a better Partitioning step than the default ConfigMgr provided partition step.  Not that anything is wrong with the default step, but it could be better.



Couple things to note, 500MB for EFI, you don’t need that much, what do you need?  Mike Terrill to the rescue:

Ok, so now I’ve changed that to 260MB.  But now I have a Recovery Partition that is 1% of the disk size, this can be bad for two reasons… too small or too big.  We had a discussion on Twitter about the size of the recovery partition, and the old recommendation is 499MB, but the new one is 984MB, as WinRE can grow over 500MB now…and something about VSS… bla bla.. ask David Segura.. @SeguraOSD


Ok, so if you have a 100GB drive or larger, then you’re just wasting part of your disk on that recovery partition, so why not force it to be a certain size.  Well, how do you do that?  Mike to the rescue again..

Mike explains how to do it in this blog post: https://miketerrill.net/2017/07/12/configuration-manager-osd-recovery-partitions-and-mbr2gpt/
However, he explains how to do it for the older MBR (BIOS) formatting, and not the GPT (UEFI) formatting.  But then recently he filled in the blanks on Twitter:

*Note, he posted this before our discussion about changing the Recovery Partition size from 499 to 984.

So now I have all of the info, time to put it all together.. this is how it looks:
Group Conditions, I copied the ones from the original “Partition Disk 0 – UEFI Steps to the group:

  1. Partition Disk 0 – UEFI
    image image
  2. Run Command Line: This step creates the diskpart file used to automate the partitioning process.  It’s basically copied identically from Mike’s Twitter post, but instead of creating a text file, and using a package, I use a trick I’ve used before to build scripts / files on the fly without requiring content.. echo >>
  3. Run Command Line: This step calls diskpart and applies the txt file you created in the last step.

During the TS, what does this look like:

You’ll see your diskpartUEFI.txt file created in the temp folder, you’ll see the log show that it ran the diskpart process using your diskpartUEFI file. The smsts.log also shows the OS partition being shrunk and the Recovery Partition being created.  Then gives you a list of your 4 partitions, with the sizes you specified.

In Windows, you’ll only see the 3 partitions:

Now you know the optimized way to partition your drive and this is all documented in one place, so you don’t have to search twitter, which is like impossible to find that one tweet you were looking for.

Special Thanks to Mike Terrill, who came up with this entire process, and David Segura for the guidance on the EFI partition size.

Format OSD TS Group Steps - Mike Terrill Ed. - DOWNLOAD HERE (12 downloads)


4 thoughts on “OSD Partition Setup, Mike Terrill Edition (The Optimized Way).”

  1. Gary, if you're interested, I just wrote a PS script that can do this without needing the Diskpart text files. You could probably even make it into a command line without needing a package. It also writes the diskpart output to both a log file and the console.

    $tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment
    $LogPath = $tsenv.Value("_SMSTSLogPath")
    $UEFI = $tsenv.Value("_SMSTSBootUEFI")
    If ($UEFI -eq $TRUE){
    "select disk 0","list partition","select partition 3","shrink desired=984 minimum=984","create partition primary","format quick fs=ntfs label=Recovery","set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"","gpt attributes=0x8000000000000001","list partition" | diskpart | Tee-Object -FilePath "$LogPath\Create-RecoveryPartition.log"
    "select disk 0","list partition","select partition 2","shrink desired=984 minimum=984","create partition primary","format quick fs=ntfs label=Recovery","set id=27","list partition" | diskpart | Tee-Object -FilePath "$LogPath\Create-RecoveryPartition.log"

  2. I changed the first part of the creation of diskpartUEFI.txt. I changed the 'zero' to %OSDDiskIndex% to cater for 'not installing on drive 0'-situations (eg. Spindle is on 0 and SSD is 1). The line now starts with cmd.exe /c echo select disk %OSDDiskIndex% >> %temp%\diskpartUEFI.txt …..

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.