I'm at a loss here and need help creatiing a script that will create two partitions and assign a size to the first. The diskpart script used in the Kbox for creating one partition is:

select disk 0
clean
create partition primary
select partition 1
active
assign
exit

How can I modify this to create two and assign a size to the first partition?

Thanks.
Russ
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
You need to specify the size on your 'create par pri' line, otherwise the full size of the disk is used.

See here for further information from Microsoft.

Thanks,

Dunnpy
Answered 01/23/2012 by: dunnpy
Red Belt

Please log in to comment
0
Here's a template you can follow.

select disk 0
clean
create partition primary size=20480
select partition 1
active
assign letter=c
create partition primary
select partition 2
assign letter=Z
exit

This create a partition of 20 gigs.

To find the size 1024 * (number in gigs)
Answered 01/23/2012 by: dchristian
Red Belt

  • I am trying to do a similar thing but I want a small partition of 4000 and the second partition, the rest of the size. Here is my script

    select disk 0
    clean
    create partition primary size=4000
    select partition 1
    assign letter="D"

    create partition primary
    select partition 2
    assign letter="C"
    active
    exit

    My results are
    DiskPart succeeded in cleaning the disk
    DiskPart succeeded in creating the specified partition
    Partition 1 is not the selected partition
    Virtual Disk Service error:
    The specified drive letter is not free to be assigned.
  • I bet you the CD-ROM mounted as D: (it happens to me all the time!).

    What i usually do is assign a letter like Z (since i know its not being used).

    You can reassign the drive letter when you get into windows, using a post-install task.
  • after
    create partition primary (for the second partition)
    i get
    "No usable free extent could be found. It may be that there is insufficient free space to create a partition at the specified size and offset. Specify different size and offset values or don't specify either to create the maximum sized partition. It may be that the disk is partitioned using the MBR disk partitioning format and the disk contains either 4 primary partitions, (no more partitions may be created), or 3 primary partitions and one extended partition, (only logical drives may be created)."
    there are still 10GB in the disk so i suppose i have mbr. Any idea how to circumvent this ?
Please log in to comment
Answer this question or Comment on this question for clarity