Windows Server TechCenter > Windows Server Forums > Setup Deployment > Unattend - CreatePartition Size
Ask a questionAsk a question
 

AnswerUnattend - CreatePartition Size

  • Thursday, November 05, 2009 4:32 PMMrBeatnik Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hello.

    I am working on the unattend.xml file to automate most of the setup.
    In particular, I want to format and partition the hard disk with two partitions.

    This unattend may run on machines with different size disks.
    I do not know the partition size of the C drive (partition 1), but the D drive (partition 2) will always be 5GB.
    How can I set this in the unattend.xml?

    I want Partition 1 to be Primary C drive and a size that is "the rest of the disk".
    I want Partition 2 to be Logical D drive and a size that is 5Gb.



    Thanks.

Answers

  • Friday, November 06, 2009 9:15 AMMrBeatnik Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    Hi Tim,

    I'm guessing that the script would have to run after the unattend file has completed...
    So essentially this would be after the image has been multicast down and expanded too.

    However I was thinking of another solution....
    Since the unattend.xml file is in the ramdisk (once loaded), how about if I modify winpeshl.ini to run a small script before the setup.
    The script would query the size of the disk and modify the unattend.xml first partition line to make the "Size = totalHDDsize - 5GB".

    At the moment I'm unsure if this will work, since I guess unattend.xml could already be "in use" or loaded into memory etc etc, but I think I would prefer this solution rather than shrinking a disk after data has been expanded on.

    Any thoughts?


    -------

    My solution works:

    First of all, I place a custom wdsunattend.xml in the boot.wim; I do not get the server to send one down.
    If the server sends one down, it will overwrite the custom one that I make any changes to.

    I created a WINPESHL.ini:
     - (1) Run a custom script
     - (2) Run Setup.exe /WDS /Unattend:X:\myCustonWDSClientUnattend.xml


    (1) Will query the total hard disk size, perfrom calculation (such as total - 5Gb) and then add the SIZE field for partition 1 (C Drive) to the XML file with this calculated size.

    (2) Will run the regular setup with the new modified unattend.xml


    Thanks for the assistance.

    • Marked As Answer byMrBeatnik Friday, November 06, 2009 1:38 PM
    •  

All Replies

  • Thursday, November 05, 2009 4:36 PMJonathan440 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    set c to take all of it, then use the diskpart shrink command to take 5gb off, then create your d drive.
  • Thursday, November 05, 2009 5:21 PMMrBeatnik Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Has Code

    Hi,

    I am unsure how to do this using the unattend.xml..
    Will I have to use this command outwith the unattend.xml, or can it be integrated?

    Note, this is a PXE deployment I'm looking at, rather than a DVD.

    Thanks


    <DiskConfiguration> <WillShowUI>Never</WillShowUI> <Disk> <DiskID>0</DiskID> <WillWipeDisk>true</WillWipeDisk> <CreatePartitions> <CreatePartition> <Order>1</Order> <Type>Primary</Type> </CreatePartition> <CreatePartition> <Order>2</Order> <Type>Logical</Type> <Size>5000</Size> </CreatePartition> </CreatePartitions> <ModifyPartitions> <ModifyPartition> <Order>1</Order> <PartitionID>1</PartitionID> <Letter>C</Letter> <Label>System</Label> <Format>NTFS</Format> <Active>true</Active> <Extend>false</Extend> </ModifyPartition> <ModifyPartition> <Order>2</Order> <PartitionID>2</PartitionID> <Letter>D</Letter> <Label>Temp_data</Label> <Format>NTFS</Format> <Active>false</Active> <Extend>false</Extend> </ModifyPartition> </ModifyPartitions> </Disk> </DiskConfiguration>
  • Friday, November 06, 2009 2:43 AMTim Quan - MSFTMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Hi,

     

    I do not think this will work.

     

    In an unattend file, we can only set the first partition as 5GB and the second partition as "the rest of the disk". If you really want to do so, you may need to set only one partition (take the whole drive size) in the unattend file and then create a script to shrink 5GB and create the send partition as Jonathan440 suggested.

     

    Tim Quan - MSFT

     

  • Friday, November 06, 2009 9:15 AMMrBeatnik Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    Hi Tim,

    I'm guessing that the script would have to run after the unattend file has completed...
    So essentially this would be after the image has been multicast down and expanded too.

    However I was thinking of another solution....
    Since the unattend.xml file is in the ramdisk (once loaded), how about if I modify winpeshl.ini to run a small script before the setup.
    The script would query the size of the disk and modify the unattend.xml first partition line to make the "Size = totalHDDsize - 5GB".

    At the moment I'm unsure if this will work, since I guess unattend.xml could already be "in use" or loaded into memory etc etc, but I think I would prefer this solution rather than shrinking a disk after data has been expanded on.

    Any thoughts?


    -------

    My solution works:

    First of all, I place a custom wdsunattend.xml in the boot.wim; I do not get the server to send one down.
    If the server sends one down, it will overwrite the custom one that I make any changes to.

    I created a WINPESHL.ini:
     - (1) Run a custom script
     - (2) Run Setup.exe /WDS /Unattend:X:\myCustonWDSClientUnattend.xml


    (1) Will query the total hard disk size, perfrom calculation (such as total - 5Gb) and then add the SIZE field for partition 1 (C Drive) to the XML file with this calculated size.

    (2) Will run the regular setup with the new modified unattend.xml


    Thanks for the assistance.

    • Marked As Answer byMrBeatnik Friday, November 06, 2009 1:38 PM
    •