none
MDT 2013 Format and Partitioning - Checking HDD size and then action RRS feed

  • Question

  • Hi,

    I am using MDT 2013 on a Server 2012 box. We are currently upgrading from Windows 7 Pro x32 to Windows 7 Ent x64. About 80% of our desktop and laptop fleet have over 100GB HDD's installed with the rest having an 80GB HDD. These will all be a fresh installation.

    I am wanting a script to first check the size of the HDD and then do the following;

    If larger then 100GB - create 2 partitions, C:\ 100GB in size and D:\ the rest of the space available

    If less then 100GB - just create one partition, c:\ all space available

    Please Help.

    Thanks.

    Monday, June 16, 2014 4:23 AM

Answers

  • Hi,

    Thanks for all your help on this, I have found a resolution to this, i ended up modifying Ren's WMI query to the below. I created two seperate 'Format and Partition' steps and added the below conditions to each.

    For HDD greater than 100GB;

    SELECT * FROM Win32_DiskDrive WHERE Index = "0" AND Size > 107374182400

    For HDD less than 100GB;

    SELECT * FROM Win32_DiskDrive WHERE Index = "0" AND Size <= 107374182400

    • Marked as answer by David Jobse Friday, June 20, 2014 12:55 AM
    Friday, June 20, 2014 12:54 AM
  • WMI query the disk size and set it as condition on the format and partition step.

    For disks larger then 100 Gb the query looks like this:
    select * from win32_diskdrive where size > 100000000000

    For disks larger then 100 Gb the query looks like this:
    select * from win32_diskdrive where size < 100000000000

    Open your task sequence, CTRL+C, CTRL+V your format and partition step. Create the format and partition scheme that you want.

    Put the WMI query as condition on the step.


    If this post is helpful please click "Mark for answer", thanks! Kind regards

    • Marked as answer by David Jobse Friday, June 20, 2014 12:54 AM
    Monday, June 16, 2014 11:02 AM

All replies

  • WMI query the disk size and set it as condition on the format and partition step.

    For disks larger then 100 Gb the query looks like this:
    select * from win32_diskdrive where size > 100000000000

    For disks larger then 100 Gb the query looks like this:
    select * from win32_diskdrive where size < 100000000000

    Open your task sequence, CTRL+C, CTRL+V your format and partition step. Create the format and partition scheme that you want.

    Put the WMI query as condition on the step.


    If this post is helpful please click "Mark for answer", thanks! Kind regards

    • Marked as answer by David Jobse Friday, June 20, 2014 12:54 AM
    Monday, June 16, 2014 11:02 AM
  • Ok, so i have added the mentioned WMI query on the TS step 'Format and Partition Disk' using the greater than 100GB option. The OSD failed with error: 'Failure (5456): Unable to determine destination disk, partition and/or drive'. This was being tested on a laptop with a 80GB HDD.

    I did however test this on a PC that did have a HDD larger than 100GB and it worked fine as per the volumes specified in the properties tab in the TS step of 'Format and Partition Disk'. (100GB for C:\ and the remaining space the D:\).

    So how does this query tell MDT how to partition the drive acording to what is have found, as far as i can tell, this query only queries if the HDD is larger or smaller than 100GB, and thats it.

    BDD.log files just says 'DestinationDisk and Partitions did not yield a target partition and/or drive, see BDD.log'.

    Your help in this is much appreciated.

    Tuesday, June 17, 2014 6:42 AM
  • The condition put on the step decides if the step is executed or skipped. I told in my post you need to copy the format and partition step, so you'll have two format and partition steps. 1 for disks smaller  then 100 gb and one for 100 gb and larger.

    The step with the condition for smaller disks is skipped if the disk is larger then 100gb and the step with the condition for larger disks is skipped if the disk is smaller then 100 gb.


    If this post is helpful please click "Mark for answer", thanks! Kind regards

    Tuesday, June 17, 2014 6:57 AM
  • Some points:

    1. I generally discourage IT admins from adding more partitions than necessary, leave the MDT partition configuration as-is in the MDT task sequence ( Drive C: 100% of remaining disk space ).

    2. If you define your *own* partition configuration, then you loose some of the MDT automagic helpers. MDT will not automatically create a Bitlocker Partition, MDT will not automatically create uEFI partitions. *YOU* must create a task sequence and/or steps to perform this.

    3. If you _must_ do this, as a work around (hack), leave the MDT Default partition configuration as is and set OSDPartitions0Size=80. THat will let ZTIDiskPart.wsf create all the correct partitions, and you can add the extra partition later on in the State REstore phase using a diskpart.exe script (sel disk 0, create part pri, format quick fs=NTFS label=data, assign, exit).

    4. If you still have problems, please copy your bdd.log file to a public site like OneDrive, and post the link here.


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

    Wednesday, June 18, 2014 1:52 AM
    Moderator
  • Hi,

    Thanks for all your help on this, I have found a resolution to this, i ended up modifying Ren's WMI query to the below. I created two seperate 'Format and Partition' steps and added the below conditions to each.

    For HDD greater than 100GB;

    SELECT * FROM Win32_DiskDrive WHERE Index = "0" AND Size > 107374182400

    For HDD less than 100GB;

    SELECT * FROM Win32_DiskDrive WHERE Index = "0" AND Size <= 107374182400

    • Marked as answer by David Jobse Friday, June 20, 2014 12:55 AM
    Friday, June 20, 2014 12:54 AM