Changes

Jump to: navigation, search
Creating a New Spanned Volume from the Command Prompt
== Creating a New Spanned Volume from the Command Prompt ==
 
As with shrinking partitions, Windows Server 2008 allows disk volumes and partitions to be exdtended from the command-line using the '''diskpart''' tool. Invoke this tool by typing ''diskpart'' at a command prompt or in a Run dialog box. The tool will start and display a ''DISKPART>'' prompt.
 
The first step is to identify the disks on the system. This information is obtained using the ''list disk'' command:
 
<pre>
DISKPART> list disk
 
Disk ### Status Size Free Dyn Gpt
-------- ---------- ------- ------- --- ---
Disk 0 Online 30 GB 0 B
Disk 1 Online 10 GB 0 B
</pre>
 
For the purposes of this tutorial we will once again be working on a partition on disk 1. To select the required disk use the ''select disk'' command:
 
<pre>
DISKPART> select disk 1
 
Disk 1 is now the selected disk.
</pre>
 
Having selected the disk the next step is to select the partition which is to be extended. To obtain a list of partitions on the selected disk the ''list partition'' command is used:
 
<pre>
DISKPART> list partition
 
Partition ### Type Size Offset
------------- ---------------- ------- -------
Partition 1 Primary 1000 MB 1024 KB
Partition 2 Primary 1000 MB 1001 MB
Partition 3 Primary 551 MB 2001 MB
Partition 0 Extended 7238 MB 3001 MB
Partition 4 Logical 1000 MB 3002 MB
Partition 5 Logical 6236 MB 4003 MB
</pre>
 
For this example we are going to extend parition 3 so need to select this partition using ''select partition'':
 
<pre>
DISKPART> select partition 3
 
Partition 3 is now the selected partition.
</pre>
 
With the appropriate disk and partition selected the next task is to decide on the amount by which the partition can be extended. The ''extend'' command be used in a number of different ways. For example, a partition may be extended by a specified number of Mb by using the ''size='' option. For example, to increase the size of a partition by 3Gb:
 
<pre>
DISKPART> extend size=3000
 
There is not enough usable free space on specified disk(s) to extend the
volume.
</pre>
 
Clearly, in this case, the disk does not have sufficient free space to fulfill our extension request. An alternative approach is to let diskart allocate all the available space to the selected partition. This avoids the need to know how space is actually available:
 
<pre>
DISKPART> extend
 
DiskPart successfully extended the volume.
</pre>
 
In the case of dynamic disks, the extend command can also be used to allocated disk space from other disk drives (a concept known as a spanned volume). In this case the ''disk='' directive must be specified as part of the extend command. For example to extend the currently selected partition (on disk 1) by 6Gb using space from disk 2:
 
<pre>
DISKPART> extend size=6000 disk=2
</pre>
 
More detailed information on dynamic disks and spanned volumes can be found in the chapter of this book entitled [[Creating and Managing Simple and Spanned Volumes on Windows Server 2008]].

Navigation menu