I'm attempting to set up multiple drive letters (whole disk partitions) on a second and third disk during the autounattend.xml install of Server 2012.
The partitions are created and formatted. However, the drives (disks 1 & 2) are marked as 'offline' when I login for the first time. If I manually mark them as online through Disk Management they are assigned the right drive letter and all is well.
I've tried to add a simple diskpart script to SetupComplete.cmd without luck. Here's my SetupComplete.cmd file that doesnt work:
mkdir c:\temp
echo select disk 1 >> c:\temp\dp.txt
echo online disk >> c:\temp\dp.txt
echo select disk 2 >> c:\temp\dp.txt
echo online disk >> c:\temp\dp.txt
diskpart /s c:\temp\dp.txt
However, this file does work if I run it when I first login! Is there a way to set other partitions either using autounattend.xml or using a script?
Here's the pertinent section from the autounattend.xml:
<component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<DiskConfiguration>
<WillShowUI>OnError</WillShowUI>
<Disk wcm:action="add">
<CreatePartitions>
<CreatePartition wcm:action="add">
<Order>1</Order>
<Size>350</Size>
<Type>Primary</Type>
</CreatePartition>
<CreatePartition wcm:action="add">
<Order>2</Order>
<Extend>true</Extend>
<Type>Primary</Type>
</CreatePartition>
</CreatePartitions>
<ModifyPartitions>
<ModifyPartition wcm:action="add">
<Active>true</Active>
<Label>Boot</Label>
<Format>NTFS</Format>
<Order>1</Order>
<PartitionID>1</PartitionID>
</ModifyPartition>
<ModifyPartition wcm:action="add">
<Format>NTFS</Format>
<Order>2</Order>
<PartitionID>2</PartitionID>
<Label>System</Label>
</ModifyPartition>
</ModifyPartitions>
<DiskID>0</DiskID>
<WillWipeDisk>true</WillWipeDisk>
</Disk>
<Disk wcm:action="add">
<CreatePartitions>
<CreatePartition wcm:action="add">
<Order>1</Order>
<Type>Primary</Type>
<Extend>true</Extend>
</CreatePartition>
</CreatePartitions>
<ModifyPartitions>
<ModifyPartition wcm:action="add">
<Format>NTFS</Format>
<Label>WorkSpace</Label>
<Letter>Y</Letter>
<Order>1</Order>
<PartitionID>1</PartitionID>
<Active>true</Active>
</ModifyPartition>
</ModifyPartitions>
<DiskID>1</DiskID>
<WillWipeDisk>true</WillWipeDisk>
</Disk>
<Disk wcm:action="add">
<CreatePartitions>
<CreatePartition wcm:action="add">
<Order>1</Order>
<Type>Primary</Type>
<Extend>true</Extend>
</CreatePartition>
</CreatePartitions>
<ModifyPartitions>
<ModifyPartition wcm:action="add">
<Format>NTFS</Format>
<Label>TempDB</Label>
<Letter>T</Letter>
<Order>1</Order>
<PartitionID>1</PartitionID>
<Active>true</Active>
</ModifyPartition>
</ModifyPartitions>
<DiskID>2</DiskID>
<WillWipeDisk>true</WillWipeDisk>
</Disk>
</DiskConfiguration>
<ImageInstall>
<OSImage>
<InstallTo>
<PartitionID>2</PartitionID>
<DiskID>0</DiskID>
</InstallTo>
<InstallToAvailablePartition>false</InstallToAvailablePartition>
<WillShowUI>OnError</WillShowUI>
<InstallFrom>
<MetaData wcm:action="add">
<Key>/IMAGE/NAME</Key>
<Value>Windows Server 2012 SERVERSTANDARD</Value>
</MetaData>
</InstallFrom>
</OSImage>
</ImageInstall>
<UserData>
<ProductKey>
<Key>48HP8-DN98B-MYWDG-T2DCC-8W83P</Key>
<WillShowUI>OnError</WillShowUI>
</ProductKey>
<AcceptEula>true</AcceptEula>
<FullName>--</FullName>
<Organization>--</Organization>
</UserData>
<UseConfigurationSet>true</UseConfigurationSet>
</component>