Diskpart script to create 2 partitions
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
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
Answers (2)
Please log in to answer
Posted by:
dunnpy
12 years ago
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
See here for further information from Microsoft.
Thanks,
Dunnpy
Posted by:
dchristian
12 years ago
Here's a template you can follow.
This create a partition of 20 gigs.
To find the size 1024 * (number in gigs)
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)
Comments:
-
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. - jfrasier 12 years ago -
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. - dchristian 12 years ago -
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 ? - c01d4x 10 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.