Multiple Partitions in BDD 2007

Have had a couple of requests to cover creating multiple partitions using BDD 2007. By default BDD 2007 creates a single partition (C:) that then builds out with your required OS and applications via the task sequencer. The partition and format information is not done by the unattend.xml file (WinPE section) as you might expect, but via ZTIDiskpart.wsf. This script uses ZTIDiskpart.txt to describe how the drive should be wiped, re-partitioned and formatted.

The default ZTIDiskpart.txt use DiskPart commands and looks like this:


select disk 0

clean

create partition primary

assign letter=c:

active

exit

In the default settings, the first disk (disk 0) is selected and then cleaned (wiped). A primary partition is then created (using all available space) and assigned drive letter C: The partition is then set as active. ZTIDiskpart.wsf takes care of formatting this single partiton.

To have the ZTIDiskpart.wsf script apply different settings (in this case - create two partitons on the same disk) then we can edit ZTIDiskpart.txt as follows:

select disk 0

clean

create partition primary size=20000

assign letter=c:

active

create partition primary

assign letter=d:

format FS=NTFS QUICK

exit

In this example, the first disk is selected (disk 0) and cleaned as it was in the default script. A primary partition of 20GB is then created (specified in MBs) assigned letter C: and made active. A second partition is then created (by not specifying a size on this second entry, all remaining available space is used) and assigned letter D: This partition is then formatted with NTFS using the QUICK switch (ZTIDiskpart.wsf will take care of formatting the C: drive, however it won't format the second partition, so we include a command for this in ZTIDiskpart.txt)

There is however a gotcha...The allocation of drive letters from within the Windows PE environment doesn't carry over to the installed operating system if you are trying to create partitons on different physical disks. When the operating system has finished installing, the disk letters can be out of sync. To enable the ZTIDiskpart.wsf script to correctly add drive letters and create two partitions on different disks (usefull if using BDD 2007 to create server builds), use the


Select disk 0

Create partition primary

Assign letter=c:

Active

Select disk 1

Create partition primary

Assign

Exit

The key to this working is that no letter is assigned to the second partition (that will be created on the 2nd disk). When the operating system starts you will find that D: will be assigned to the second disk by the OS.

 

I am greatful (as ever) to Ben Hunter and Michael Niehaus for their input and guidance :-)