Section 5.2. Hard Disk


5.2. Hard Disk

Your hard disk is more than just a storage device; it's used to hold your operating system and to supplement your system's memory. The speed and health of your hard disk is a major factor in your computer's performance, not to mention its reliability and security. The following topics all deal with different aspects of your hard disk and how effectively Windows uses it.

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. Later in this section, you'll find tips on upgrading and repartitioning your hard disk, allowing you to keep your disk and its data in tip-top shape.

5.2.1. A Defragmentation Crash-Course

The best way to ensure maximum performance from your drive is to regularly (weekly or biweekly) defragment it (also called optimizing). Figure 5-5 shows how frequent use of the hard drive can cause files to become fragmented (broken up), which can slow access and retrieval of data on the drive, as well as increase the likelihood of lost data.

Figure 5-5. File fragmentation on your hard disk can slow performance and decrease reliability


To defragment your drive, run the Disk Defragmenter (dfrg.msc), which rearranges the files on your hard disk to make them contiguous (not broken into pieces). It also defragments the free space, and optionally places the files you access more frequently (such as programs and recently modified documents) at the start of the drive and less frequently accessed files at the back of the drive.

If you find that Disk Defragmenter is having trouble completing its job, either continually restarting, or simply defragmenting your drive only partially, the culprit may be either of the following:

  • To avoid corrupting data, Disk Defragmenter stops what it's doing and restarts whenever it detects that another process has written to the drive. To allow Disk Defragmenter to do its job, make sure to close all nonessential programs and background processes. Also, if necessary, disable the Disk Indexing service by right-clicking the drive icon in Windows Explorer, selecting Properties, and turning off the Allow Indexing Service to index this disk for fast file searching option.

  • If the amount of free disk space is low (less than 15% of the size of the drive), Disk Defragmenter may refuse to run. You can force it to defragment your drive by opening a Command Prompt window (Chapter 10) and typing defrag c: /F, where c: is the drive letter of the hard drive you want to defragment. Better yet, delete some files (see "Increasing Disk Space (or What to Throw Away)") and try again.

If you're compulsive about disk defragmentation, superior alternatives to Disk Defragmenter include Norton Speed Disk (included with Norton Utilities, http://www.symantec.com) and Diskeeper (http://www.executive.com/).

5.2.1.1 Enable automatic boot defragments

Here's a funny little setting in the Registry that seems as though it's supposed to instruct Windows to defragment your hard disk automatically each time it starts:

  1. Open the Registry Editor (described in Chapter 3).

  2. Expand the branches to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Dfrg\BootOptimizeFunction.

  3. Double-click the Enable value, and type Y for its data (or type N to disable it).

The funny part is that this setting is probably already enabled on your system (it's enabled by default on most XP systems). Now, have you ever seen Windows run Disk Defragmenter at startup?

The reason you don't see it is because it isn't a full defragment. Instead, it's only a boot defragment, which only affects the files registered with the Windows Prefetch feature (see the "Keeping an Eye on Prefetch" sidebar) and listed in the Layout.ini file (not a standard INI file). You can perform this boot defragment at any time by opening a Command Prompt window (see Chapter 10) and typing defrag c: -b.

Keeping an Eye on Prefetch

Prefetch is a new feature, introduced in Windows XP, that stores specific data about the applications you run, in order to help them start faster. Prefetch is an algorithm that helps anticipate cache misses (times when Windows requests data that isn't stored in the disk cache), and stores that data on the hard disk for easy retrieval.

This data is located in \Windows\Prefetch, and, as the theory goes, periodically clearing out the data in this folder (say, once a month) will improve performance. As new applications are subsequently started, new prefetch data will be created, which may mean slightly reduced performance at first. But with older entries gone, there will be less data to parse, and Windows should be able to locate the data it needs more quickly. Any performance gains you may see will be minor (if you see any at all), but those wishing to squeeze every last CPU cycle out of their computer will want to try this one.

Note that deleting Prefetch data may increase boot time slightly, but only the next time you boot Windows. Each subsequent boot should proceed normally, since the prefetch data will already be present for the programs Windows loads when it boots.

If you want to disable Prefetch, open your Registry Editor (Chapter 3), navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters, and change the EnablePrefetcher value to 0. (Other supported values: 1 to Prefetch applications only, 2 to Prefetch boot processes, and 3 to Prefetch both.)


5.2.2. Increasing Disk Space (or What to Throw Away)

Parkinson's law states that work expands so as to fill the time available for its completion. Along the same lines, it's safe to say that files will quickly expand to fill the amount of available disk space.

Low disk space doesn't just make it harder to store files, however; without ample room for virtual memory (discussed earlier in this chapter), Windows performance will slow to a crawl. Less disk space also increases file fragmentation, as Windows scrambles to find places to place the data; this, in turn, greatly lowers performance. Keeping a healthy amount of free disk space is vital to a well-performing system.

Additionally, removing drivers and applications that are no longer used clears more memory and processor cycles for your other applications, which can substantially improve overall system performance.

If your PC is low on disk space, try enabling NTFS compression.[2] Right-click any folder, select Properties, click Advanced, and turn on the Compress contents to save disk space option. Note that this can degrade performance slightly, so you'd be wise to only use it for data that you don't access or modify often.

[2] This feature is only available on NTFS-formatted drives. See "Choosing the Right Filesystem," later in this chapter, for details. It's also mutually exclusive of the Encrypt contents to secure data option discussed in Chapter 8.


Even before you install your first application, your hard disk is littered with files from the Windows installation that you most likely don't need. The standard installation of Windows XP puts about 10,000 files in more than 600 folders, consuming more than a gigabyte of disk space.

Whether you need a particular file can be subjective; the 2.5 MB of .wav files that one person might consider excessive might be valued by another. Naturally, it makes sense to be cautious when removing any files from your system. The removal of certain files can cause some applications, or even Windows itself, to stop functioning. It's always good practice to move any questionable files to a metaphorical purgatory folder before committing to their disposal. And I don't have to tell you that routinely backing up your entire hard disk (see Chapter 6 ) is very important. What follows are some tips to help you identify the more common files and folders that can be safely removed, as well as those that should be left alone.

Disable Disk Cleanup

When your PC starts running out of disk space, Windows will prompt you to run the Disk Cleanup Wizard, which presents a list of some of the files you can delete to recover free disk space (the solutions in this book are much more comprehensive).

To disable this annoying warning, open the Registry Editor (see Chapter 3) and expand the branches to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer. If it's not already there, create a new DWORD value (Edit 5.2.2.1 Windows XP files that can be deleted

The following tips apply to files located in your Windows folder or a subfolder thereof. Select Search and then For Files or Folders from the Start Menu, type c:\windows in the Look in field (assuming Windows is installed on drive c:), and type the filename as described later in the Search for files or folders named field. For example, to search for all files with the .tmp filename extension, you would use the asterisk wildcard character, like this: *.tmp.

Note that this is only a guideline; I'm not instructing you to delete all of these files (okay, maybe I am a little). If you're in doubt about a specific file, see the "If in doubt" section that follows for details on finding out what's inside of most types of files. The following files are typically safe to delete:

  • Any file with the filename extension: *.log, *.old, *.- - -, *.bak, and *.000, *.001, *.002, and so on.

  • Any files with the extensions *.bmp (bitmap files), *.wav (sound clips), and *.avi (video clips). These can take up a great deal of space and are usually superfluous.

  • In the Windows folder only, there are a ton of text files (*.txt), which are essentially "Readme" and log files and can be safely deleted. Double-click any text file to view its contents.

  • Any files or folders found in your \Windows\Temp folder. You won't be able to delete some files in this folder, because they will be in use by whatever applications you may have open. But applications in previous Windows sessions may not have deleted files there, and those types of files tend to accumulate very rapidly. It's not uncommon to find dozens of megabytes of useless files here. If you find files in your Temp folder that have a date and time earlier than the last time you started your computer, you can safely delete them. See "Mirror a Folder with Folder Shortcuts" in Chapter 4 for more information on the Temp folder.

  • The following file dates are common to older versions of Windows (releases other than the American English editions may have different dates); some files with these dates may still be around if you've upgraded to Windows XP:

July 11, 1995, 9:50 AM
Windows 95
August 2, 1996, 1:30 AM
Windows NT Workstation 4.0
August 12, 1996, 3:50 PM
Windows 95 OSR2
May 11, 1998, 8:01 PM
Windows 98
April 23, 1999, 10:22 PM
Windows 98 Second Edition
December 7, 1999, 5:00 AM
Windows 2000 Professional
June 8, 2000, 5:00 PM
Windows Me


  • See "Mirror a Folder with Folder Shortcuts" in Chapter 4 for more information on all the extra empty folders that Windows won't let you delete.

5.2.2.2 Files found elsewhere on your system

In addition to those files in your Windows folder, there are plenty of files elsewhere that you can consider deleting:

  • There are some unnecessary files in the root directory of your boot drive (usually c:\); these include files with the extensions *.txt, *.prv, *.log, *.old, and *.- - -. Most files with the *.dos extension (except for Bootsect.dossee "Files NOT to delete" later in this chapter) are also safe to delete.

  • Other files that can be deleted include Mscreate.dir, an absolutely useless, empty, hidden file created by older Microsoft application installers. There may be hundreds of these empty files on your hard disk.

  • Folders named ~Mssetup.t, msdownld.tmp, WUTemp, or something similar are temporary folders created when some applications or Windows updates are installed. They can all be removed, as long as you've restarted your computer since said installation took place.

  • If you're trying to create more disk space, you can also delete application help files (*.hlp and *.chm) you may never need (as a last resort). Also, many applications include bitmaps (*.bmp), sound clips (*.wav), and video clips (*.avi , *.mov, and *.mpg), which take up enormous amounts of disk space for virtually no reason. To view a video clip before deleting it, just double-click the file icon.

5.2.2.3 Files NOT to delete

In your travels, you may encounter some of the following files, all of which should be left alone:

  • Any files in your root directory not mentioned earlier should be left alone. This includes Bootsect.dos, Boot.ini, Ntldr, and Ntdetect.com, all parts of the Boot Manager (discussed in Chapter 1). You may also see Io.sys, Msdos.sys, and Command.com, if you've set up a dual-boot system with Windows 9x/Me.

  • Be extremely careful with anything in the \Windows, \Windows\System, and \Windows\System32 folders, as these files may be vital Windows support files.

  • Your Registry hive files, discussed in Chapter 3, should never be moved or deleted.

  • Any files and folders in your \Program Files or \Windows\MSAPPS directories that have names like Microsoft Shared and Common Files. These files can be used by several applications simultaneously, which is why they haven't been placed in the folders of the applications that put them there.

5.2.2.4 If in doubt

Before you delete any questionable file, there are several things you can do to get a better idea of what the file contains:

  • Start by double-clicking a suspicious file to open it in its default application. If you then see the Open With dialog box, it means the specific filename extension has not yet been registered. In that case, your best bet is to drag-drop the file into an open Notepad window.

  • Right-click the file, and select Properties. If the file has a Version tab, it's likely an application, driver, DLL, or other support file. Choose it to view the manufacturer, copyright date, and possibly the application it accompanies.

  • If you're not sure if something should be deleted but want to try anyway, move it to another directory first to see if everything works without it for a week or so. If all is clear, toss it.

  • Check the file's Last Accessed date (right-click it, and select Properties). The more recent the date, the more likely it's still being used. For information on removing a particular application, contact the manufacturer of that application or refer to the application's documentation.

5.2.2.5 Special consideration: hidden files

Some files on your hard disk are hidden filesfiles that, by default, can't be seen in Explorer. To configure Explorer to show hidden files, go to Control Panel Show hidden files and folders option. All hidden files will become visible, but their icons will remain somewhat transparent.

Most hidden files have been hidden to protect them from deletion. If you see a hidden file, think twice before deleting it for this reason. On the other hand, some hidden files are truly unnecessary and are hidden only to reduce the clutter they would otherwise generate. An example is the temporary hidden file Microsoft Word creates alongside every open document.

To hide or unhide a file, right-click its icon and select Properties. Check or uncheck the Hidden option as desired, and click OK.[3]

[3] The Attrib command in DOS is used to list the attributes of files (e.g., Hidden, Read-only), as well as to turn those attributes on or off. It's also the only way to turn on or off a file's System attribute. See Chapter 10 for details.

5.2.2.6 Special consideration: System File Protection and System Restore

When I first installed Windows XP, I proceeded to delete the superfluous Internet Connection Wizard folder,[4] as I do whenever I install a new version of Windows. This time, I was in for a surpriseseconds after I deleted it, I saw it reappear as though Windows was telling me, "Just kidding!"

[4] Windows runs the Internet Connection Wizard once: the first time you try to access the Internet after installing Windows XP, regardless of whether you already have a dial-up Networking connection configured. In some cases, you'll see this useless wizard appear again and again.

It turned out to be the System File Protection feature, which continually scans your system, replacing system files as it sees fit. Unfortunately, this approach creates several problems, not the least of which is the 12% of your hard drive's total capacity it consumes. See "Working with Restore Points" in Chapter 6 for more information on this feature, as well as on the related feature, System Restore.

If you do decide to disable System File Protection, you can then safely delete the Internet Connection Wizard.

5.2.3. Optimize Virtual Memory and Cache Settings

One of the most frustrating and irritating things about Windows is the way that it can seize up for several seconds with seemingly random, pointless disk activity. This is caused by the way that Windows handles disk virtual memory by default.

Normally, Windows loads drivers and applications into memory until it's full and then starts to use part of your hard disk to "swap" out information, freeing up more memory for higher-priority tasks. The file that Windows uses for this type of "virtual memory" is the paging file (aka swapfile), pagefile.sys, and is stored in the root folder of your hard disk.

Because your hard disk is so much slower than physical memory, the more Windows does this swapping, the slower your computer will be. Naturally, adding more memory will reduce Windows's appetite for virtual memory. But regardless of the amount of installed physical memory in your system, there are always things you can do to improve virtual memory performance.

Windows's defaults here are rather conservative and can fortunately be modified for better performance. It's important to realize, though, that some experimentation may be required to achieve the best configuration for your setup. Different hardware, software, and work habits require different settings; those with ample hard disks, for instance, can afford to devote more disk space to virtual memory, while others may simply wish to place a cap on the disk space Windows consumes.

5.2.3.1 Part 1: Virtual memory settings

One of the reasons the default settings yield such poor performance is that the swapfile grows and shrinks with use, quickly becoming very fragmented (as illustrated by Figure 5-5, earlier in this chapter). The first step is to eliminate this problem by setting a constant swapfile size.

Note that making the swapfile constant will also result in a more constant amount of free disk space. If your hard disk is getting full, consider this solution to restrict Windows from using up every bit of free space:

  1. Double-click the System icon in the Control Panel, choose the Advanced tab, and click Settings in the Performance section. Choose the Advanced tab here, and then click Change. You'll see the Virtual Memory window, shown in Figure 5-6.

    Figure 5-6. Change the way Windows handles virtual memory to improve overall system performance


  2. The virtual memory settings are set for each drive in your system independently. If you have only one drive, virtual memory will be enabled for that drive. If you have more than one drive, virtual memory will be enabled, by default, only on the drive on which Windows is installed.

    For each drive, you have three choices, all of which should be pretty self-explanatory. The total disk space for all drives is shown at the bottom of the window.

    Important: after you've made a change for any drive, click Set to commit the change before moving onto another drive or clicking OK.

  3. To specify a constant size, select Custom size, and then type the same value for both Initial size and Maximum size.

    The size, specified in megabytes, is up to you. I typically use three times the amount of installed RAM (e.g., 1536 MB of virtual memory for 512 MB of physical memory), but you may wish to experiment with different sizes to find the one that works best for you.

    Some users have had limited success disabling virtual memory altogether, although I wouldn't recommend it. The theory is that if there's enough physical memory installed, and virtual memory is completely disabled, Windows will access the hard disk much less often. It may be worth a try if you have at least 512 MB of physical memory, but you may find that certain programs won't run without at least some virtual memory. It's even possible that eliminating the swapfile will prevent Windows from loading altogether.


  4. Press OK on each of the three open dialogs. If you have only resized your swapfile, you won't have to restart. However, if you've added (or removed) a swapfile on a different drive, Windows will prompt you to restart at this point.

5.2.3.2 Part 2: Defragment the paging file

Part 1 will eliminate the possibility of your swapfile becoming fragmented, but it won't defragment an already fragmented swapfile. You'll need to defragment it at least once for it to remain that way in the future. See Figure 5-5, earlier in this chapter, for details on file fragmentation. Note that this is not an easy task if you don't have the right tools. Here are several ways to accomplish this:

  • If you have Norton Utilities (http://www.symantec.com), you'll be able to optimize the swapfile fairly easily using its Speed Disk utility. Speed Disk is also able to move your swapfile to the physical beginning of your partition, which can also theoretically improve performance. The Disk Defragmenter utility that comes with Windows XP (dfrg.msc) is actually a scaled-down version of Norton Speed Disk, but it is not capable of defragmenting the swapfile.

  • If you don't have software capable of defragmenting your swapfile, there are two alternatives. If you have more than one partition or hard disk in your system, start by moving your swapfile to a different drive letter (see the previous section for details). Then, run Disk Defragmenter (dfrg.msc) on the partition you wish to hold the swapfile permanently, which will set aside a large chunk of contiguous free space. Lastly, move the swapfile back to the original partition, making sure its size is set constant.

  • If you don't have a second partition, your other choice is to disable virtual memory temporarily by clicking No paging file and then Set in the Virtual Memory window (see Figure 5-6). After restarting Windows, run Disk Defragmenter (dfrg.msc) to set aside a large chunk of contiguous free space. When you're done, go back to the Virtual Memory window, and re-enable the paging file, making sure to set a constant size.

Note that if you have fewer than 256 MB of physical memory, there is a risk that Windows may not boot properly without a paging file. If this happens, you should be able to load Windows in Safe Mode and re-enable your swapfile. See "What to Do when Windows Won't Start" in Chapter 6 for details.


5.2.3.3 Part 3: Clear the paging file on shutdown

It's possible to have Windows delete your paging file whenever you shut down Windows. There are three reasons you might want to do this:

  • If you have a multiboot system, as described in Chapter 10, each operating system on your computer will have its own virtual memory settings. If the paging file from one OS is present while the other is running, it may cause a conflict and will certainly waste a lot of disk space.

  • If your paging file becomes corrupted or highly fragmented, Windows may load more slowly (or not at all). Deleting the paging file will force Windows to re-create it the next time it starts, which may alleviate this problem.

  • If you're concerned about the security of your data, it is theoretically possible for a hacker to extract sensitive information from your paging file.

Naturally, if you've gone through the steps to defragment your paging file, as described earlier in this topic, you probably won't want it to be deleted (lest it become fragmented when it is re-created).

Here's how to do it:

  1. Open the Local Security Settings console (secpol.msc). See Chapter 7 for more information on the settings in this window.

  2. Navigate to Security Settings\Local Policies\Security Options.

  3. Double-click the Shutdown: Clear virtual memory pagefile entry on the right.

  4. Select Enabled and then click OK. You'll need to restart Windows for the change to take effect.

5.2.3.4 Part 4: Advanced settings for the adventurous

Like virtual memory settings, disk cache settings in Windows XP aren't necessarily optimized for the best performance, but rather for the best compromise between performance and compatibility with older computers.

Each of these settings, as described here, will typically benefit only those with large amounts of physical memory (at least 384 MB). Those with less memory (under 256 MB) may not see any performance increase; in fact, some of these settings may actually degrade system performance if your system has too little RAM. Essentially, you'll want to experiment with different values until you find ones that work best for your system.

Entering incorrect values for some of these settings can render Windows inoperable. Make sure you have a recent backup before you continue, not only of your system, but of the specific Registry key discussed (using a Registry patch, explained in Chapter 3).


Start by opening the Registry Editor (described in Chapter 3) and expanding the branches to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management. Some of the more interesting values in this key include the following:[5]

[5] If any of the keys listed here are not present, they can be added by going to Edit

DisablePagingExecutive

Values: 0 = disabled (default), 1 = enabled

Enabling this setting will prevent Windows from paging certain system processes to disk, which effectively will keep more of the operating system in the faster physical memory, which, in turn, will make Windows much more responsive.


IoPageLockLimit

Values: varies

This value, in bytes, specifies the maximum amount of memory that can be used for input/output operations. Since this setting deals with the transfer of data into and out of your computer, it will be of the biggest benefit to those running servers and those who use their network or Internet connections most heavily.

The default value is 512 KB (524,288 bytes), but increasing it should improve performance. This value is specified in bytes (not MB) and must be entered in Hexadecimal mode.[6] Recommended values, based on the amount of physical memory in your system, are shown in Table 5-1.

[6] When editing DWORD Values in the Registry, you can choose the Base to use (Hexadecimal or Decimal). If you use the incorrect base, the value you type will have a different meaning. See Chapter 3 for details.

Table 5-1. Recommended values for the IoPageLockLimit setting

Amount of physical RAM

Recommended value

Maximum value

128 MB

4194304 bytes (4 MB)

physical RAM minus 16MB

256 MB

10485760 bytes (10 MB)

physical RAM minus 32MB

512 MB or more

41943040 bytes (40 MB)

physical RAM minus 64MB



LargeSystemCache

Values: 0 = standard (default), 1 = large

By default, Windows uses only 8 MB of memory for the filesystem cache. Enabling this option will allow Windows to use all but 4 MB of your computer's memory for the filesystem cache. This will improve Windows performance, but potentially at the expense of the performance of some of your more memory-intensive applications.

This option can also be changed by going to Control Panel Settings in the Performance section, and then choosing the Advanced tab. The Memory usage section has two settings: Programs and System cache, which correspond to the 0 and 1 values here.

Other values in this key include PagingFiles, which is more easily set in the Virtual Memory window described in "Part 1: Virtual memory settings" and ClearPageFileAtShutdown, more easily set in the Local Security Settings console, as described in "Part 3: Clear the paging file on shutdown."

5.2.4. Choosing the Right Filesystem

The filesystem is the invisible mechanism on your hard disk that is responsible for keeping track of all the data stored on the drive. Think of the filesystem as a massive table of contents, matching up each filename with its corresponding data stored somewhere on the disk surface. Windows XP supports three different filesystem types:[7]

[7] There's actually a fourth type, CDFS, used by CD-ROMs.


FAT (File Allocation Table, 16-bit)

FAT is used for all drives under 512 MB, including floppy and ZIP disks. The largest drive supported by the FAT filesystem is 2GB, which is why older drives larger than 2GB were often divided into several partitions.


FAT32 (File Allocation Table, 32-bit)

Designed to overcome the 2 GB partition limit of the FAT system, FAT32 is supported by newer operating systems. In addition to the support for larger drives, it also supports smaller file clusters (described later), so it's more efficient than FAT.


NTFS (NT Filesystem)

NTFS was designed from the ground up to completely replace FAT/FAT32. It supports encryption, compression, and robust security,[8] and is typically more reliable than FAT/FAT32 as well.

[8] The encryption and security features of NTFS are discussed in Chapter 7. NTFS compression is discussed in "Increasing Disk Space (or What to Throw Away)" earlier in this chapter.

If Windows XP is the only operating system on your computer, you should be using NTFSno question. The only compelling reason to use another filesystem is if you have a dual-boot setup with an earlier version of Windows, in which case you'd need to choose a filesystem recognized by all operating systems on your computer. See the "Filesystems and Multiple Drives" sidebar for more information. Table 5-2 shows which filesystems are supported by recent versions of Microsoft Windows.

Table 5-2. Filesystems supported by recent versions of Windows
 

FAT

FAT32

NTFS

Windows XP

Windows 2000

Windows Me, 98, and 95 ORS2

 

Windows NT 4.0

 

Windows 95

  


To find out which filesystem is currently being used by a particular drive, just right-click the drive in Explorer (or My Computer), and select Properties. Figure 5-7 shows the drive-properties window for an NTFS partition. You can also open the Disk Management utility (diskmgmt.msc) to see an overview of all of your drives.

Figure 5-7. Use a drive's properties sheet to see which filesystem it's currently using


Note that some of the elements on the drive-properties window won't be present for non-NTFS drives, such the Security and Quota tabs and the Compress drive and Allow Indexing options.

Filesystems and Multiple Drives

If you have more than one drive on your system, whether they're separate physical drives or separate partitions of the same drive, they can have different filesystems. This is common on multiboot systems (discussed in Chapter 1 ), where each OS will reside on a different partition. Just keep in mind the filesystem compatibility shown in Table 5-2; if you have Windows 98 on a FAT32 partition and Windows XP on an NTFS partition, the XP partition will be invisible to the 98 installation but both drives will be visible and accessible from the XP installation.


5.2.4.1 Convert your drives to NTFS

If you're not using NTFS on your drive and you don't need to support FAT/FAT32 for compatibility with other operating systems, you can convert your drive to NTFS quite easily, and without harming your data. For example, if you've upgraded to Windows XP from Windows 9x/Me, and you didn't elect to convert your drive(s) to NTFS during setup, you are likely still using FAT32.

Windows XP comes with the FAT to NTFS Conversion Utility (convert.exe), which is used as follows. To convert drive c:, for example, just open a command-prompt window (cmd.exe) and type the following:

convert c: /fs:ntfs

The following options are also available for this utility:


/v

Run in verbose mode (provide more information).


/cvtarea :filename

Specifies a contiguous file, filename, in the root directory as the placeholder for NTFS system files.


/nosecurity

Include this parameter if you want the initial security privileges for all files and folders on the newly converted volume to be set so the files and folders are accessible by everyone.


/x

Forces the volume to dismount first, if necessary closing any opened files on the volume. Use this option if you're on the network and there's concern that other users may attempt to access the drive during the conversion process.

Note that this is a one-way conversion, at least when using the software included with Windows XP. If you need to convert an NTFS drive to FAT32 for some reason, you'll need a third-party utility such as PartitionMagic (http://www.symantec.com/partitionmagic/).

5.2.4.2 Understanding cluster sizes

Clusters are the smallest units into which a hard disk's space can be divided. A hard disk formatted with the traditional FAT system, found in Windows 95 and all previous versions of Windows and DOS, can have no more than 65,536 clusters on each drive or partition. This means that, the larger the hard disk, the larger the size of each cluster. The problem with large clusters is that they result in a lot of wasted disk space. Each cluster can store no more than a single file (or a part of a single file); if a file does not consume an entire cluster, the remaining space is wasted. For example, a 2 GB drive would have a cluster size of 32 KB; a 1 KB file on a disk with a 32 KB cluster size will consume 32 KB of disk space; a 33 KB file on the same drive will consume 64 KB of space, and so on. The extra 31 KB left over from the 33 KB file is called slack space, and it can't be used by any other files. With thousands of files (especially those tiny shortcuts littered throughout a Windows installation), the amount of wasted slack space on a sizeable hard disk can add up to hundreds of megabytes of wasted space.

The NTFS and FAT32 filesystems supported by more recent versions of Windows can handle over four billion clusters,[9] resulting in much smaller cluster sizes. The same 2 GB drive formatted with FAT32 or NTFS will have only a 4 KB cluster size. Figure 5-8 illustrates the slack space created by files stored on a traditional FAT system versus the same files stored on a FAT32 or NTFS drive.

[9] Four billion clusters, at 4 KB each, results in a maximum partition size of 14.9 terabytes (15,259 GB) for FAT32 and NTFS volumes. Of course, if this drive were commercially available, its manufacturer would contend that 1 terabyte is equal to 1,000,000,000,000 bytes, and advertise the unit as a 16.4 TB (16,384 GB) drive.

Figure 5-8. FAT32 stores files more efficiently by allowing smaller cluster sizes


You can see how much space is wasted by any given file by right-clicking on the file icon, selecting Properties, and comparing the Size value with the Size on disk value. The same works for multiple selected files and folders; highlight all the objects in your root directory to see the total amount of wasted space on your drive. To find the current cluster size of your drive, just open the properties sheet for a small file you know will only consume a single cluster (such as a Windows Shortcut); its Size on disk will be equal to the size of one cluster.

So, what does this all mean? It means that if you convert a drive from FAT to FAT32, you will definitely reclaim some wasted space. But, since FAT32 and NTFS drives have the same cluster size (4 KB), there is no slack-space incentive to convert to NTFS. In fact, the extra features of NTFS (discussed earlier in this section) have slightly more overhead, and thus a conversion from FAT32 to NTFS will most likely result in slightly less overall free disk space.

5.2.5. Advanced NTFS Settings

As mentioned in the last section, the extra features of the NTFS filesystem come at a price: a small amount of disk space and performance overhead. The following settings allow you to fine-tune NTFS to squeeze the most performance out of your NTFS drive; experiment with these settings to find the configuration that works best for you.

Note that these settings will have no effect for non-NTFS drives. See "Choosing the Right Filesystem," earlier in this chapter, for more information.

Start by opening the Registry Editor (described in Chapter 3), and expanding the branches to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Filesystem. There are three values here that concern us:[10]

[10] If any of the keys listed here are not present, they can be added by going to Edit

NtfsDisable8dot3NameCreation

Values: 0 = enabled (default), 1 = disabled

Early versions of Windows and DOS did not support long filenames, but rather allowed only eight-character filenames followed by three-letter filename extensions. Although Windows 95 and all subsequent versions of Windows eliminated this restriction,[11] an eight-dot-three version of the filename was always generated to maintain compatibility with older applications. For example, the file, A letter to Mom.wpd would also be referenced as alette~1.wpd. If you don't use older 16-bit programs, either on your computer or on your network, you can disable Windows XP's creation of these 8.3 aliases by changing this value to 1 (the default is zero).

[11] Long filenames can be practically as long as you like, and can, for example, include spaces.


NtfsDisableLastAccessUpdate

Values: 0 = enabled (default), 1 = disabled

Windows keeps a record of the time and date every file and folder on your hard disk was created, as well as when it was last modified and last accessed. You can stop Windows from updating the "last accessed" date for folders every time they're opened by changing the value to 1 (the default is zero), which should improve drive performance. This setting has no effect on files.


NtfsMftZoneReservation

Values: 1 = small (default), 2 = medium, 3 = large, 4 = maximum

The core of the NTFS filesystem is the master file table (MFT), a comprehensive index of every file on the disk (including the MFT itself). Since disk defragmenters can't defragment the MFT (also known as $mft), Windows reserves a certain amount of extra space for it to grow, in an effort to reduce its eventual fragmentation. The more fragmented the MFT gets, the more it will hamper overall disk performance.[12]

[12] See "A Defragmentation Crash Course," earlier in this chapter, for more information.

You can determine the current size and fragmentation level of the MFT on any drive by opening Disk Defragmenter (dfrg.msc). Select a drive from the list, click Analyze, and then View Report (see Figure 5-9). The numbers relating to the MFT are shown at the end of the Volume Information report. Probably the most interesting statistic here, though, is Percent MFT in use. The higher the number, the less space the MFT has to grow (and it will).[13]

[13] For example, a 40 MB MFT file with 88 percent in use has 4.8 MB of empty space reserved for it, which means roughly 4,800 more files can be added to the volume before Windows increases the MFT, probably creating more fragments.

Figure 5-9. Find the size and fragmentation of the Master File Table (MFT) by viewing Disk Defragmenter's report for NTFS volumes


The NtfsMftZoneReservation setting allows you to increase the space reserved for the MFT. Although the default is 1, values of 2 or 3 are probably better for most systems with large hard disks; the maximum value of 4 is good for very large drives with a lot of small files. Specify too small of a value here, and the MFT will become fragmented more quickly as it grows; too large of a value, and it will consume (waste) too much disk space.

The problem is that changing this setting will not result in any modification of the current MFT, but rather only influence its future growth. For this reason, the earlier this value is increased in the life of a disk, the better. Unfortunately, the only way to defragment or rebuild the MFT is to format the drive.

You'll need to restart Windows for any of these changes to take effect.

5.2.6. What to Look for in a New Hard Disk

The speed of your hard disk is a major factor of your system's overall performance. After all, the faster it's able to find data and transfer it to your system's bus, the faster Windows will load, the faster your virtual memory will be, and the faster you'll be able to copy files.

If you're thinking of upgrading your hard disk (see "Transfer Windows to Another Hard Disk or System" in Chapter 5), there are several measures of speed that you should scrutinize when choosing a drive:


Seek time (measured in milliseconds)

The seek time (or access time) is the average length of time required to find a piece of information; lower times are faster. There are a few variants, such as track-to-track and full stroke, and there are often separate measurements for reading and writing data. But the average seek time is the one that is most often advertised; don't settle for anything slower than about 9 ms.


Transfer rate (measured in megabytes per second)

This is the amount of data the drive can transfer to your motherboard's data bus in a second; higher transfer rates are faster. Although the maximum burst transfer rate is the one most often advertised (typically in the hundreds of megabytes per second), the maximum sustained transfer rate is probably the more important of the two.


RPM (measured in revolutions per minute)

This is the speed at which the disk spins; higher numbers are faster. Cheaper drives spin at 5400 rpm, but don't settle for anything less than 7200 rpm. If you're serious about performance, look for a more expensive 10,000 rpm (10k) or 15,000 rpm (15k) drive.


Buffer (measured in megabytes)

The buffer is memory (RAM) installed in the drive's circuitry, allowing it to accept data from your computer faster than it is able to physically write to the disk surface, and read data from the disk surface faster than it's able to transfer data to your computer. A larger buffer is better; don't settle for less than 8 megabytes.

Whether you're shopping for a new hard drive or just trying to determine if your existing drive is as fast as it should be, these measurements should give you enough to go on. If your drive seems excessively slow, you can either replace it or try some of these solutions:

  • Add more RAM (see "Memory" earlier in this chapter).

  • Get more free space. Either delete some files or replace your hard disk with a larger one (or add another drive). Regardless of the amount of RAM you have, Windows will still need a substantial amount of space for virtual memory and temporary files. If you run out of space, Windows will slow down and will be more likely to crash.

  • Defragment your hard disk by running Disk Defragmenter (dfrg.msc).

  • Put your hard disk on its own controller, so it isn't sharing the cable with any other drives. For instance, if your hard disk is connected to your primary IDE controller, plug your CD/DVD drive into your secondary IDE controller.

Scan your system for spyware, discussed at the beginning of this chapter.

5.2.7. 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 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 several ways, explained in the following solutions. The one you choose depends on your available hardware and specific needs. If you just purchased a new hard disk, you need to prepare it by partitioning and formatting it before you continue. See "Working with Partitions," later in this chapter, for details.

5.2.7.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 such as Norton Ghost (http://www.symantec.com).[14]

    [14] Now-defunct alternatives to Norton Ghost include the excellent DriveCopy and Drive Image utilities from PowerQuest (now Symantec). Although they're not commercially available anymore, if you can find XP-compliant versions of either tool (in your closet or perhaps on eBay), they're worth a try.

    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 from this point forward 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 up 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.

5.2.7.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 up 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 in Chapter 1.

    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 Chapter 10 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 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. (See "Set up a Dual-Boot System" in Chapter 1 for more information on the boot.ini file.)


5.2.7.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 solution. 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 "Backing Up the Registry" in Chapter 3 for more information user settings, and all of Chapter 7 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.

5.2.8. 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 240 GB hard disk, you may wish to have three 80 GB partitions, or perhaps a 100 GB partition and two 70 GB partitions. There are several reasons why you might want to do something like this:


Organization

Use multiple partitions to further organize your files. For example, put Windows on one drive, work documents on another, games on another, and music and other media on yet another.


Isolation of system and data

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 swapfile. This gives you the distinct advantage of being able to format your operating system partition and reinstall Windows without touching your personal data. (See Chapter 8 for help relocating personal folders, such as My Documents.)


Performance

As illustrated in "A Defragmentation Crash Course," earlier in this chapter, your hard drive can become fragmented very quickly, which can decrease performance and increase the chances of data corruption. Because files cannot become fragmented across partition boundaries, splitting your drive into several partitions will isolate groups of files and thus help curb their fragmentation. Plus, in the event that a single partition becomes significantly fragmented, its smaller size will mean it can be defragmented in much less time.

Isolate your swapfile on its own partition to allow it to grow and shrink as needed, without becoming fragmented as it would if it shared a drive with other files. See "Optimize Virtual Memory and Cache Settings," earlier in this chapter, for details.



Dual-boot

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


Multiple users

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


Web Server

If you're setting up a web server (or other type of network file server) or if you're participating in peer-to-peer file sharing, 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.


Consolidation

If you're using an older computer that has been upgraded to Windows XP, your hard disk may have been partitioned to work around a limitation in the earlier version of Windows (described in "Choosing the Right Filesystem," earlier in this chapter). Using the tools discussed in this section, you can consolidate those drives into a single partition and possibly make more efficient use of your free space.

5.2.8.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.[15]

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

The main Disk Management window, as shown in Figure 5-10, is divided into two parts. You can change the arrangement of the panes in this window by going to View View Figure 5-10. Open the Disk Management utility to add or remove partitions, shuffle drive letters, and even change the way volumes are mounted


There 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 5-10), 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 Management, 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 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.[16]

[16] 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 Action 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.

5.2.8.2 Customizing Disk Management

The Disk Management tool is actually what Microsoft calls a "snap-in" for the Microsoft Management Console (MMC) application.[17] 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.

[17] 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 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 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 5-11 shows a custom console file with a bunch of useful snap-ins, all accessible from the same window.

    Figure 5-11. 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


  7. You can further customize this window as you see fit. When you're done customizing, go to File The next time you 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" in Chapter 1 for more information.

    Finally, PartitionMagic (http://www.symantec.com/partitionmagic/) 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.


    5.2.8.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 filesystems[18] 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.

    [18] See "Choosing the Right Filesystem" in for more information on filesystems. Examples of filesystems not supported by Windows XP include Linux and Unix partitions

    You can change how any volume on your system is mounted,[19] except for the system volume (the one containing your boot files) and the boot volume (the one on which Windows is installed).[20] 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.

    [19] 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.

    [20] 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 5-10, 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 5-12, 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 5-12. 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


    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 "Choosing the Right Filesystem," earlier in this chapter) 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 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.

    5.2.8.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).[21]

      [21] 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 "Resizing and moving partitions," 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 filesystem 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 filesystem, you'll want to use the NTFS filesystem in most cases (see "Choosing the Right Filesystem" earlier in this chapter).

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

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

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



      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 (since 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.

    5.2.8.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 example 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 you 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.[23]

      [23] 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).

      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 (see "A Defragmentation Crash Course") 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.


    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.symantec.com/partitionmagic/), which can not only expand and shrink partitions, but move them as wellall without erasing 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.



    Windows XP Annoyances For Geeks
    Fixing Windows XP Annoyances
    ISBN: 0596100531
    EAN: 2147483647
    Year: 2003
    Pages: 97
    Authors: David A. Karp

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