Windows XP Professional saves files and folders in the first available space on a hard disk and not necessarily in an area of contiguous space. The parts of the files and folders are scattered over the hard disk rather than being in a contiguous area. This scattering of files and folders across a hard disk is known as fragmentation. When your hard disk contains numerous fragmented files and folders, your computer takes longer to access them because it requires several additional reads to collect the various pieces. Creating new files and folders also takes longer because the available free space on the hard disk is scattered. Your computer must save a new file or folder in various locations on the hard disk.
Temporary files, Internet cache files, and unnecessary programs also take up space on your computer's hard drive. Sometimes there are file system errors and sometimes sectors on your hard disk go bad, which can cause you to lose data you have stored on your hard disk. This lesson introduces three Windows XP Professional tools-Disk Defragmenter, Check Disk, and Disk Cleanup-that help you organize your hard disks, recover readable information from damaged areas on your hard disk, and clean up any temporary files and unnecessary programs taking up space on your hard drive.
The process of finding and consolidating fragmented files and folders is called defragmenting. Disk Defragmenter locates fragmented files and folders and defragments them by moving the pieces of each file or folder to one location so that each occupies a single, contiguous space on the hard disk. Consequently, your system can access and save files and folders more efficiently. By consolidating files and folders, Disk Defragmenter also consolidates free space, making it less likely that new files will be fragmented. Disk Defragmenter can defragment FAT, FAT32, and NTFS volumes.
You access Disk Defragmenter by selecting Start, pointing to All Programs, pointing to Accessories, pointing to System Tools, and then clicking Disk Defragmenter. The Disk Defragmenter dialog box is split into three areas, as shown in Figure 14.8.
The upper portion of the dialog box lists the volumes that you can analyze and defragment. The middle portion provides a graphic representation of how fragmented the selected volume is. The lower portion provides a dynamic representation of the volume that continuously updates during defragmentation. The display colors indicate the condition of the volume as follows:
By comparing the Analysis Display band to the Defragmentation Display band during and after defragmentation, you can easily see the improvement in the volume.
You can also open Disk Defragmenter by selecting a drive you want to defragment in Windows Explorer or My Computer. On the File menu, click Properties, click the Tools tab, and click Defragment Now. Then select one of the options described in Table 14.6.
Table 14.6??Disk Defragmenter Options
Figure 14.9 shows the Disk Defragmenter dialog box after you have analyzed the C drive. Windows XP Professional displays another Disk Defragmenter dialog box indicating that you need to defragment the volume. You can view a report showing more details about the fragmentation on your volume, close the dialog box and run the defragmenter at a later time, or defragment the volume now.
If there is not enough fragmentation to require you to defragment the volume, Windows XP Professional displays a Disk Defragmenter dialog box indicating that there is no need to defragment the volume at this time.
The following list provides some guidelines for using Disk Defragmenter:
Check Disk attempts to repair file system errors, locate bad sectors, and recover readable information from those bad sectors. All files must be closed for this program to run. To access Check Disk, select the drive you want to check in Windows Explorer or My Computer. Click the File menu, click Properties, click the Tools tab, and click Check Now. Select one of the options on the Check Disk dialog box shown in Figure 14.10. The options are explained in Table 14.7.
Table 14.7??Check Disk Options
Check box | Description |
---|---|
Automatically Fix File System Errors |
Select this check box to have Windows XP Professional attempt to repair file system errors found during disk checking. All files must be closed for this program to run. If the drive is currently in use, a message asks you if you would like to reschedule the disk checking for the next time you restart your computer. Your drive is not available to run other tasks while the disk is being checked. |
Scan For And Attempt Recovery Of Bad Sectors |
Select this check box to have Windows XP Professional attempt to repair file system errors found during disk checking, locate bad sectors, and recover any readable information located in those bad sectors. All files must be closed for this program to run. If the drive is currently in use, a message asks you if you would like to reschedule the disk checking for the next time you restart your computer. Your drive is not available to run other tasks while the disk is being checked. If you select this check box, you do not need to select Automatically Fix File System Errors because Windows XP Professional attempts to fix any errors on the disk. |
You can also use the command-line version of Check Disk. The command-line syntax for Chkdsk is as follows:
Chkdsk [volume[[path]filename]]] [/f] [/v] [/r] [/x] [/i] [/c] [/l[:size]]
The switches used by Chkdsk are explained in Table 14.8.
Table 14.8??Chkdsk Switches
Switch | Description |
---|---|
Filename |
Specifies the file or set of files to check for fragmentation. You can use the wildcards * and ?. This switch is only valid on volumes formatted with FAT12, FAT16, and FAT32 file systems. |
Path |
Specifies the location of a file or set of files within the folder structure of the volume. This switch is only valid on volumes formatted with FAT12, FAT16, and FAT32 file systems. |
Size |
Changes the log file size. You must use the /l switch with this switch. This switch is only valid on volumes formatted with NTFS. |
Volume |
Specifies the drive letter (followed by a colon), mount point, or volume name. This switch is only valid on volumes formatted with FAT12, FAT16, and FAT32 file systems. |
/c |
Skips the checking of cycles within the folder structure. This switch is only valid on volumes formatted with NTFS. |
/f |
Fixes errors on the volume. If Chkdsk cannot lock the volume, you are prompted to have Chkdsk check it the next time the computer starts. |
/i |
Performs a less vigorous check of index entries. This switch is only valid on volumes formatted with NTFS. |
/l |
Displays the current size of the log file. This switch is only valid on volumes formatted with NTFS. |
/r |
Locates bad sectors and recovers readable information. If Chkdsk cannot lock the volume, you are prompted to have Chkdsk check it the next time the computer starts. |
/v |
On volumes formatted with FAT12, FAT16, or FAT32, displays the full path and name of every file on the volume. On volumes formatted with NTFS, displays any cleanup messages. |
/s |
Forces the volume to dismount first, if necessary. |
/? |
Displays this list of switches. |
Used without parameters, Chkdsk displays the status of the disk in the current volume.
You can use Disk Cleanup to free up disk space by deleting temporary files and uninstalling programs. Disk Cleanup lists the temporary files, Internet cache files, and unnecessary programs that you can safely delete. To access Disk Cleanup, select the drive you want to check in Windows Explorer or My Computer. On the File menu, click Properties, and in the General tab, click Disk Cleanup. The Disk Cleanup dialog box is shown in Figure 14.11 and its options are explained in Table 14.9.
Table 14.9??Disk Cleanup Deletion Options
Check box | Description |
---|---|
Downloaded Program Files |
Select this check box to have Windows XP Professional delete theActiveX controls and Java applets that have been downloaded automatically from the Internet when users viewed certain pages. These files are temporarily stored in the Downloaded Program Files folder on the computer's hard disk. |
Temporary Internet Files |
Select this check box to have Windows XP Professional delete the files in the Temporary Internet Files folder on the computer's hard drive. These files are Web pages stored on the hard disk for quick viewing. Users' personalized settings for Web pages are not deleted. |
Recycle Bin |
Select this check box to have Windows XP Professional delete thefiles in the Recycle bin. When you delete a file from your computer, it is not permanently removed from the computer until the Recycle Bin is emptied (by deleting the files contained in the Recycle Bin). |
Temporary Files |
Select this check box to have Windows XP Professional delete any Temporary files on this volume. Programs sometimes store temporary information in a Temp folder. Before a program closes, it usually deletes this information. You can safely delete temporary files that have not been modified in more than a week. |
WebClient/Publisher Temporary Files |
Select this check box to have Windows XP Professional delete any temporary WebClient/Publisher files. The WebClient/Publisher service maintains a cache of accessed files on this disk. These files are kept locally for performance reasons only and can be deleted safely. |
Compress Old Files |
Select this check box to compress files that have not been accessed in a while. No files are deleted and all files are still accessible. Because files compress at different rates, the value displayed for the amount of space you will recover is an approximation. |
Catalog Files For any The Content Indexer |
Select this check box to have Windows XP Professional delete old catalog files left over from previous indexing operations. The Indexing Service speeds up and enriches file searches by maintaining an index of the files on this disk. |
There are additional ways to free up space on your hard disk using Disk Cleanup. Click the More Options tab in the Disk Cleanup dialog box (see Figure 14.12). The available options are explained in Table 14.10.
Table 14.10??Disk Cleanup More Options Tab Options
In this practice you use the Disk Defragmenter to determine if your hard disk is fragmented. If it is, you will defragment your hard disk. You then use Check Disk to examine your hard disk for file system errors, fix them, locate any bad sectors, and recover any readable information from those bad sectors. Finally, you use Disk Cleanup to free up disk space by deleting temporary files and uninstalling programs.
In Exercise 1, you use the Disk Defragmenter to determine if your hard disk is fragmented. If it is, you will defragment your hard disk.
Windows XP Professional displays the Disk Defragmenter dialog box.
Windows XP Professional displays the Save Defragmentation Report dialog box. Notice that the default title for the report is VolumeC and the default location for the report is in the My Documents folder.
You are returned to the Analysis Report dialog box.
Disk Defragmenter defragments the volume. This could take a long time to complete, depending on the size of the volume and the amount of fragmentation.
Leave the Local Disk (C:) Properties dialog box open for the next exercise.
In Exercise 2, you run Check Disk to examine your hard disk for file system errors. If any errors are found, you fix them. You also locate any bad sectors and recover any readable information from those bad sectors.
Windows XP Professional displays the Check Disk Local Disk (C:) dialog box.
It might take a few minutes to complete all five phases.
Leave the Local Disk (C:) Properties dialog box open for the next exercise.
In Exercise 3, you run Disk Cleanup to free up disk space. Disk Cleanup allows you to delete temporary files and uninstall programs.
A Disk Cleanup dialog box appears, indicating that it is calculating how much space you will be able to free on the C drive.
When would you use the options available in the More Options tab?
The following questions will help you determine whether you have learned enough to move on to the next chapter. If you have difficulty answering these questions, review the material in this lesson before beginning the next chapter. The answers are in Appendix A, "Questions and Answers."