Jump to content

Automatic disk partitioning in Autounattend.xml


Recommended Posts

Hello!

I'm trying to make an fully unattended Windows 7 Enterprise DVD but I'm already struggling in the first steps like the disk partitioning... Since I'll be using this dvd to install Win7Ent on different HW, I don't know the size of the disk thus I just want the unattended setup to create a single partition that fills the whole disk; the xml file I've created is as follows:


<settings pass="windowsPE">
<component name="Microsoft-Windows-Setup" processorArchitecture="x86" 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">
<Extend>true</Extend>
<Type>Primary</Type>
<Order>1</Order>
</CreatePartition>
</CreatePartitions>
<ModifyPartitions>
<ModifyPartition wcm:action="add">
<Active>true</Active>
<Extend>true</Extend>
<Format>NTFS</Format>
<Label>Win7Ent</Label>
<Order>1</Order>
</ModifyPartition>
</ModifyPartitions>
<DiskID>0</DiskID>
<WillWipeDisk>true</WillWipeDisk>
</Disk>
</DiskConfiguration>
<UserData>
<AcceptEula>true</AcceptEula>
<Organization>Contoso</Organization>
</UserData>
<ImageInstall>
<OSImage>
<InstallToAvailablePartition>true</InstallToAvailablePartition>
<WillShowUI>OnError</WillShowUI>
</OSImage>
</ImageInstall>
</component>
<component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SetupUILanguage>
<UILanguage>it-IT</UILanguage>
</SetupUILanguage>
<UILanguage>it-IT</UILanguage>
<UserLocale>it-IT</UserLocale>
<SystemLocale>it-IT</SystemLocale>
<InputLocale>it-IT</InputLocale>
</component>
</settings>

Does anyone knows how to make it work?

Thanks to all who can help

Link to comment
Share on other sites


This can be done like this: For BIOS Based system

Example


<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="windowsPE">
<component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="[url="http://schemas.microsoft.com/WMIConfig/2002/State"]http://schemas.microsoft.com/WMIConfig/2002/State[/url]" xmlns:xsi="[url="http://www.w3.org/2001/XMLSchema-instance"]http://www.w3.org/2001/XMLSchema-instance[/url]">
<SetupUILanguage>
<UILanguage>it-IT</UILanguage>
</SetupUILanguage>
<InputLocale>0410:00000410</InputLocale>
<SystemLocale>it-IT</SystemLocale>
<UILanguage>it-IT</UILanguage>
<UserLocale>it-IT</UserLocale>
</component>
<component name="Microsoft-Windows-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="[url="http://schemas.microsoft.com/WMIConfig/2002/State"]http://schemas.microsoft.com/WMIConfig/2002/State[/url]" xmlns:xsi="[url="http://www.w3.org/2001/XMLSchema-instance"]http://www.w3.org/2001/XMLSchema-instance[/url]">
<DiskConfiguration>
<WillShowUI>OnError</WillShowUI>
<Disk wcm:action="add">
<DiskID>0</DiskID>
<WillWipeDisk>true</WillWipeDisk>
<!--System partition-->
<CreatePartitions>
<CreatePartition wcm:action="add">
<Order>1</Order>
<Type>Primary</Type>
<Size>100</Size>
</CreatePartition>
<CreatePartition wcm:action="add">
<Order>2</Order>
<Type>Primary</Type>
<Extend>true</Extend>
</CreatePartition>
</CreatePartitions>
<ModifyPartitions>
<ModifyPartition wcm:action="add">
<Active>true</Active>
<Format>NTFS</Format>
<Label>system</Label>
<Order>1</Order>
<PartitionID>1</PartitionID>
</ModifyPartition>
<!--Windows partition-->
<ModifyPartition wcm:action="add">
<Format>NTFS</Format>
<Label>Win7Ent</Label>
<Letter>C</Letter>
<Order>2</Order>
<PartitionID>2</PartitionID>
</ModifyPartition>
</ModifyPartitions>
</Disk>
</DiskConfiguration>
<ImageInstall>
<OSImage>
<InstallFrom>
<MetaData wcm:action="add">
<Key>/IMAGE/NAME</Key>
<Value>Windows 7 ENTERPRISE</Value>
</MetaData>
</InstallFrom>
<InstallTo>
<DiskID>0</DiskID>
<PartitionID>2</PartitionID>
</InstallTo>
<WillShowUI>OnError</WillShowUI>
<InstallToAvailablePartition>false</InstallToAvailablePartition>
</OSImage>
</ImageInstall>
<UserData>
<ProductKey>
<WillShowUI>OnError</WillShowUI>
<Key>XXXXX-XXXXX-XXXXX-XXXXX-XXXXX</Key>
</ProductKey>
<AcceptEula>true</AcceptEula>
<Organization>Contoso</Organization>
</UserData>

Image System partition and Windows partition

Edited by myselfidem
Link to comment
Share on other sites

Thanks for your reply but unfortunately the xml you proposed works only partially, it does create the system partition but it shows up in My Computer as a D: drive and in disk management it says "System D: (Healty, Primary Partition)" while on my workstation (installed manually) it shows up as "System Reserved (Healty, System, Primary Partition)".

When you install windows manually and you repartition the drive the setup automatically creates the System Reserved partition which doesn't show up in My Computer. Has anyone been able to recreate the standard setup behaviour in an unattended setup?

Link to comment
Share on other sites

Please attach your Autounattend.xml file!

If you don't want to see the system partition you can use Autounattend.xml file (BIOS-Based system), like this:


<DiskConfiguration>
<WillShowUI>OnError</WillShowUI>
<Disk wcm:action="add">
<DiskID>0</DiskID>
<WillWipeDisk>true</WillWipeDisk>
<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>SEVEN</Label>
<Letter>C</Letter>
<Order>1</Order>
<Active>true</Active>
<PartitionID>1</PartitionID>
</ModifyPartition>
</ModifyPartitions>
</Disk>
</DiskConfiguration>
<ImageInstall>
<OSImage>
<InstallTo>
<DiskID>0</DiskID>
<PartitionID>1</PartitionID>
</InstallTo>
<WillShowUI>OnError</WillShowUI>
<InstallToAvailablePartition>false</InstallToAvailablePartition>
</OSImage>
</ImageInstall>

Tested successfuly!

Image One Disk

Edited by myselfidem
Link to comment
Share on other sites

The first working Autounattend.xml file I was able to make was like yours but it didn't create the 100 MB System Reserved partition. This is my pc's disk configuration (installed manually) which has the 100 MB System Reserved partition: post-324407-0-96575300-1323176169_thumb.

I tried this xml:


<DiskConfiguration>
<WillShowUI>OnError</WillShowUI>
<Disk wcm:action="add">
<CreatePartitions>
<CreatePartition wcm:action="add">
<Extend>true</Extend>
<Type>Primary</Type>
<Order>2</Order>
</CreatePartition>
<CreatePartition wcm:action="add">
<Order>1</Order>
<Size>100</Size>
<Type>MSR</Type>
</CreatePartition>
</CreatePartitions>
<ModifyPartitions>
<ModifyPartition wcm:action="add">
<Active>true</Active>
<Format>NTFS</Format>
<Label>Win7Ent</Label>
<Letter>C</Letter>
<Order>2</Order>
<PartitionID>2</PartitionID>
</ModifyPartition>
<ModifyPartition wcm:action="add">
<Active>true</Active>
<Format>NTFS</Format>
<Label></Label>
<Order>1</Order>
<PartitionID>1</PartitionID>
<TypeID>e3c9e316-0b5c-4db8-817d-f92df00215ae</TypeID>
</ModifyPartition>
</ModifyPartitions>
<DiskID>0</DiskID>
<WillWipeDisk>true</WillWipeDisk>
</Disk>
</DiskConfiguration>

but it's a mix between BIOS and UEFI unattended file so I get this error:

post-324407-0-27136800-1323176561_thumb.

which means "Unable to set as active a partition on disk 0. The destination disk, partition or volume doesn't support the specified operation. The error occurred while applying the <DiskConfiguration> section of the answer file."

I also tried to set the TypeID in the ModifyPartition tag to 0x27 which means Utility Partition (the help says it's used for "Recovery tools such as Windows RE and other system utilities."), the resulting partition was hidden but didn't have the same attributes as the partition in the DiskOK.jpg picture.

I really have no idea how to recreate the 100mb partition that is automatically created while performing an attended setup and can't find any info about it...

Link to comment
Share on other sites

I suspected that but I gave it a shot anyway.

It seems there is no way to recreate the 100 mb partition the same way the attended setup creates it using the unattended setup. Either you don't create it at all or you create something that is not the same thing.

Link to comment
Share on other sites

I really have no idea how to recreate the 100mb partition that is automatically created while performing an attended setup and can't find any info about it...

Look at my first example above (and the image added)!

Again: attach your Autounattend.xml file, please (BIOS-Based system)!

Edited by myselfidem
Link to comment
Share on other sites

Thank you! I think I found out what was causing the misbehaviour:



<ImageInstall>
<OSImage>
<InstallToAvailablePartition>true</InstallToAvailablePartition>
<WillShowUI>OnError</WillShowUI>
</OSImage>
</ImageInstall>

I suppose that setting InstallToAvailablePartition to true caused the setup to try to install the OS in the 100MB System partition assigning it a letter and showing it in My computer.

With this xml instead,



<component name="Microsoft-Windows-Setup" processorArchitecture="x86" 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>100</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>
<Format>NTFS</Format>
<Label>System</Label>
<Order>1</Order>
<PartitionID>1</PartitionID>
</ModifyPartition>
<ModifyPartition wcm:action="add">
<Format>NTFS</Format>
<Label>Win7Ent</Label>
<Letter>C</Letter>
<Order>2</Order>
<PartitionID>2</PartitionID>
</ModifyPartition>
</ModifyPartitions>
<DiskID>0</DiskID>
<WillWipeDisk>true</WillWipeDisk>
</Disk>
</DiskConfiguration>
<UserData>
<AcceptEula>true</AcceptEula>
<Organization>Pippo</Organization>
</UserData>
<ImageInstall>
<OSImage>
<InstallToAvailablePartition>false</InstallToAvailablePartition>
<WillShowUI>OnError</WillShowUI>
<InstallTo>
<DiskID>0</DiskID>
<PartitionID>2</PartitionID>
</InstallTo>
</OSImage>
</ImageInstall>
</component>

it created both partitions leaving the 100MB hidden with the correct attributes like the DiskOK.jpg picture I posted before.

Thanks for the help!

Edited by Kiavik
Link to comment
Share on other sites

Thank you! I think I found out what was causing the misbehaviour:



<ImageInstall>
<OSImage>
<InstallToAvailablePartition>true</InstallToAvailablePartition>
<WillShowUI>OnError</WillShowUI>
</OSImage>
</ImageInstall>

I suppose that setting InstallToAvailablePartition to true caused the setup to try to install the OS in the 100MB System partition assigning it a letter and showing it in My computer.

Thanks for the help!

Yes! :whistle:

If you see carefully my examples above, you will see:

<InstallToAvailablePartition>false</InstallToAvailablePartition>

Enjoy!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...