Using Diskpart to manage disks under Windows Server 2008

  

One of the features of Windows Server 2008 is that many aspects of the operating system can be managed from the command line. If we need to define a RAID array on a computer with a GUI interface, it is usually easier to implement, and the disk management console program can complete the installation operation with a few clicks of the mouse.

If you need to perform the same RAID operation on multiple machines, the scripting method will be more efficient. Similarly, if we are doing a Server Core installation, there is no other option but to manage our own disk subsystem from a command prompt. In this article, we'll show you how to implement the functionality mentioned above using the command line.


Windows Server 2008 includes a command line utility called Diskpart.exe that manages the server's disk subsystem. To use this command, simply open a command prompt window and enter the DISKPART.EXE command, Windows will enter the Diskpart Shell interface. In the Diskpart Shell interface, various commands can be used to manage the disk subsystem.


The Diskpart command format, according to the verb-noun syntax. The verb tells Windows what action to perform, and the noun tells Windows which object to perform the action on.

For a simple example: the "List Disk" command. Where List is a verb and Disk is a noun. When you enter this command, the operating system displays all the physical disks listed on the server. As shown in Figure 1.


Figure 1: List Disk Command Execution Results

The List Disk command displays all the disks installed on the server. But Diskpart seems to have a bug: In the value of the above figure, the result of Diskpart returns that the available space on Disk 0 is 0 bytes. But in fact, the disk has 42 GB of free space.

Note the above values, each disk is assigned a disk number. When we need to perform a specific operation on a particular disk, we can specify the disk by entering the "select" command. For example, if you want to operate on Disk 0, type "select Disk 0" to select Disk 0.
Previous 12 Next Read more

Copyright © Windows knowledge All Rights Reserved