Disk Management
Disk management
activities are performed using the cleverly named Disk Management
snap-in, which is part of the Computer Management console. Open the Disk
Management snap-in in the Computer Management console, or add the
snap-in to a custom console.
Tip
There
is a stand-alone Disk Management console, but it is not visible in your
Administrative Tools folder. Click Start, choose Run and type diskmgmt.msc to open the stand-alone console. |
Disk Management can
manage disk storage on local or remote systems. The snap-in does not
manipulate disk configuration directly; rather, it works in concert with
Dmadmin, the Logical Disk Manager Administrative Service that is
started on the computer you are managing when you start the Disk
Management snap-in.
The Disk Management interface is shown in Figure 1.
The top frame—the list view—displays information about each partition,
logical drive, or volume. The bottom frame—the graphical view—depicts
disk space allocation per physical disk, as perceived by Windows Server
2003. You can right-click the volumes in either frame to access a
shortcut menu to format, delete, or assign a drive letter to the volume.
If you right-click an area of unallocated disk space, you can create a
partition or volume. By right-clicking the disk drive’s status box, on
the left of the disk’s graphical view, you can initialize a new disk,
convert between basic and dynamic disks, and access the disk’s hardware
properties dialog box.
Configuring Disks and Volumes
Configuring storage entails the following steps:
1. | Physically installing the disk(s).
|
2. | Initializing the disk.
|
3. | On a basic disk, creating partitions and (if an extended partition) logical drives or, on a dynamic disk, creating volumes.
|
4. | Formatting the volumes.
|
5. | Assigning drive letters to the volumes, or mounting the volumes to empty folders on existing NTFS volumes.
|
You must be a member of
the Administrators or Backup Operators group, or have been otherwise
delegated authority, to perform these tasks, although only
administrators can format a volume.
Installing the Disk
To
add a new disk to a computer, install or attach the new physical disk
(or disks). Open Disk Management and, if the drive has not been detected
automatically, right click the Disk Management node and choose Rescan
Disks. If a system must be taken offline to install a new disk, restart
the computer, then open Disk Management. If the new disks are not
automatically detected, rescan the disks.
Initializing the Disk
When you add a disk to a
server, you will need to initialize that disk before you can begin to
allocate its available space to partitions, logical drives, and volumes.
Initializing a disk allows the operating system to write a disk
signature, the end of sector marker (also called signature word), and an
MBR or globally unique identifier (GUID) partition table to the disk.
If you start the
Disk Management console after installing a new disk, the Initialize Disk
Wizard will appear automatically. To initialize a disk manually using
Disk Management, right-click the disk’s status box and choose Initialize
Disk.
Note
On
an Itanium computer, you will be prompted to select the partition
style. Itanium computers containing multiple disks support two partition
styles, GUID partition table (GPT) and MBR. The system partition on an
Itanium computer uses the Extensible Firmware Interface (EFI) and the
GPT partition style to support the 64-bit editions of the Windows Server
2003 family. More information about GPT partitions and EFI can be found
in the Help And Support Center. |
Creating Partitions and Volumes
After you have initialized the disk, you can begin to implement a storage structure of partitions, logical drives, or volumes.
A newly initialized
disk is configured by default as a basic disk. If you wish to maintain
the disk as a basic disk, you can divide the basic disk into primary and
extended partitions by right-clicking unallocated space and choosing
New Partition. If you choose to create a primary partition, the
partition becomes a logical volume. After creating an extended
partition, right-click the partition again and choose New Logical Drive.
As you’ll remember from earlier discussions, logical drives are logical
volumes on an extended partition.
If
you want to configure the disk as a dynamic disk, right-click the
disk’s status box in Disk Management and choose Convert To Dynamic Disk.
You can then right-click the unallocated space on the disk and choose
New Volume. The New Volume Wizard will step you through the creation of
supported volume types. The Select Volume Type page of the wizard is
shown in Figure 2.
You can convert an existing basic disk to a dynamic disk—a solution that will be discussed later in this lesson.
Formatting Volumes
Windows Server 2003
supports three file systems: FAT, FAT32, and NTFS. Let’s keep this
discussion simple: use FAT or FAT32 only when you have very specific
reasons for doing so. Only NTFS gives you the level of stability,
resiliency, scalability, flexibility and security required by most
organizations. Many core components of Windows Server 2003, such as file
security, and services, including Active Directory and Remote
Installation Services (RIS), require NTFS. All advanced storage
management tasks, including multidisk volumes and disk quotas require
NTFS. If you think you need FAT32, think again, then think again.
Assigning Drive Letters or Mounting Volumes
When you create a
volume, it defaults to the next available drive letter. The New Volume
Wizard and New Partition Wizard give you a chance to specify an
alternative representation for the new logical volume. You can also
right-click an existing volume and choose Change Drive Letter and Paths.
A
volume can be represented by only one drive letter, though you can
configure a volume to have no drive letter. However, you can mount a
volume in one or more empty folders on local NTFS volumes. In the Change
Drive Letter And Paths dialog box, you can click Remove or Change to
delete or modify an existing drive letter or folder mounting for the
volume.
Note
You cannot change the drive letter of the volume that is a system partition or boot partition. |
Click Add to add a drive letter or mount point. Figure 3
shows a server in which the Docs folder on the X drive is a mount point
to another volume. Note that the folder appears in the Explorer
namespace exactly where it should, but displays a drive volume icon.
When a user navigates to that folder, the user is transparently
redirected to the volume.
Mounting a volume in a
folder on an existing volume effectively increases the target volume’s
size and free space. You can mount volumes regardless of whether the
volumes involved are on basic or dynamic disks, and regardless of what
type of volume they are. But the empty folder, the path of which becomes
the path to the mounted volume, must reside on an NTFS volume. The
mounted volume can, technically, be formatted as FAT or FAT32, but of
course that is not the best practice.
Extending Volumes
Another way to
increase a volume’s capacity is to extend the volume. You can extend a
simple or spanned volume on a dynamic disk so long as that volume is
formatted as NTFS, and so long as the volume is not the system or boot
volume. Right-click the volume and click Extend Volume. Follow the
Extend Volume Wizard’s instructions screen to select unallocated space
on dynamic disks on which to extend the existing volume. If you extend a
simple volume onto space on another physical disk, you create a spanned
volume.
You
can extend a partition on a basic disk using the DISKPART command. The
basic partition must be formatted as NTFS, must not be the system or
boot partition, and must be extended onto immediately contiguous space
on the same physical disk that is either unallocated and unformatted, or
formatted with NTFS.
Moving Disks Between Servers
It is possible to move
disks between computers. If, for example, you plan to take a server
offline, you might attach its physical disks to another server so that
data can continue to be accessed. The process for doing so is the
following:
1. | Check
the health of the disk while it is in the original server. It is
recommended to open Disk Management and confirm that the disk status
displays Healthy before moving the disk. If the disk is not healthy,
repair the disk.
|
2. | Uninstall
the disk in the original computer. If the original server is online,
uninstall the disk by right-clicking the disk in Device Manager and
choosing Uninstall.
|
3. | Remove
a dynamic disk correctly. If the original server is online, open Disk
Management, right-click the dynamic disk and choose Remove. This step is
not necessary or possible with basic disks.
|
4. | Physically
detach the disk. If the computer supports hot-swapping the drive, you
may remove the drive. Otherwise, shut down the computer to remove the
physical disk.
|
5. | Attach
the disk to the target server. Open Disk Management and, if the drive
has not been detected automatically, right click the Disk Management
node and choose Rescan Disks. Otherwise, shut down the target server
before adding the physical disk.
|
6. | Follow
instructions in the Found New Hardware Wizard. If the wizard does not
appear, open Device Manager and see if the drive was detected and
installed automatically. If not, open Add Hardware from Control Panel.
|
7. | Open Disk Management. Right-click Disk Management and choose Rescan Disks.
|
8. | Right-click
any disk marked Foreign and choose Import Foreign Disks. Importing a
disk reconciles the LDM databases on a new dynamic disk with the
existing disks.
|
Some important notes about moving physical disks:
If an
imported disk contains volumes that span to other physical disks, you
must attach and import all physical disks before the volumes can be
accessed.
If you
move drives from several computers to a single computer, move all drives
from one computer before beginning to move drives from the next
computer.
A
basic volume that is moved to a new computer receives the next
available drive letter. Dynamic volumes retain the drive letter they had
on the original computer. If a dynamic volume did not have a drive
letter on the previous computer, it does not receive a drive letter when
moved to another computer. If the drive letter is already used on the
computer where they are moved, the volume receives the next available
drive letter.
Use
the Mountvol /n or the DISKPART automount commands to prevent new
volumes from being automatically mounted and assigned a drive letter. If
these commands have been used, when you add a new disk you must
manually mount the volumes and assign drive letters or paths.
Converting Disk Storage
You can convert a basic
disk to a dynamic disk. If the disk already contains partitions and
logical drives, those units will be converted to the equivalent units
for a dynamic disk: simple volumes. The structure of data on the disk is
not modified, so it is possible to convert a basic disk that already
contains data, although it is always best practice to back up volumes
before performing disk management tasks.
To convert a basic
disk to a dynamic disk, right-click the disk’s status box and choose
Convert To Dynamic Disk. It’s that simple. If you convert a disk that
contains a system or boot partition, the computer must restart.
Tip
Do
not convert basic disks to dynamic disks if they contain multiple
operating systems (for example, the disk is set up to dual-boot with
another operating system). After the disk is converted to dynamic, you
can start the operating system that you used to convert the disk, but
you will not be able to start the other operating systems on the disk. |
Unfortunately, the reverse
process is not as straightforward. Converting back to basic storage
wipes out data on the drive. So you must first back up all data on the
disk. Then you must delete all existing volumes on the dynamic disk
before right-clicking the disk’s status box in Disk Management and
choosing Convert To Basic Disk. After recreating partitions and logical
drives, restore the data onto the disk. Although you can convert from
dynamic to basic from a technical perspective, you are actually wiping
out the disk and starting over.
Performing Disk Management Tasks from the Command Prompt
Windows Server 2003 provides command-line alternatives for disk management, including the following:
Chkdsk Scan a disk for errors and, optionally, attempt to correct those errors.
Convert Convert a volume from FAT or FAT32 to NTFS.
Fsutil Perform a variety of tasks related to managing FAT, FAT32, or NTFS volumes.
Mountvol Manages mounted volumes and reparse points.
But the granddaddy of disk management command-line tools is DISKPART. Table 1
summarizes the DISKPART commands that achieve common disk management
tasks. Diskpart can be used interactively or can call a script. To start
Diskpart interactively, type diskpart at the command prompt. When the Diskpart command prompt (DISKPART >) appears, type ?
at any time for help. The command’s built-in documentation will appear
automatically when needed to help you achieve the tasks you perform.
Diskpart is also well documented in the Help And Support Center.
Table 1. How to Complete Common Disk Management Tasks from the Command Prompt
Task | From DISKPART> | Description |
---|
List disk, partition, and volume information | list disk list partition list volume | The
first command lists disk information, the second command lists
partition information for the current disk, and the third command lists
volume and partition information for all disks. |
Create a simple volume | create volume simple size=500 disk=2 | Typed on one line, this taks creates a simple volume 500 MB in size on disk 2. |
Assign a drive letter | select volume 4 assign letter j | Assigns volume 4 as the J drive. |
Extend a simple volume | select volume 4 extend size=250 disk=2 | Extends simple volume 4 (on disk 2) with an additional 250 MB on the same disk. |
Create a spanned volume | select volume 4 extend size=250 disk=1 | Spans a simple volume 4 (on disk 2) with an additional 250 MB on disk 1. |
Delete a spanned volume | select volume 4 delete volume | Deletes
spanned volume 4. If volume 4 was contained on disk 1 and disk 2, the
space it occupied on the two disks becomes unallocated. |
Create a volume mount point | select volume 4 assign mount=e:\Folder1 | Assigns a volume mount point to volume 4 that is accessed from E:\Folder1. |
Create a striped volume | create volume stripe size=500 disk=1,2 | Typed on one line, this task creates a striped volume which uses 500 MB on disks 1 and 2 for a total of 1 GB of storage space. |
Create a mirrored volume | create volume simple size=00 disk=1 add disk 2 | Typed
on one line, this task creates a mirrored volume which uses 500 MB on
disks 1 and 2 for a total of 500 MB of fault-tolerant storage space. |
Break a mirror | select volume 5 break disk 2 | Selects the mirror on volume 5 and break the mirror on disk 2. |
Remove a mirror | break disk 2 nokeep | Deletes a mirror and remove the previously mirrored data on disk 2. |
Create a RAID-5 stripe | create volume raid size=500 disk=1,2,3 | Typed
on one line, this task reates a RAID-5 volume which uses disks 1, 2,
and 3 for a total of ~1 GB of fault-tolerant storage space. |
Convert a disk from basic to dynamic storage | select disk 2 convert dynamic | Converts disk 2 from basic storage to dynamic storage. |
Convert a disk with unallocated space from dynamic to basic storage | select disk 2 convert basic | Converts disk 2 from dynamic to basic. |
Practice: Configuring Disks and Volumes
In this practice,
you will use the Disk Management snap-in and Diskpart to perform a
variety of disk-management tasks on Disk 0. Disk 0 must be configured as
a basic disk and contain at least 1 GB of unallocated space to complete
this exercise.
Exercise 1: Creating a Partition Using the Disk Management Snap-in
1. | Log on to Server01 as Administrator and open the Disk Management snap-in in the Computer Management console.
The Volume list appears in the upper pane and the graphical view appears in the lower pane.
|
2. | In
the graphical view, right-click the unallocated disk space on Disk 0
and choose New Partition. The New Partition Wizard appears.
|
3. | Create
a Primary Partition that is 250 MB. Accept the default drive letter
assignment. Label the volume Data_Volume and perform a quick format
using NTFS.
After a few moments, a new drive named Data_Volume (drive_letter:) appears, where drive_letter
is the letter that the New Partition Wizard assigned to the partition.
When formatting is complete, the status of the partition displays
Healthy.
|
Exercise 2: Converting a Disk from Basic to Dynamic Storage from the Disk Management Snap-In
1. | In
Disk Management, right-click Disk 0’s status box in the graphical view
and click Convert To Dynamic Disk. The Convert To Dynamic Disk dialog
box appears and the Disk 0 check box is selected.
|
2. | Follow the prompts to convert Disk 0 to a dynamic disk. Because Disk 0 is your system drive, the computer requires a restart.
|
Exercise 3: Using DiskPart
1. | Open a command prompt.
|
2. | Type diskpart and press Enter. The DISKPART> prompts appears.
|
3. | Type ? and press Enter. A list of Diskpart commands appear.
|
4. | Type list disk and press Enter. A list of the disk or disks in Server01 appears.
|
5. | Type create volume simple size = 250 disk = 0 and press Enter.
|
6. | Type list volume and press Enter.
A new volume has been created. The new volume appears with an
asterisk before its name. The asterisk denotes that the volume is
selected. Notice that there is no drive letter assigned to the volume.
|
7. | Type assign letter z and press Enter.
|
8. | Type list volume and press Enter. The letter Z is assigned to the selected volume.
|
9. | Type extend size=250 disk=0 and press Enter.
|
10. | Type list volume and press Enter. The selected volume (drive Z) is now 500 MB in size.
|
11. | Type exit and press Enter. The command prompt reappears.
|
12. | Type format z:/fs:NTFS/v:Extended_Volume/q and press Enter. A warning message appears stating that all data will be lost on drive Z.
|
13. | Press Y and then press Enter. A quick format with NTFS is performed on drive Z.
|
14. | Type exit to close the command window.
|
Exercise 4: Extending Volumes Using Disk Management
1. | |
2. | Right-click Extended_Volume and choose Delete Volume.
|
3. | Confirm the deletion of the volume by clicking Yes.
|
4. | Right-click Data_Volume and choose Extend Volume. The Extend Volume Wizard appears.
|
5. | Click Next.
|
6. | Change the amount of space being used to extend the volume to 500 MB.
|
7. | Click Next.
|
8. | Read the summary information. Click Finish.
|
Exercise 5: Drive Letters and Mounted Volumes
1. | Right-click Data_Volume and choose Change Drive Letter And Paths.
|
2. | Change the drive letter to X.
|
3. | Right-click Data_Volume (X:) and choose Open. Windows Explorer opens.
|
4. | Create a folder called Docs.
|
5. | Close Windows Explorer.
|
6. | Right-click unallocated space on Disk 0 and choose New Volume.
|
7. | Create
a simple volume using all remaining space on the disk. Instead of
assigning a drive letter, mount the volume in the path X:\Docs. Format
the volume NTFS and label the volume More_Space.
|
8. | Open
Windows Explorer and make sure that Status Bar is selected in the View
menu. Examine the X: volume. How much free space is shown? What free
space is reported when you open the Docs folder? |