Microsoft

Build Your Skills: Handy disk management features of Windows XP

Learn how to create various types of dynamic volumes, change drive letter assignments, and set mount points in Windows XP.


Without reliable file storage, a computer is little more than a glorified pocket calculator. Various storage media have risen and fallen in popularity, but the hard disk continues to be the mainstay of most systems, and each operating system adds its own disk-management tools and features. This Daily Drill Down discusses Windows XP’s Disk Management tools and abilities and introduces you to the dynamic disk features unique to Windows XP. It also shows you how to create various types of dynamic volumes, change drive letter assignments, and set mount points. We even provide tips for troubleshooting and fixing certain disk problems.

Working with different file systems
When you format a disk in Windows XP, you have a choice of three file systems: FAT, FAT32, and NT File System (NTFS). To make the best choice, you should understand the background and purpose of each.

FAT is the original 16-bit file system from MS-DOS and early versions of Windows. FAT32 is the improved version of FAT provided with later releases of Windows 95, Windows 98, Windows Millennium Edition, and Windows 2000. NTFS is Windows XP’s own native file system. It offers many advantages over FAT and FAT32 under Windows XP, so you should use it as long as compatibility with other operating systems on the same PC is not an issue. You may dual-boot between Windows XP and Windows 95 or 98, for example, and want the files on every partition to be accessible no matter which operating system is being used. For that to be the case, you must use FAT or FAT32 on all partitions.

Converting a FAT or FAT32 drive to NTFS
It’s easy to convert a FAT or FAT32 drive to NTFS without reformatting or losing any data. Windows XP provides a command-line utility called Convert for this purpose. Open a command prompt (from within Windows is fine) and type the following, where x: is the letter of the drive to convert:
Convert x: /fs:ntfs /v

The /fs switch stands for File System and the /v switch stands for Verbose. (You get all available messages on-screen describing the progress.)

Accessing the Disk Management tools
All versions of Windows XP, including Windows XP Professional, provide a Disk Management interface for working with your system’s drives. One way to access it is through the Computer Management window. Choose Start | Control Panel | Performance And Maintenance | Administrative Tools | Computer Management, or simply right-click My Computer and choose Manage from the resulting context menu. Then, click Disk Management in the folder tree, as shown in Figure A.

Figure A
You can manage your disks through the Computer Management window.


Another way to access the Disk Management tools is to create a Microsoft Management Console (MMC) that includes Disk Management as a snap-in. This is more work than either of the other methods, but it does have its advantages. The MMC is a very flexible tool for creating customized interfaces for various system administration tools. If you’re responsible for supporting many users of varying computer skill levels, you can create various MMCs containing tool sets (called snap-ins) appropriate for each user’s experience level and needs. One of the advantages of adding the Disk Management snap-in to an MMC is that you can specify which computer on your network it pertains to. In other words, you can remotely manage the disks of other PCs on your network from your own desktop (provided, of course, you have adequate permissions set and the PCs you are managing are running some version of Windows XP). So, for example, an administrator in charge of a small workgroup could create an MMC containing Disk Management capability for each of the PCs in that workgroup.

To create an MMC containing the Disk Management snap-in, follow these steps:
  1. Choose Start | Run, type MMC, and click OK. An empty Microsoft Management Console window will open.
  2. Choose File | Add/Remove Snap-In to open the Add/Remove Snap-In dialog box.
  3. Click the Add button to display a list of available snap-ins. Select Disk Management from the list and click Add. The Select Computer dialog box will open.
  4. To manage the local PC, leave the default setting, as shown in Figure B. Or, to manage another PC on your network, choose The Following Computer and then click Browse to locate it.
  5. Click Finish. If you want to add any other computer's disk management to the console, go back to step 3. If not, click Close.
  6. Click OK. The console will show the Disk Management snap-in, as shown in Figure C.

Figure B
Choose the local PC or another PC on your network on which to manage the disks.


Figure C
These are the Disk Management tools set up as a snap-in for an MMC.


Regardless of which way you get into the Disk Management interface, it looks and operates the same way. As shown in Figure C, Disk Management lists each physical drive on a separate line. The top pane provides text-based details; the bottom pane shows a graphical representation of the space. The Disk Management interface makes it easy to manage all the disks in a PC in a single location. This is not a major issue when you have only one hard disk, but if you’re dealing with a file server, it becomes a great benefit.

Viewing disk and volume properties
To view the properties for a particular disk, right-click it and choose Properties. Note that the properties for the physical disk are different from those for a particular partition or volume. When you right-click the disk (for example, Disk 0) and choose Properties, you’ll see a box like the one shown in Figure D. In contrast, when you right-click a partition or volume on that disk (for example, C:), you’ll see a box like the one shown in Figure E.

Figure D
Windows 2000 view of properties for a physical disk (Disk 0)


Figure E
Windows 2000 view of properties for a logical volume (C:)


Creating and deleting partitions and volumes
The procedures for creating partitions (on basic disks) and volumes (on dynamic disks) are similar, but you have many more options with a volume. With a partition, you can choose whether the partition should be primary or extended and you can set the size. With a volume, you can choose a simple volume or one of the performance-enhancing or fault-tolerant types supported by Windows XP. The following sections provide more details.

Creating and deleting partitions
If you don’t want to convert your basic disk(s) to dynamic, that’s fine; the Disk Management interface lets you work with them normally. You can create and delete partitions on the fly in Windows XP and format the partitions with FAT, FAT32, or NTFS, as desired. (Remember, we’re talking about basic disks here, because of the word partition. With dynamic disks, they’re called volumes.)

If you have some unpartitioned space on a physical drive, you might want to create a new partition from it. It’s wasted, after all, until you partition it and assign it a drive letter. To create a new partition, you must right-click the unallocated space and choose Create Partition. Then, work through the Create Partition Wizard. To delete a partition, right-click it, choose Delete Partition, and follow the prompts.

Creating and deleting simple volumes
When you convert a disk from basic to dynamic, any existing partitions are converted to simple volumes. A simple volume is just what it sounds like—a volume on a single physical disk that has no special features like mirroring, striping, spanning, or RAID-5.

You can create new simple volumes out of the unallocated space on a disk. You can also delete the existing volumes on a drive and re-create them. Why would you want to do that? A couple of the dynamic disk features, such as extending a volume, don’t work on converted volumes; deleting and re-creating a volume makes it able to take advantage of those features.

To create a new simple volume, you must right-click the unallocated space and choose Create Volume to run the Create Volume Wizard. This wizard is a lot like the Create Partition Wizard, prompting you for type and size. Choose Simple as the type and work your way through to the end. To delete a volume, right-click it, choose Delete Volume, and follow the prompts.

Note
When creating dynamic volumes, you’re given the choice of formatting the volume with FAT, FAT32, or NTFS. The only reason to use FAT or FAT32 is for compatibility with other operating systems, but since other operating systems don’t recognize dynamic disks, I can’t think of a reason to use anything but NTFS when formatting a volume on a dynamic disk.

Extending or spanning a volume
You can extend a dynamic disk volume using unallocated free space on the same or any other physical drive. So, for example, let’s say we have a 2-GB volume and another 4.6 GB of unallocated space on the drive. We can add that extra unallocated space to the volume, increasing it to 6.6 GB. Extending works only with dynamic disks and doesn’t work with the volume that contains your system or startup files or with the volume that contains your swap file (for virtual memory).

To extend a volume, right-click it and choose Extend Volume. The Extend Volume Wizard will run. Select the portion of the unallocated space that you want to claim for the volume and then work your way through to the end.

After you extend the volume, notice in the Disk Management screen that the two pieces continue to appear separate in the lower pane, yet they have the same drive letter and appear as a single entry in the upper pane. However, if you delete either of them, both are deleted. Similarly, if any of the drives in the spanned volume fails, all the data for the entire volume is lost.

A spanned volume is like an extended one except that the extra space comes from another physical disk rather than from the same one. You can choose other dynamic NTFS-formatted dynamic disks besides the current one when extending a volume. You can use space from up to 32 dynamic NTFS-formatted disks to make a single volume with one drive letter.

Creating a striped volume
A striped volume is one in which two or more physical disks alternate to store data, in 64-KB chunks. So, for example, for a 256-KB file stored on a two-disk striped volume, the first and third 64 KB of the file are stored on one disk, and the second and fourth 64 KB are stored on the other disk. Why? Because it's fast. Striping can improve file read/write performance. However, striped volumes are not fault-tolerant, and if either drive goes bad, all the data is lost.

Striping is somewhat like spanning in that it takes space from multiple drives and creates a single volume. However, a spanned volume puts entire files on one drive or another, while striping spreads each file out evenly over the available drives. You can’t extend or span striped volumes.

You must have at least two dynamic disks to create a striped volume. To create one, right-click the unallocated space on one of the disks to be included and choose Create Volume. Choose Striped Volume as the type and then follow the prompts to select the other drives to be included and complete the process.

Creating a mirrored volume
A mirrored volume creates two identical copies of the same data on two separate disks. That way, if one of them fails, the data will still be complete and usable on the other. You can either create a new mirrored volume out of two empty disks or you can mirror an existing volume.

To create a new mirrored volume, right-click the unallocated space on one of the drives and choose Create Volume. Choose Mirrored Volume as the type and follow the prompts. You’ll be asked to select the disks to use, assign a drive letter, and choose how you want the volumes formatted. (NTFS is almost always the best choice.)

If you want to mirror an existing volume, right-click it and choose Add Mirror. Choose the disk to use as the mirror and click Add Mirror.

Creating a RAID-5 volume
RAID-5 is another term for striped volumes with parity (essentially a “switch” that is either on or off [0 or 1], depending on the number of odd and even [0 and 1] bits in a number or series of numbers). A RAID-5 volume consists of at least three disks. When you write some data to the volume, the data is spread out evenly over all the disks, with one of the disks used for parity in each stripe. So, for example, if you have four disks in the array, three of those disks hold data for a particular stripe, and the remaining disk holds a parity bit. The drive used for parity changes with each stripe, so that parity is evenly distributed among all the disks. If one of the disks fails, the volume’s content can be reconstructed using the data and parity bits from the remaining disks.

RAID-5 offers fault tolerance like a mirrored volume does, but it does not waste as much disk space as mirroring does. Rather than using two drives to get the capacity of one drive, you can have, for example, six drives that have a total capacity of five drives. The more drives in a RAID-5 array, the more space-efficient it is.

To create a RAID-5 volume, start with unallocated space on each of the disks. Then right-click some unallocated space and choose Create Volume. The Create Volume Wizard will run. When prompted for the volume type, choose RAID-5 Volume. (If you don’t have at least three dynamic disks, you won’t have the RAID-5 choice.) When prompted to select the disks, choose the ones to use, set the size, and assign a drive letter. When prompted to format the new volume, you can choose FAT, FAT32, or NTFS.

Changing drive letter assignments
You have 24 drive letters to work with for hard disks and other IDE drives: C through Z. (A: and B: are reserved for floppies, but in a pinch you can override this and assign the letter B, as well.) When you create or import volumes, Windows assigns drive letters to them based on the first available letter; consequently, the letter assignments might not be the ones you want. Fortunately, you can change a volume or partition’s drive letter assignment from within Windows.

Caution
If you change the drive letter assignment for a partition or volume containing a program installed in Windows and the registry contains entries that point to that program’s folder on that partition or volume, the program might not work correctly after you change the drive letter unless you edit the references to it in the registry.

To change a drive letter assignment, right-click the volume or partition and choose Change Drive Letter And Path. Click Edit and, in the Edit Drive Letter Or Path dialog box, open the Assign A Drive Letter list, choose a different letter, and then click OK. Click Yes to confirm.

Using mount points
Windows XP has a feature that lets you mount a local disk to an empty folder on an existing NTFS volume rather than to a drive letter. It’s somewhat like creating a permanent shortcut. For example, suppose you add a new physical hard disk to an existing system that has only a single volume. Since that volume contains startup files, you can’t span it. However, you can mount the new disk as a folder on the existing one, so that the new disk is, in effect, an extension of that existing drive. The only catch is that the new disk’s existing space can be used only to store files within the folder in which you mount it. Another advantage of mounting a disk as a folder is that folder names are not subject to the 26-letter naming limit of drives.

When you create a new volume, you have the option of assigning a mount point to it rather than a drive letter. You can indicate the volume and folder to which you want to mount the drive here. If you do this, the volume will not have its own drive letter.

Note
Before attempting to mount a volume as a folder, create the new folder first on the existing volume, but do not put anything in it. If the folder already exists, ensure that it’s empty. If you forget to create it beforehand, you can create it on the fly by clicking Browse and then New Folder.

If a volume already has a drive letter, you can assign a folder to it on another volume as an additional shortcut. To do so, right-click the volume and choose Change Drive Letter Or Path. Click Add and, in the Add New Drive Letter Or Path dialog box, enter a path in the Mount In This NTFS Folder box. You can use any existing empty folder; click Browse to locate one.

Diagnosing disk errors
In Disk Management, each partition or volume should report a status of Healthy, as shown in Figure F. If you see any other status, you have a problem. To solve the problem, first try the Reactivate Disk command: To use it, right-click a failed volume or partition and choose Reactivate Disk from the shortcut menu.

Figure F
All partitions and volumes should show a status of Healthy.


If only one partition or volume on the drive reports a condition other than Healthy and that condition persists after you try reactivating it, you should delete that partition or volume and re-create it. First, copy any data from it that you want to keep and then right-click the partition or volume and choose Delete. Then re-create it as described above.

If all of the volumes or partitions on the drive report a status other than Healthy, the drive may be defective. If you can still access the volumes or partitions from Windows Explorer, copy any files you want to keep and then replace the drive. The situation becomes a little more complicated in a mirrored volume or RAID-5 volume situation. See the following sections for specifics.

Replacing a failed disk in a mirrored volume
If one of your mirrored drives fails, you should replace it as soon as possible. You can tell a failed volume because its status appears as Offline, Missing, or Online (Errors). First, try right-clicking it and choosing Reactivate Disk. If the status still doesn’t appear as Healthy, remove the mirroring and replace the disk by following these steps:
  1. Remove the mirroring by right-clicking the healthy disk of the set and choosing Remove Mirror. Choose the failed disk, click Remove Mirror, and click OK.
  2. Replace the defective physical disk.
  3. Re-add the mirror by right-clicking the original remaining disk and choosing Add Mirror.

Replacing a failed RAID-5 volume disk
When a drive in a RAID-5 volume fails, your first indication will probably be a performance hit. If you start noticing poor read/write performance, check the volume’s status in Disk Management. If it doesn’t report Healthy, or if one of the disks reports Offline, Missing, or Online (Errors), first try reactivating the disk (right-click and choose Reactivate Disk). If that doesn’t work, you’ll need to remove the failed drive, replace it, and then rebuild the volume content. After replacing the physical drive, right-click the RAID-5 volume and choose Repair Volume. The Repair RAID-5 Volume dialog box opens. Select the new drive that is replacing the failed one in the set, click OK, and you’re back in business.

Checking a disk for errors
Besides the physical errors that can derail a disk, logical storage errors can also creep into the picture. These are discrepancies between the volume or partition’s file allocation table and the actual content on the disk. For example, when the file allocation table reports that two different files lay claim to the same cluster on the disk, a cross-linked file results. Such errors can be corrected with the Check Disk utility in Windows XP. (This serves the same purpose as the Scandisk utility in earlier Windows versions.)

To run Check Disk for a drive, do the following:
  1. In Disk Management, or in My Computer, right-click the volume or partition and choose Properties.
  2. On the Tools tab, click Check Now. The Check Disk dialog box will open, as shown in Figure G.
  3. (Optional) To have errors corrected automatically, mark the Automatically Fix File System Errors check box.
  4. (Optional) To perform a surface scan of the disk, as well as a logical check, mark the Scan For And Attempt Recovery Of Bad Sectors check box.
  5. Click Start.

Figure G
To find and fix storage errors on a volume or partition, use the Tools tab in a volume or partition’s Properties dialog box.


Using Disk Defragmenter
Over time, file storage on a disk becomes fragmented, with pieces of files scattered all over the disk. Picking up and assembling these pieces into whole files takes time, resulting in poor disk read performance. To correct that problem, you can run Disk Defragmenter.

Disk Defragmenter works the same way in Windows XP as in earlier versions of Windows. You can run Disk Defragmenter from the Start menu (Start | Programs | Accessories | System Tools | Disk Defragmenter), or you can right-click a drive from Disk Management or My Computer, choose Properties, and then run it from the Tools tab of the Properties box, just as you did for Check Disk. Once you’re in the Disk Defragmenter program, shown in Figure H, choose the drive you want to defragment and click the Defragment button.

Figure H
Defragment a disk to improve its read/write performance times.


More to it than just reading and writing
The hard disk is the workhorse of any PC system. Treat it right and the disk will serve you well for many years. Neglect it by not performing routine maintenance and you will find that you have to replace the disk more often than should be necessary. By using the Disk Management tools provided by Windows XP, you’re taking a step in the right direction toward extending the usefulness and life of your PC's hard disk.

Editor's Picks