Поделиться через


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 :-)

Comments

  • Anonymous
    January 01, 2003
    The comment has been removed

  • Anonymous
    January 01, 2003
    Is there any how to keep one of partitions on disk 0? I would like to distribute OS on one partition (lets say 20GB) and then keep partition D with user's data. Any suggestions? Thank you very much. Mike

  • Anonymous
    January 01, 2003
    The comment has been removed

  • Anonymous
    January 01, 2003
    WinPE starts from CDROM and keeps "d:" for it  regardless "Assign letter=D:" for the second partition in the script. Actually diskpart fails and BDD stops with error in Task Sequence. I am not sure if there is any way to start WinPE with any different letter. Any idea? -Alex

  • Anonymous
    January 01, 2003
    How can I partition using percentage?  I would like to do 70% C: and 30% D:.  I have different computers and different hdd sizes so would like to make it a consistant formula.  thanks

  • Anonymous
    January 01, 2003
    PingBack from http://blog.sebastian-foss.com/2007/07/22/multiple-partitions-in-bdd-2007/