Difference between revisions of "Creating and Managing MBR Disk Partitions on Windows Server 2008 Basic Disks"
(→Shrinking a Partition from the Command Line) |
|||
Line 50: | Line 50: | ||
== Shrinking a Partition from the Command Line == | == Shrinking a Partition from the Command Line == | ||
− | In addition to the Disk Management interface, Windows Server 2008 allows disk volumes and partitions to be shrunk 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 | + | In addition to the Disk Management interface, Windows Server 2008 allows disk volumes and partitions to be shrunk 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: | The first step is to identify the disks on the system. This information is obtained using the ''list disk'' command: | ||
Line 71: | Line 71: | ||
</pre> | </pre> | ||
− | + | Having selected the disk the next step is to select the partition which is to be reduced in size. To obtain a list of partitions on the selected disk the ''list partition'' command is used: | |
<pre> | <pre> | ||
Line 120: | Line 120: | ||
− | The above screen lists any disks which are available to assign space to the partition being extended. In the case of dynamic disks space may be allocated from any disks available on the system. In the case of basic disks only space from the current disk are available. Since this is a basic disk the current disk drive is already placed in the ''Selected'' column. Define the amount of space to use for the volume extension using the ''Select the amount of space in Mb'' field. If the ''Next'' button is disabled it means that more space has been requested than is available on the disk. Reduce the size of the space until the ''Next'' button is enabled and click on it to proceed to the summary screen. Assuming the summary matches the | + | The above screen lists any disks which are available to assign space to the partition being extended. In the case of dynamic disks space may be allocated from any disks available on the system. In the case of basic disks only space from the current disk are available. Since this is a basic disk the current disk drive is already placed in the ''Selected'' column. Define the amount of space to use for the volume extension using the ''Select the amount of space in Mb'' field. If the ''Next'' button is disabled it means that more space has been requested than is available on the disk. Reduce the size of the space until the ''Next'' button is enabled and click on it to proceed to the summary screen. Assuming the summary matches the requirements of the extension click on ''Finish'' to extend the volume. |
+ | |||
+ | == Extending a Partition from the Command Line == | ||
+ | |||
+ | 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. In this case the ''disk='' directive must be specified as part of the extend command. For example to extend the currently selected partition by 6Gb using space from disk 2: | ||
+ | |||
+ | <pre> | ||
+ | DISKPART> extend size=6000 disk=2 | ||
+ | </pre> |
Revision as of 15:54, 16 July 2008
The previous chapter looked at the two different disk partition styles (MBR and GPT) supported by Windows Server 2008 and the steps necessary to perform a diswk initialization. Once the initialized, the next step is to create the partitions or volumes on the disk and then format them with the appropriate file systems type (FAT, FAT32 or NTFS).
In this chapter we will cover the steps involved in creating partitions and assigning drive letters and mount points on a basic disk initialized with the MBR partition style. The chapter will then cover management topics such as shrinking and extending existing partitions and volumes. For details on performing these tasks on a GPT basic disk read the chapter entitled Creating and Managing GPT Disk Partitions on Windows Server 2008 Basic Disks.
Creating Partitions on an MBR Basic Disk
As described in Adding New GPT and MBR Disks to Windows Server 2008 Systems a basic disk initialized with the MBR partition style can support either four primary partitions or three primary partitions and one extended partition. The extended partition can, in turn, be divided into multiple logical drives.
New volumes are created using the Disk Manager. This can be accessed either from the Server Manager or Computer Management tools. To launch the Server Manager open the Start menu and click on the Server Manager option, or click on the Server Manager icon in the task bar. Alternatively launch Computer Management from Start -> All Programs -> Administration Tools -> Computer Management. When creating new volumes on an MBR disk the first three volumes created will be configured as primary partitions. The fourth partition created will be configured as an extended partition with the first logical drive created as the size requested for the fourth volume. Any available space left in the extended partition after the fiest logical drive has been created will be marked as Free Space and may be used to create additional logical drives within the extended partition.
To begin the partitioning process right click on the Unallocated or Free Space area of the appropriate drive in the graphical section of Drive Manager screen and select New Simple Volume.... This will launch the New Simple Volume Wizard.... Click Next on the initial screen to proceed to the Specify Volume Size screen as illustrated below:
On this screen enter the size of the volume to be created. The screen shows the maximum and minimum allowed sizes. If you only need one partition use the maximum. Once the size has been defined, click Next to configure the drive letter or mount point. The wizard will allocate the next available drive letter to the new volume. If this is not acceptable, select another drive letter from the drop down list. Alternatively, to have the volume mounted in a folder use the Browse button to locate, or create a suitable empty folder in the file system where the new volume will be accessible. The wizard also provides the option to leave the new volume unassigned at this point. Note that these settings may be changed at a later time by right clicking on the volume in graphical view and selecting Change Drive Letter and Paths from the popup menu. The Assign and Drive Letter or Path screen is shown below:
Click the Next button to proceed to the Format Partition screen. On this screen a number of choices are available in terms of the type of file system to be created on the new volume. These options consist of FAT, FAT16 and NTFS. FAT volumes have a maximum size of 4GB and a file size limit of 2GB. FAT32 file systems have a maximum volume size of 32Gb with a file size limit of 4GB. NTFS volumes can be up to 2TB on an MBR disk and 18 Exabytes (EB) on GPT disks. NTFS is recommended unless FAT or FAT32 is specifically required. FAT and FAT32, for example, do not support many of the file system security or compression features inherent in NTFS.
The Allocation unit size value value specifies the file system cluster size. In general the default setting for this value is the preferable choice, although a smaller value may be useful in situations where the volume is intended to store large quantities of small files. If selected, the Quick Format option will cause the format to be performed without any error checking. The Enable file and folder compression option dictates whether the data stored in the volume is to be compressed to maximize use of space. This option is only available for NTFS volumes.
Click on the Next button to proceed to the summary screen. Assuming the settings are satisfactory, click on Finish to begin the formatting process. The wizard will close and the disk in the graphical display will show the new volume as a primary volume and show the progress of the formating process.
Once the process is completed the disk will be ready for use. To create additional volumes, repeat the above steps. When the fourth volume is created the wizard will create it as an extended volume and all subsequent volumes will be created as logical drives within the extended partition. For example, the following figure shows Disk 1 with three primary partitions (E, F and G) and one extended partition containing two logical drives (H and I):
Shrinking a Partition Using Disk Management
The partitions on an MBR disk may shrunk to a smaller size using the Disk Management snap-in. This can be accessed either from the Server Manager or Computer Management tools. To launch the Server Manager open the Start menu and click on the Server Manager option, or click on the Server Manager icon in the task bar. Alternatively launch Computer Management from Start -> All Programs -> Administration Tools -> Computer Management.
Within Disk Management right click on the volume to that needs to be resized and select Shrink Volume... from the popup menu to invoke the Shrink dialog as shown below:
Specify the amount by which the volume is to shrink and click on the Shrink button to initiate the resize.
Shrinking a Partition from the Command Line
In addition to the Disk Management interface, Windows Server 2008 allows disk volumes and partitions to be shrunk 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 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 reduced in size. 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 998 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 shrink 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 identify the amount by which the partition can be reduced. To aid in this calculation the diskpart shrink query max command is used:
DISKPART> shrink querymax The maximum number of reclaimable bytes is: 448 MB
As indicated in the above output, the partition may be reduced in size by a total of 448Mb. To perform the size reduction the shrink desired command is used:
DISKPART> shrink desired 447 DiskPart successfully shrunk the volume by: 447 MB
The partition has now successfully been reduced in size.
Extending a Partition Using Disk Management
In addition to shrinking partitions, the Disk Management interface also provide the ability to extend a partition to make use of otehrwise unallocated free space on a disk. To extend a volume, right click on the volume in the graphical view of the Disk Management screen and select Extend Volume... to invoke the Extend Volume Wizard. Click next on the welcome screen to proceed to the disk selection process shown below:
The above screen lists any disks which are available to assign space to the partition being extended. In the case of dynamic disks space may be allocated from any disks available on the system. In the case of basic disks only space from the current disk are available. Since this is a basic disk the current disk drive is already placed in the Selected column. Define the amount of space to use for the volume extension using the Select the amount of space in Mb field. If the Next button is disabled it means that more space has been requested than is available on the disk. Reduce the size of the space until the Next button is enabled and click on it to proceed to the summary screen. Assuming the summary matches the requirements of the extension click on Finish to extend the volume.
Extending a Partition from the Command Line
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. In this case the disk= directive must be specified as part of the extend command. For example to extend the currently selected partition by 6Gb using space from disk 2:
DISKPART> extend size=6000 disk=2