10.3 Making Room for Windows

Inevitably, the storage in your computer will need to be expanded, either to make room for a newer version of Windows, or to make room for all your stuff after installing Windows.

10.3.1 Transfer Windows to Another Hard Disk or System

With the release of an operating system as large and power-hungry as Windows XP, it shouldn't be surprising that many users will need to upgrade their hard disks or even their entire systems just to accommodate the new version.

Either way, some or all of the files on the old hard disk will need to be transferred to the new hard disk, and this can be a difficult task. Sure, you can simply install Windows XP from scratch and then proceed to reinstall all your applications, configure all your settings, and rewrite all your documents, but that's not exactly the most practical solution. Besides, your Freecell statistics would be lost forever.

You can transfer the data from one drive to another (or one system to another) in any of several ways, explained in the following solutions. The one you choose depends on your available hardware and your specific needs. If you have just purchased a new hard disk, you'll need to prepare the disk by partitioning and formatting it before you continue. See "Working with Partitions," later in this chapter, for details.

10.3.1.1 Solution 1: using a disk-cloning utility

The following procedure is probably the most pain-free solution of those in this section, at least in terms of the amount of interaction and work involved. However, you will need to crack open your case and fuss with cables (something you'll have to do anyway if you're only upgrading your hard disk, versus the entire system). Also, it requires that you purchase a third-party utility, although the aggravation and time it saves can offset the cost (even if you only use it this once). Note also that any data on the new hard disk will be lost as it is replaced with the data on the old disk:

  1. Obtain a disk-cloning utility. Examples include PowerQuest DriveCopy and Drive Image (http://www.powerquest.com) and Norton Ghost (http://www.symantec.com).

    If you purchased the product online and have only the downloadable edition, you may have to create a bootable diskette as described in the documentation included with the product you're using.

  2. Connect both your old hard disk and your new hard disk to the same computer simultaneously. If you're upgrading to a new system, it usually doesn't matter which computer you use for this process. However, drive configurations in the following list are usually required by this type of utility (see the software's documentation for details).

    • If you're using IDE drives, the old hard disk should be connected as "master" and the new hard disk should be connected as "slave."

    • If you're using SCSI drives, configure the SCSI controller BIOS to boot off the old drive.

    • If you're using one IDE and one SCSI drive, the configuration shouldn't matter.

  3. If your disk controller doesn't have enough free ports, just temporarily disconnect a CD drive or other storage device to make room for the new drive.

  4. Insert the boot disk from the disk-cloning utility you're using and boot your computer. The program should start up and walk you through the rest of the process. Just be careful when choosing the "from" and "to" drives.

While this sounds complicated, it's actually quite fast, as data transfer between two hard disks on the same system is much faster than over a network or using removable media.

The particular procedure depends from this point depends on the type of disk cloning utility you chose. There are typically two types:

  • The more traditional disk cloning programs simply copy all data on one drive, byte-for-byte, to another drive. Any partitions (discussed later in this chapter) are duplicated as well but are expanded proportionally. For example, if you have a 10-GB drive with two 5-GB partitions, and you transfer the data to a 60-GB drive, you'll end with two 30-GB partitions (which can later be combined, if desired, with the solutions found later in this chapter.

  • Newer "image" utilities take a slightly different approach. Instead of copying data between drives, these programs start by creating an image of the old drive, which is essentially a single, enormous file that contains every byte of data on the drive. The new drive is then reconstructed from the image.

 

This can be especially useful if you need to create several exact copies of a single drive, a common practice for network administrators who don't want to spend days individually configuring a bunch of otherwise identical computers.

 

  • The problem with this intermediate step is that you need somewhere to store this image file. If you're creating an image of a 10-GB drive with 8 GB of data on it, there will only be 2 GB of free space, which won't be enough to store an 8-GB image file. Since you won't be able to store the image file on the target (new) disk, you'll actually need a third hard disk to hold the image.

10.3.1.2 Solution 2: use a backup device

If you have a tape drive or other large-capacity backup device, another thing you can do is back your entire system and then restore it to the new drive. Here's how to do it:

  1. Back up your entire system, making sure to include every file on your hard disk. See Chapter 6 for more information on backup devices and procedures.

  2. If you're only upgrading your hard disk, shut down your computer, remove the old hard disk, and install the new hard disk. Then, install Windows using the "Installing on a New (Clean) System" procedure at the beginning of this chapter.

    If you're upgrading to an entirely new machine, you'll need to install your backup device on the new system.

  3. Install the backup software (the same as the one you used in Step 1) onto the new drive or new system.

  4. Restore the files from the backup media onto the new drive, but make sure you restore the entire tree of files into a temporary folder, rather than into the root directory. For example, if your temporary folder is named Old Hard Disk, then the path to the restored Documents and Settings folder will actually be \Old Hard Disk\Documents and Settings. This prevents errors you may encounter trying to replace files and folders in-use by the current installation of Windows.

  5. When the restore process is complete, selectively (one-by-one) drag the old folders out of your Old Hard Disk folder and into the root directory of your new hard disk.

    In the cases of your Windows folders (such as the \Windows, \Program Files, and \Documents and Settings branches), you won't be able to drag them if they're replacing existing in-use folders. Instead, you have two options: either don't copy every folder (instead, only move selected files and folders), or use the following workaround.

Here are the optional additional steps to replace your Windows folders:

  1. Start by renaming the three conflicting folders, all still located in the Old Hard Disk folder, as follows:

    • Windows becomes oldwin

    • Program Files becomes oldprogs

    • Documents and Settings becomes olddocs

  2. Drag the three folders into your root directory, so they're right alongside the folders they're intended to replace.

  3. Restart the computer and load the Windows Recovery Console (described later in this chapter).

  4. After logging in, issue the commands in the following list:

    ren Windows newwin ren "Program Files" newprogs ren "Documents and Settings" newdocs ren oldwin Windows ren oldprogs "Program Files" ren olddocs "Documents and Settings"

    See Appendix C for more information on the ren command. Note the use of quotation marks to accommodate the folder names with spaces.

  5. Restart your computer when you're done. The old installation of Windows will now be used to start your computer. If you're upgrading to an entirely new computer, Windows will detect a bunch of new hardware the first time it starts.

    The new, temporary Windows installation is now stored in the newwin, newprogs, and newdocs folders, which can be deleted or stored as you see fit.

 

Alternate Method of Shuffling Restored Files

While we're at it, another way to accomplish all of this is to divide your new drive into two partitions (as discussed later in this chapter). When installing the new copy of Windows, put it on the second partition (usually D:). Then, restore the backed-up files onto the first partition (usually C:). Since the restore process will replace the boot.ini file[a] in the root directory of drive C: with the one from your backup, your computer will boot to the restored Windows installation on drive C: the next time you restart. You'll then be able to delete the extraneous, temporary second partition.

 

[a] See "Set up a Dual-Boot System," later in this chapter, for more information on the boot.ini file.

10.3.1.3 Solution 3: transferring data manually

Although the previous two solutions are preferred, since they allow you to move a great deal of data from one drive to another, they're also more involved than the following. If you don't really need to move everything from the old drive to the new one, but instead only wish to copy personal documents and perhaps some settings, consider the following tips:

  • The File and Settings Transfer Wizard is included with Windows XP for the specific purpose of transferring files from one computer to another. Unfortunately, it doesn't work very well, and can even end up being more trouble than it's worth. Essentially, everything it does can be accomplished manually with a network connection or removable media storage device.

  • Be careful when installing two drives in the same computer, as Windows XP has a tendency of permanently changing drive letters in a way that is difficult to undo. For example, if you have two drives, each known as C: in their respective computers, and you install both in the same computer, the secondary (or slave) drive will be changed so that it shows up as D:, so as not to conflict with the existing drive C: that has priority. If you then remove the drive and put it back in the original computer, it will still think of itself as drive D:, and may not boot because of it. For this reason, only put the "old" drive in this position, so you don't risk the "new" drive getting "re-lettered." See "Working with Partitions," later in this chapter, for more information on this paradox.

  • If you have two separate computers, transferring the files over your network may be the best way to avoid the complexities of hooking up both drives to the same machine. Although the network connection will be slower, it's easier and less risky. See Chapter 7 for more information on networking.

  • Since Windows XP won't let you copy certain system files that are in-use, you won't be able to copy your Windows Installation simply by dragging and dropping files in Explorer, whether you're using a network connection or removable media drive. To do this, you'll have to use one of the first two solutions in this section. The alternative is to install Windows on the new drive and then find a way to be satisfied copying only some files.

  • You can copy user profiles from one computer to another. User profiles are stored in the Documents and Settings folder, and include the Desktop, Start Menu, and many personal settings. However, you won't be able to overwrite the user profile in use by the currently-logged in user. See Section 3.1.4 for more information user settings, and all of Chapter 8 for more information on user accounts.

  • To copy selected settings, such as application toolbars and other personal preferences, you can use Registry patches, as described in Chapter 3.

10.3.2 Working with Partitions

Most hard disks are known by a single drive letter, usually C:. However, any hard disk can be divided into several drive letters, known as partitions. For example, if you have an 80-GB hard disk, you may wish to have four 20-GB partitions, or perhaps a 50-GB partition and a 30-GB partition. There are several reasons why you might want to do this:

  • Use multiple partitions to further organize your files. For example, put Windows on one drive, work documents on another, games on another, and personal data on yet another.

  • Partitions can be used to isolate your programs from your data. For example, place Windows on drive C:, your personal documents on drive D:, and use drive E: for your swap file. This gives you the distinct advantage of being able to format your operating system partition and reinstall Windows without touching your personal data. Isolating your swap file on its own partition allows it to grow and shrink as needed, without becoming fragmented as it would if it shared a drive with other files. See Chapter 5 for more information on the swap file and fragmentation.

  • To set up a dual-boot partition, described later in this chapter, you'll want to create a separate partition for each operating system you wish to install.

  • If you have several users, you can isolate their personal data from the operating system by creating a separate partition for each user.

  • If you're setting up a web server (or other type of network file server), it's good practice to put the publicly accessible folders on their own partition. This not only helps to secure the operating system from unauthorized access, but allows the OS to be upgraded or replaced without disrupting the shared folders and programs.

10.3.2.1 The Disk Management tool

Windows XP comes with an all-encompassing utility, Disk Management (diskmgmt.msc), which is used to view the partition table of any drive on your system, as well as create and delete partitions, and even change the drive letters for existing drives.[5]

[5] Disk Management effectively replaces the FDISK utility, used in some earlier versions of Windows to prepare a hard disk before installing the operating system.

Figure 10-1. Open the Disk Management utility to add or remove partitions, shuffle drive letters, and even change the way volumes are mounted.

figs/xpan_1001.gif

The main Disk Management window, as shown in Figure 10-1, is divided into two parts. You can change the arrangement of the panes in this window by going to View figs/u2192.gif Top or View figs/u2192.gif Bottom. The are three possible views, each displaying some redundant and some unique information, but by default, only the Volume List and Graphical View are shown (in the top and bottom positions, respectively):

Volume List

Use this view to show a summary of all the currently mounted logical drives on your system. This includes all active partitions on all hard disks, as well as any media currently inserted into your removable drives (which include CD and DVD drives, memory card readers, and removable cartridge drives). Removable drives without media (e.g., an empty CD drive) will not show up here, as these volumes are not mounted. See the subsequent discussion for more information on mounting drives.

This view is called the Volume List because it lists volumes, not disks. The term, volume, is essentially another word for partition. A single disk can contain several volumes (such as the one shown in Figure 10-1), although most hard disks (and all CDs, for instance) only contain a single volume. The way that each volume is accessed in Explorer (usually with a drive letter) is determined by how the volume is mounted (explained below).

Graphical View

Probably the most useful view in Disk Managent, the Graphical View lists a single entry for each physical drive in your system. Then, next to each device is shown all of the currently mounted volumes associated with the respective disk.

By default, the boxes representing multiple partitions (volumes) are not sized proportionally to their size (i.e., a 2-GB partition will appear to be roughly the same size as a 10-GB partition). To fix this, go to View figs/u2192.gif Settings figs/u2192.gif Scaling tab, and choose the According to capacity, using linear scaling option in both sections. You can also customize the colors used in the Graphical View by choosing the Appearance tab in this dialog.

Disk List

The Disk List is similar to the Graphical View, but abandons the display of the volumes for each disk in favor of additional technical information about each disk. The only information displayed here that is not available in the Graphical View is the Device Type (e.g. IDE, SCSI, USB) and Partition Style.[6]

[6] For nearly all disks on a Windows system, the Partition Style will be MBR (Master Boot Record). The exception is GPT (GUID partition table) drives, used by Windows XP 64-Bit Edition.

Hidden

Select this option to turn off the lower pane (it's not available for the upper pane), leaving the remaining selection to consume the entire window.

Press F5 or go to Action figs/u2192.gif Refresh to refresh all views, necessary if you've inserted or removed a CD, for example. Use Action figs/u2192.gif Rescan Disks for a more thorough refresh.

Feel free to customize the view of this window, but be aware that Disk Management won't save your customization settings, unless you first create a custom console file, described as follows.

10.3.2.2 Customizing Disk Management

The Disk Management tool is actually what Microsoft calls a "snap-in" for the Microsoft Management Console (MMC) application.[7] Other snap-ins include Disk Defragmenter, Device Manager, and the Group Policy Editor. The .msc file you launched to open the Disk Management tool is not actually the program, but rather just a small console file, which contains only the settings for the current view. The following procedure not only shows how to create a new console file that you can customize in a way that be saved, but shows how to create custom console files for all sorts of purposes.

[7] For more information on the Microsoft Management Console, as well as the available snap-ins, see Windows XP in a Nutshell (O'Reilly).

  1. Open the Microsoft Management Console (mmc.exe). A new, blank "Console Root" window will appear in the MMC window.

  2. Go to File figs/u2192.gif Add/Remove Snap-in, and then click Add.

  3. Select Disk Management from the Available Standalone Snap-ins list, and then click Add.

  4. Another window will appear, giving you a choice between This Computer and The following computer. Although it's possible to view the partition table to another computer using a network connection, you'll want to choose This Computer for the time being.

  5. You can add other snap-ins at this point, or simply click Close when you're done. Finally, click OK to close the Add/Remove Snap-in window.

  6. Highlight the Disk Management entry in the tree in the left pane, and then go to View figs/u2192.gif Customize and turn off the Console tree option to simplify this window. You won't want to hide the console tree if you added more than one snap-in in the previous step. Figure 10-2 shows a custom console file with a bunch of useful snap-ins, all accessible from the same window.

    Figure 10-2. If you find yourself using Disk Management or other MMC snap-ins frequently, you can create your own custom console file to provide quicker access to your favorite tools.

    figs/xpan_1002.gif

  7. You can further customize this window as you see fit. When you're done, go to File figs/u2192.gif Save to save your custom console view into a new .msc file.

The next time you wish to use the Disk Management tool, just open your custom .msc file instead of the diskmgmt.msc file included with Windows XP.

 

Alternatives to the Disk Management Tool

The Disk Management utility is not your only choice when it comes to repartitioning drives, but as far as the tools included with Windows XP are concerned, it's the best one.

One alternative is the DiskPart utility (diskpart.exe), a way of viewing, adding, and removing partitions from the command prompt. DiskPart is essentially the command-line equivalent to the Disk Management tool, although it has a few extra features (see "Resizing and Moving Partitions," later in this section). The biggest advantage to DiskPart is that it can also be run from the Windows Recovery Console, discussed later in this chapter. This allows you to modify your boot and system partitions, as well as work on your partition table when Windows XP won't start.

The other alternative is the disk partitioning tool built-into Windows Setup. It's quick and simple, but it's only available while installing Windows XP. See "Installing the Operating System," at the beginning of this chapter, for more information.

Finally, PartitionMagic (http://www.powerquest.com) is a third-party utility, discussed in other parts of this chapter, that allows you to resize existing partitions on the fly, and without erasing the data they hold something Disk Management can't do.

 

10.3.2.3 Mounting volumes

As stated in the previous section, a hard disk can have one partition or many. Other types of storage devices, such as CD drives, only have single partitions. These partitions, regardless of the nature of the physical device on which they're located, are all recognized as volumes by the Disk Management tool and by Windows Explorer.

Mounting is the method by which a volume is made accessible to Explorer and all your applications. In most cases, each volume has its own drive letter, such as C: or D:. But a volume can also be accessed through a folder on a different volume, called a mount point (NTFS only). Finally, there can be volumes on your system that aren't mounted at all, typically including volumes with file systems[8] not recognized by Windows XP and volumes simply not currently in use. Such unmounted drives will be shown in the Disk Management window, but won't appear in Windows Explorer.

[8] See Section 5.2.2 for more information on file systems. Examples of file systems not supported by Windows XP include Linux and Unix partitions

You can change how any volume on your system is mounted,[9] except for the system volume (the one containing your boot files) and the boot volume (the one on which Windows is installed).[10] This is one of the reasons I like to partition my disks into several partitions: so I can more easily make changes to my other drives as needed. With all my data on the same volume as Windows, I would have very little flexibility in this area.

[9] In some earlier versions of Windows, the drive letters of hard disks were controlled by DOS, but in Windows XP, you have much more control. See the "Designate Drive Letters" solution in any of my earlier Annoyances books for more information on the limitations involved in the assignment of drive letters in Windows 9x/Me systems.

[10] Note that the naming of the boot and system volumes is counterintuitive. The DiskPart utility, described later in this section, can be used to operate on the boot and system volumes.

In most cases, changing how a volume is mounted involves changing the drive letter. The easiest way to start is to change the drive letter of a removable or CD drive, and since applications are typically not installed on removable drives, there shouldn't be any adverse effects. For example, Figure 10-1, shown earlier in this chapter, shows a system with a DVD drive set to F:, a recordable CD drive set to R:, and a digital camera memory card reader set to X: (drives R: and X: are not shown).

To change the drive letter of any volume on your system, start by right-clicking any volume in the Graphical View or Volume List, and select Change Drive Letter and Paths. The Change Drive Letter and Paths dialog, as shown in Figure 10-3, lists the mount points for the selected volume. A volume can have as many mount points as you like, but only one of them can be a drive letter. (A volume can also have no drive letter or even no mount points at all.)

Figure 10-3. You can change the drive letter for any device, as well as as mount the volume as a folder on another drive, using the Change Drive Letter and Paths dialog.

figs/xpan_1003.gif

Click Add to display the Add Drive Letter or Path dialog. Here, you'll have two choices:

Assign the following drive letter

Select this option and then choose an unused drive letter from the list to mount the drive using the selected letter. If the selected volume already has a drive letter, this option will be grayed out, and you'll have to select the drive letter in the previous dialog and select either Change or Remove.

The only roadblock you may encounter when trying to change a drive letter is when one or more applications are installed on the drive in question. You should still be able to change the drive letter, but said application(s) may no longer work on the newly-lettered drive.

Mount in the following empty NTFS folder

This option is used to link up the volume with a folder on a different drive. For example, say the current volume already is using the drive letter, E:. If you were to mount the volume in the folder d:\backdoor, then the contents of E: would be identical to the contents of d:\backdoor, and e:\some folder would be the same as d:\backdoor\some folder.

Any drive on your system can be mounted in this way, but the mount point (the target folder) must be on an NTFS drive (discussed in Chapter 5), and must be empty. You can even mount a CD in a folder on your desktop. You can view all of the drives mounted in folders by going to View figs/u2192.gif Drive Paths.

There are a few reasons why you might want to do this. For example, if your hard disk is running low on space, and you don't wish to take the time to replace it and transfer all your data over (as described in "Transfer Windows to Another Hard Disk or System," earlier in this chapter), you can install a new drive and mount it in, say, your Documents and Settings folder. That way, the role of storing all personal files will be assumed by the new drive, and the old drive should regain a great deal of disk space.

Features similar to this one include network drive mapping, explained in Chapter 7, and Folder Shortcuts, explained in Chapter 4.

10.3.2.4 Creating and deleting partitions

Every hard disk must be partitioned before it can be used, even if that disk is to have only a single partition.

During the installation process, explained at the beginning of this chapter, the disk partitioning utility included with Setup allows you to partition the drive on which Windows is to be installed before the files are copied. From within Windows, the Disk Management tool is used to create and delete partitions. The following procedure shows how to create and delete partitions with Disk Management, although the methodology applies to either tool.

  1. Open the Disk Management tool (diskmgmt.msc). Make sure the Graphical View, explained in the previous section, is visible.

  2. Select the physical drive you wish to partition. Any existing partitions (volumes) for the current drive will be shown to the right. At this point, you can delete or add partitions, or change the drive letters (as explained previously).

  3. To delete a partition, right-click the blue box representing the partition and select Delete Partition or Delete Logical Drive.

    This option will be grayed out if you're trying to delete the system volume (the one containing your boot files) or the boot volume (the one on which Windows is installed).[11]

    [11] Note the counterintuitive naming of the boot and system volumes. You can use the DiskPart utility, described later in this section, to operate on the boot and system volumes.

     

    If you delete a partition, all the data on that volume will be permanently lost. This happens immediately, and there is no undo. Data on other partitions of the same drive, however, won't be affected. If you wish to make a partition smaller or larger without erasing the data, see the Section 10.3.2.5 which follows.

     

  4. To create a new partition, right-click the green box representing the remaining free space on the drive, and select New Partition or New Logical Drive.

  5. A wizard will appear, asking several questions about the new volume, including how much space to use, what kind of volume to create, and which file system to use.

    When choosing the size of the volume, you can specify any size you want, from only a few megabytes to the total amount of contiguous free space on the drive. As for the file system, you'll want to use the NTFS file system in most cases (see Chapter 5 for details).

    Figure 10-4. There are three basic types of partitions, each used under a specific circumstance.

    figs/xpan_1004.gif

    The type of volume to create is probably the most confusing setting here. The three volume types,[12] as illustrated in Figure 10-4, are explained in the following list.

    [12] There are actually other partition types, but such types are only available with dynamic disks, which are beyond the scope of this topic.

    Primary Partition

    The first partition on a drive should always be a primary partition. If all your partitions are to be used by Windows, then there should never be more than one primary partition on a drive. The exception is when you're setting up a dual-boot system, as described later in this chapter, where each non-Windows OS will need it's own primary partition. You can have up to four primary partitions on a drive, or up to three primary partitions and one extended partition.

    If you have more than one drive, each drive should have one primary partition. Additional partitions should be defined as "logical drives."

    Primary partitions are, by default, shown in dark blue.

    Extended Partition

    The extended partition does not actually contain data; it only encapsulates the logical drives (below). A drive can contain only one extended partition.

    The extended partition is, by default, shown in green, and only appears as a thick stripe surrounding any defined logical drives.

    Logical Drive

    If you want more than one partition on a drive, the second, third, fourth, and so on, should all be defined as logical drives (wherein the first is a primary partition). You must define an extended partition before you can create any logical drives.

    Logical drives are, by default, shown in light blue, and appear within the green box, representing the extended partition.

    For example, to create three 10-GB partitions on a 30-GB drive, you would create one 10-GB primary partition, followed by one 20-GB extended partition. Then, you'd create two 10-GB logical drives in the extended partition.

  6. Disk Management will typically format new partitions as they're created (a required step if you wish to store data on them). However, you can format any volume (which will erase any data currently stored on it) by right-clicking and selecting Format.

  7. In most cases, newly created or deleted partitions will appear (or disappear) in Explorer immediately, although you may be required to reboot for Windows to recognize some drive types.

10.3.2.5 Resizing and moving partitions

You may encounter a situation when you need to resize a partition, either to consume the space left over from another deleted partition, or to make a partition smaller to make room for a new one. Unfortunately, support for this type of partition manipulation is extremely limited with the tools included with Windows XP.

Now, the simplest way to resize a partition is to delete it and then create a new one. Unfortunately, this has the rather undesirable side-effect of completely erasing any data stored on the volume.

There is, however, one case where you can resize a partition in Windows XP without erasing the data contained therein. Say you have three 10-GB partitions on a 30-GB drive (just like the one shown exemplified in the previous section). If you delete the third partition, it's possible to "extend" the second one so that it will consume the newly-available free space. Note that a volume can only be extended to the "right" (using the paradigm employed by the Graphical View in the Disk Management tool). If haven't yet deleted the extraneous volume, do so now using Disk Management.

  1. Open a Command Prompt window (cmd.exe), and type diskpart at the prompt to start the DiskPart utility.[13]

    [13] For some reason, the "extend" feature is not available in the Disk Management tool, which is why we must use the other disk partitioning tool included with Windows XP, DiskPart.

  2. At the DISKPART> prompt, type:

    list disk

    to display all the drives on your computer. Each disk will have a disk number, starting with 0 (zero). Unless you have only one drive, you'll have to tell DiskPart which drive you wish to modify. Do this by typing:

    select disk n

    where n represents the number of the disk you wish to modify. For example, type select disk 0 to select the first disk.

  3. Next, at the DISKPART> prompt, type:

    list volume

    to display all the volumes on the selected disk. Each volume will have a volume number, starting with 0 (zero). Even if you have only one volume on this drive, you'll have to tell DiskPart which volume to extend by typing:

    select volume n

    where n represents the number of the volume you wish to modify. For example, type select volume 2. Remember, there must be free space immediately after the selected volume for this to work (double-check this by using Disk Management's Graphical View).

  4. When you're ready, type

    extend

    to extend the volume. The extend command takes no options and displays no warning message or confirmation. The process begins immediately after pressing the Enter key, and should take only a few seconds.

  5. When it's done, type exit to quit the DiskPart utility, and then type exit again to close the Command Prompt window.

Unfortunately, resizing a partition in the opposite direction (i.e., shrinking a volume) without erasing its data is not supported by Disk Management or the DiskPart utility. For this, you'll need the PartitionMagic utility (available at http://www.powerquest.com), which can not only expand and shrink partitions, but move them as well all without easing the data they contain. PartitionMagic can even be used to make changes to the system and boot volumes, something that neither Disk Management nor DiskPart will let you do.

 

Why It's Difficult to Resize Partitions

When it comes to resizing partitions, the disk partitioning tools in Windows XP are only able to make them larger, and then only in specific circumstances. But why the limitation?

The reason for this is fairly simple. Open Disk Defragmenter (dfrg.msc), select a volume with a lot of files on it, and click Analyze. You'll then see a map labeled Estimated disk usage before defragmentation showing how the files are physically distributed on the selected volume. Notice how they appear to be scattered throughout the volume from beginning to end (left to right, respectively)? Using Disk Defragmenter (discussed in Chapter 5) will reduce the scatter somewhat, but it's designed mainly to rearrange files to improve performance, rather than prepare a partition to be resized.

The process to "extend" a volume, explained in this section, simply involves moving the partition boundary to the right, and as long as it doesn't hit another partition (or the end of the drive), there should be no problem.

In order to make a partition smaller, however, Windows would have to rearrange the files so that sufficient free space is grouped into a single, contiguous block at the very end of the partition. That way, the partition boundary could be moved to the left, making the partition smaller, without losing any file data. Unfortunately, neither the Disk Management or DiskPart tools are capable of this advanced manipulation, which is why you'll need another tool, such as PartitionMagic, to accomplish this.

 



Windows XP Annoyances
Fixing Windows XP Annoyances
ISBN: 0596100531
EAN: 2147483647
Year: 2005
Pages: 78
Authors: David A. Karp

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net