Creating and Managing Simple and Spanned Volumes on Windows Server 2008

From Techotopia
Revision as of 15:40, 21 July 2008 by Neil (Talk | contribs) (Creating a New Spanned Volume from the Command Prompt)

Jump to: navigation, search

So far in this book we have worked primarily with basic disks. Simple and spanned volumes in Windows Server 2008 take advantage of a concept known as dynamic disks. In this chapter of Windows Server 2008 Essentials the topic of using dynamic disk support to create both simple and spanned volumes on Windows Server 2008 system will be covered in detail.


Contents


An Overview of Dynamic Disks

As covered in the preceding chapters, basic disks allow partitions to be created on a physical disks which are subsequently formatted with a particular file system and then used to store data. Whilst the partitions on a basic disk can be increased in size this can be achieved within the confines of the space available on the physical disk on which they reside.

Dynamic disks bring significantly more flexibility into the creation and management of volumes both in terms of space management, performance and redundancy. There are five types of dynamic volume which can be created through the use of dynamic disks:

  • Simple Volume - The equivalent of a partition on a basic disk. A simple volume must reside on a single disk and cannot be extended beyond the space available on that disk.
  • Spanned Volume - A spanned volume can span multiple physical disk drives or be comprised of multiple, non-contiguous volumes on a single disk drive. Spanned volumes avoid many of the limitations inherent in simple volumes.
  • Striped Volume - Also referred to as RAID 0, disk striping involves splitting data into multiple parts and writing each part to a different disk drive (a process which is reversed when the data is read back). The disks involved in this process are referred to as a stripe set. The key purpose of striping is to increase disk performance.
  • Mirrored Volume - Also referred to as RAID 1, disk mirroring involves writing the same data to two drives such that if one drive fails an exact copy of the data is available on the second disk. The primary purpose of disk mirroring is data redundancy and disaster recovery.
  • RAID 5 Volume - RAID 5 is a variation of volume striping. With RAID 5 striping is used in conjunction with parity error checking such that the data can continue to be used in the event that one of the drives fails. The parity information can also be used to restore data in the event of a failure using a technique known as regeneration. RAID 5 requires 3 or more disks and is designed to provide fault tolerance.

Converting Basic Disks to Dynamic Disks with Disk Management

Windows Server 2008 allows basic disks to be converted to dynamic disks using the Disk Management interface. Before covering the steps to perform such a conversion there are a number of rules which need to be observed.

In the first instance, MBR disks must have at least 1Mb of free space at the end of the disk where the dynamic disk database will be stored. Both Disk Management and diskpart allocate this space automatically so this will only be a problem if the disk was partitioned using a third party tool or a n oder version of Windows.

GPT disks can only be converted if they have contiguous, Windows compatible partitions. It is not, for example, possible to convert a basic GPT disk containing one or more Linux partitions to a dynamic disk.

Finally, basic disks with sector sizes in excess of 512 bytes cannot be converted to dynamic disks.

Assuming that the above requirements are met, the first step is to open the Disk Management interface. This can be achieved by running compmgmt.msc in command prompt window or Run dialog and selecting Storage -> Disk Management.

To perform the conversion simply right click on the icon for the drive in question and select Convert to Dynamic Disk... from the popup menu. This will invoke the Convert to Dynamic Disk dialog shown below:


Converting a basic disk to a dynamic disk


As shown in the above figure all drives eligible for conversion are listed. Select the disk to be converted and click on OK. In teh resulting dialog a list of drive scheduled for conversion is displayed. To view the volumes on a drive, select the drive in the list and click on details:


Displaying the volumes on a drive to be converted


Click on Convert to initiate the conversion process. Once completed, the drive will appear as a dynamic drive in the Disk Management interface.


Converting Basic Disks to Dynamic Disks from the Command Line

Basic disks can also be converted to dynamic disks at the command prompt using the diskpart tool. Type diskpart at the command prompt or in a Run window to invoke the tool. Once started a DISKPART> prompt will be displayed.

The first step is to identify the disks on the system. This information is obtained using the list disk command:

DISKPART> list disk

  Disk ###  Status      Size     Free     Dyn  Gpt
  --------  ----------  -------  -------  ---  ---
  Disk 0    Online        30 GB      0 B
  Disk 1    Online        10 GB      0 B

For the purposes of this tutorial we will be working on on disk 1. To select the required disk use the select disk command:

DISKPART> select disk 1

Disk 1 is now the selected disk.

With the disk selected the conversion can be performed simply by using the convert command:

DISKPART> convert dynamic

DiskPart successfully converted the selected disk to dynamic format.

Creating a New Spanned Volume using Disk Management

A new spanned volume can easily be created using the Disk Management interface. For the purposes of this chapter we will be creating a spanned volume which spans two physical disk drives. In this example we will work with a system containing three disk drives. Disk 0 is the system drive containing the Windows Server 2008 operating system. Disks 1 and 2 are both initialized using the MBR partition style and have been converted to dynamic disks but have yet to have any volumes created on them. The objective of this tutorial is to create a spanned volume which uses the entire capacity of disks 1 and 2.

Assuming that the Disk Management snap-in is currently running, right click on the first disk drive and select New Spanned Volume... from the popup menu. This will invoke the New Spanned Volume Wizard. Click Next on the welcome screen to proceed to the disk selection screen as illustrated in the following figure:


Selecting the disks for a Windows Server 2008 Spanned Volume


This screen provides the option to select disk drives from which the spanned volume is to be constructed. By default, only the drive on which the new volume is being created is listed. Consequently, the Maximum available space value reflects only the space available on the current disk. In this example, however, the volume is going to span both disks 1 and 2. To enable this we need to select disk 2 from the left hand list of available disks and click on Add>> to add to to the selected disks. Having done so the amount of space from each drive may be selected up to the maximum combined space from both disks:


Two disks selected for a Windows Server 2008 Spanned Volume


With the desired total volume size configured by selecting each drive and selecting the amount of space top be allocated the Next button may be pressed to move the drive letter or mount point allocation screen. Select either a suitable drive letter or mount point and click on Next to proceed. Finally, select the file system format and disk compression options and once again click Next to proceed to the summary screen. To initiate the creation of the volume click on Finish. After a short delay the Disk Management graphical view will show the volume being formatted on both drives. When completed the spanned volume is ready for use.

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:

DISKPART> list disk

  Disk ###  Status      Size     Free     Dyn  Gpt
  --------  ----------  -------  -------  ---  ---
  Disk 0    Online        30 GB      0 B
  Disk 1    Online        10 GB      0 B

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:

DISKPART> select disk 1

Disk 1 is now the selected disk.

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:

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

For this example we are going to extend parition 3 so need to select this partition using select partition:

DISKPART> select partition 3

Partition 3 is now the selected partition.

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:

DISKPART> extend size=3000

There is not enough usable free space on specified disk(s) to extend the
volume.

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:

DISKPART> extend

DiskPart successfully extended the volume.

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:

DISKPART> extend size=6000 disk=2

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.