Windows 7 / Getting Started

Using DiskPart to Create Striped, Mirrored, and RAID-5 Volumes

You can use the DiskPart command-line utility to create striped, mirrored, and RAID-5 volumes. To perform any of these tasks, first execute the following commands from an administrative command prompt:

Diskpart
List disk
Select disk=n
Convert dynamic

The List disk command returns the disk numbers on your computer that you use when entering the commands to create the desired volume. The Select disk command selects a disk you want to work with, and the Convert dynamic command converts the disk to a dynamic disk; repeat these two commands for each disk that needs to be converted to dynamic storage before beginning to create your volumes. To create a mirror, you actually add a mirror to an existing simple volume. Use the Select volume command to select the volume to be mirrored, and then use the following command:

Add disk=n [noerr]

In this command, n is the disk number of the disk to be added to the current simple volume and noerr enables a script containing this command to continue processing even if an error has occurred. To obtain disk numbers used in this command, use the List disk command.

Use the following command to create a striped volume:

Create volume stripe [size=size] disk=n[,n[,...]] [noerr]

In this command, size is the number of MB used in each disk for the striped volume and n is the disk number (repeat from 2 to 32 times for each disk in the striped volume). If you do not specify a size, the size is assumed to be that of the smallest disk in the array. For example, if you specify three disks with unallocated space of 300, 400, and 500 GB and do not specify a size, DiskPart uses 300 GB per disk for a total striped volume size of 900 GB.

Creating a RAID-5 volume is similar to that of creating a striped volume. Use the following command:

Create volume raid [size=size] disk=n[,n[,...]] [noerr]

The parameters have the same meaning; in this case, repeat the disk number from 3 to 32 times. For the same example with three disks with unallocated space of 300, 400, and 500 GB and which do not specify the size parameter, DiskPart uses 300 GB per disk for a total RAID-5 volume size of 600 GB.

[Previous] [Contents] [Next]