Overview
The default templates and samples that are included with ADS create only one partition. When you deploy an image to a computer by using ADS, you may want to create more than one partition in certain scenarios. For example, you may want to install the operating system on drive C and store program data on drive D. This article describes how to use Bmpart.exe to create multiple partitions on a computer when the Deployment Agent is running on the computer.Use Bmpart.exe to Create Multiple Partitions
The Deployment Agent uses Bmpart.exe to create partitions. You can use the following parameters with Bmpart.exe:- DeviceName: Use this parameter to specify the device name -- for example, \device\harddiskX\Partition0, where X is the number of the hard disk that you want to create the partition on.
- /init: Use this parameter to initialize the master boot record (MBR) on the hard disk.
- /t:Type: Use this parameter to specify the type of partition that you want to create. Use this parameter only when you create an original equipment manufacturer (OEM) partition. If you use this parameter, it must be specified before the /c parameter.
- /c:Size: Use this parameter to specify the size, in megabytes (MB), of the partition that you want to create. If you omit this parameter, Bmpart.exe uses the remaining free space on the hard disk to create the partition.
- /a: Use this parameter to set a partition as the active partition.
Note The following example demonstrates how to create two partitions, and it assumes that you want to install the operating system on drive C (the first partition of HardDisk0) and store program data on drive D (the second partition of HardDisk0).
- Create the first partition on HardDisk0.
- Initialize the master boot record (MBR).
- Set the size of the partition to 5 gigabytes (GB).
- Set the partition as the active partition.
- Create the second partition on HardDisk0.
- Use the remaining free space on the hard disk to create the partition.
- Do not set the partition as the active partition.
<task description="Partition Disk- create first partition" doesReboot="false"> <command>/BMONITOR/bmpart.exe</command> <parameters> <parameter>\device\harddisk0\partition0</parameter> <parameter>-init</parameter> <parameter>-c:5000</parameter> <parameter>-a</parameter> </parameters> </task> <task description="create 2nd partition using rest of disk 0" doesReboot="false"> <command>/BMONITOR/bmpart.exe</command> <parameters> <parameter>\device\harddisk0\partition0</parameter> <parameter>-c</parameter> </parameters> </task>
- In the example provided earlier in this article, the DeviceName parameter uses \device\harddisk0\partition0 for both partitions. Note that a device name of \device\harddisk0\partition1 is not used to create the second partition. The DeviceName parameter, \device\harddisk0\partition0, refers to the whole hard disk.
Bmpart.exe creates the partition in the next available raw space on the hard disk. You use a device name other than \device\harddisk0\partition0 only when you start copying the image to each partition. At this point, the tasks refer to either \device\harddisk0\partition1 or \device\harddisk0\partition2, as appropriate to the contents of the image. - The /init parameter is used only for the first partition that is created on the hard disk. You cannot use this parameter with other partitions except for the first partition that you create.
Best Practice Methods
The following are best practice methods to use when you create multiple partitions by using Bmpart.exe:- Create partitions under the Deployment Agent where you want to deploy the images. Note that Bmpart.exe only creates the partition. Bmpart.exe does not create the underlying file system for the partition. The image that is deployed to the partition contains the file system.
- If you want to automatically create the partitions for the operating system, you may want to use the Diskpart.exe command-line tool. For more information about Diskpart.exe, visit the following Microsoft Web site: