Microsoft KB Archive/318759

From BetaArchive Wiki

PSS ID Number: 318759

Article Last Modified on 11/19/2003



The information in this article applies to:

  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows 2000 Professional



This article was previously published under Q318759


SUMMARY

This step-by-step article describes how to effectively use the Disk Defragmenter tool in Windows 2000. The Disk Defragmenter tool that is included with Windows 2000 is based on Executive Software's full retail version of Diskeeper. This version provides limited functionality to maintain disk performance by defragmenting volumes that use the FAT, FAT32, or NTFS file system.

This version has the following limitations:

  • It can defragment only local volumes.
  • It can defragment only one volume at a time.
  • It cannot defragment one volume while scanning another.
  • It cannot be scripted.
  • It cannot be scheduled.
  • It can run only one Microsoft Management Console (MMC) snap-in at a time.

back to the top

How to Effectively Use the Disk Defragmenter Tool

NOTE: You must be a member of the Administrators group to use the Disk Defragmenter tool. It may take more than a couple of hours to complete defragmentation, depending on the data capacity and current usage of your computer's hard disk drive.

To most effectively use the Disk Defragmenter tool:

  1. Quit all programs.
  2. Perform a full system backup.

    NOTE: When you use the following procedures, the chance of corruption or data loss during the conversion is minimal; however, it is recommended that you perform a full backup of your data.
  3. Delete any unnecessary files on the volume that you want to defragment.

    A volume must have at least 15 percent of its space as free space for Disk Defragmenter to completely and adequately defragment the volume. If a volume has less than 15 percent of free space, Disk Defragmenter only partially defragments the volume. To increase the free space on a volume, either delete any unnecessary files or move them to another disk. Use Disk Cleanup to delete unnecessary files. Disk Cleanup helps you remove temporary files, remove downloaded program files, remove old Chkdsk files, empty the recycle bin, and compress old files.

    To start Disk Cleanup, click Start, point to Programs, point to Accessories, point to System Tools, and then click Disk Cleanup. (You can also start Disk Cleanup by running Cleanmgr.exe at the command prompt.) For additional information about using command-line switches with the Disk Cleanup tool, click the article number below to view the article in the Microsoft Knowledge Base:

    253597 Automating Disk Cleanup Tool in Windows

  4. Run the chkdsk /f command on all volumes that you want to defragment.

    For example, if you have several volumes, type the following command at the command prompt, and then press ENTER:

    chkdsk c: /f

    After Chkdsk is completed, type the following command at the command prompt, and then press ENTER:

    chkdsk d: /f

    Repeat this step for each volume (volume E, volume F, and so on) that you want to defragment.

    NOTE: When you run the Chkdsk tool with either the /f switch or the /r switch on the system or the boot partition, you must restart the computer. If you receive the following prompt, press Y.

    The type of the file system is NTFS. Cannot lock current drive.
    Chkdsk cannot run because the volume is in use by another process.
    Would you like to schedule this volume to be checked the next time the system restarts? (Y/N)

    The next time you restart your computer, the Chkdsk.exe tool runs.
  5. Click Start, point to Programs, point to Accessories, point to System Tools, and then click Disk Defragmenter.
  6. Analyze the volumes before defragmenting. To do so, click the volume that you want to analyze, and then click Analyze.

    After you analyze a volume, a dialog box is displayed that lists the percentage of fragmented files and folders on the volume and recommends whether to defragment the volume. Analyze volumes regularly and defragment them only when Disk Defragmenter recommends it.
  7. Defragment the volumes. To do so, click the volume that you want to defragment, and then click Defragment.
  8. Run Disk Defragmenter again if required.

    If you use Disk Defragmenter to defragment a disk that is highly fragmented, there may be insufficient free space to effectively defragment the files. If this condition exists and you perform a defragment operation, and then immediately perform an analyze operation on the same volume, you may receive an "It is recommended that you defragment this volume" message even though you just completed a defragment operation. You receive this message until there is enough free space to effectively defragment the volume.

    If you receive this message, temporarily move the most fragmented files off the volume and defragment again. If you continue to receive the message, temporarily move a few large, contiguous files off the volume. This temporary procedure gives Disk Defragmenter the contiguous "working room" that it needs to complete the defragmentation process on the rest of the volume. This procedure also allows Disk Defragmenter to consolidate the free spaces on the partition, which increases the possibility that you can move the temporarily moved files back to the partition into contiguous space.

back to the top

How to Defragment the Paging File

An active paging file is held open for exclusive use by Windows 2000. Disk Defragmenter cannot defragment any file that is open for exclusive use. However, you can either defragment the paging file or reduce the degree of fragmentation for the paging file.

To either defragment or reduce the amount of fragmentation in the paging file:

  1. Click Start, point to Settings, click Control Panel, and then double-click System.
  2. Click the Advanced tab, and then click Performance Options.
  3. Click Change, and then change the paging file to another drive.
  4. Reduce the minimum and maximum size of the original paging file on the drive that you want to defragment to 0 megabytes (MB).
  5. Restart your computer so that the computer uses the new paging file.
  6. Run Disk Defragmenter on the original drive to consolidate the free space segments that are created when you move the paging file.
  7. Re-create the paging file on the original drive.
  8. Reduce the minimum and maximum size of the temporary paging file to 0 MB.
  9. Restart your computer.

back to the top

How to Reduce Fragmentation by Moving the Paging File

You can reduce fragmentation by moving the paging file to another hard disk. By default, Windows stores the paging file on the boot partition (the partition that contains the operating system and its support files). If a paging file resides on a partition that contains other data, it may experience fragmentation as it expands to satisfy the extra virtual memory that is required. When you place a paging file on its own partition, the paging file does not become fragmented. An unfragmented paging file leads to faster virtual memory access.

For additional information about how to move the Windows Default Paging file, click the article number below to view the article in the Microsoft Knowledge Base:

123747 Moving the Windows Default Paging and Spool File


back to the top

When to Use the Disk Defragmenter Tool

For best results when you defragment volumes, follow these tips:

  • Analyze volumes regularly and defragment them only when Disk Defragmenter recommends it. A good guideline is to analyze volumes at least once a week. If you seldom need to defragment volumes, analyze volumes monthly instead of weekly.
  • Defragment a volume before you add a large number of files to the volume, for example, before you install programs. If you do so, the files occupy contiguous space and do not become fragmented after you add them.
  • Defragment a volume after you delete a large number of files from the volume. Because volumes might become excessively fragmented when you add a large number of files or folders, make sure to analyze volumes after you add a large number of files or folder. Generally, you should defragment volumes on busy file servers more often than volumes on single-user workstations.
  • Defragment a volume after you install programs on it. Volumes often become fragmented after you install software. Disk Defragmenter helps to ensure the best file system performance.
  • Defragment the system and boot volumes after you install Windows 2000 or after you perform an upgrade of Windows.
  • Defragment volumes during periods of low system activity. Defragment file server volumes during low-volume usage periods to minimize the effect that the defragmentation process has on file server performance. The time that Disk Defragmenter takes to defragment a volume depends on several factors, including the size of the volume, the number of files on the volume, the number of fragmented files, and the available system resources.

back to the top

Troubleshooting

  • The computer is running slowly or programs on the hard disk are slow to open.


Cause: The volumes on your hard disk may have become excessively fragmented, possibly because you have recently created a large number of files or folders or have installed new software.

Solution: Analyze and then defragment the volumes on your hard disk if necessary.

  • The display and the report do not agree.


Cause: The Analysis and Defragmentation displays provide a general view of a volume's fragmentation. The displays show less detail than the Analysis and Defragmentation reports; therefore, if you compare the results you might notice discrepancies.

Solution: Use the Analysis and Defragmentation displays only for a general idea of the volume's fragmentation. Use the Analysis and Defragmentation reports for precise, numerical figures. For more information, see Windows Help for Analysis and Defragmentation displays and reports.

  • There seems to be unmovable files on volumes other than the system volumes and boot volumes.


Cause: Paging files are displayed as unmovable files in Disk Defragmenter. On NTFS volumes, the NTFS change journal also is displayed as an unmovable file.

Solution: This behavior is by design because paging files cannot be moved and therefore cannot be defragmented. For more information, see the Defragmenting the Paging File section and the Reduce Fragmentation by Moving the Paging File section of this article.

  • The defragmentation report on an NTFS volume shows small files with a large number of fragments.


Cause: When a file is open for write-access, NTFS attempts to preallocate additional space to help prevent fragmentation as the file grows. If you defragment a volume, Disk Defragmenter does not allow the extra space to be moved and consolidated while the file is open. The extra space is shown as additional fragments in the report.

Solution: Close the file to release the additional fragments and reduce the size of the file. The Size on disk value reports the size that you would obtain if you closed the file. To view the size, right-click the file and then click Properties.

back to the top

REFERENCES

For additional information, click the article numbers below to view the articles in the Microsoft Knowledge Base:

300978 HOW TO: Analyze and Defragment a Disk Volume in Windows 2000


253597 Automating Disk Cleanup Tool in Windows


227350 Files Excluded by the Disk Defragmenter Tool


218461 Enhanced Chkdsk, Autochk, and Chkntfs Tools in Windows 2000


123747 Moving the Windows Default Paging and Spool File


231176 Running Disk Defragmenter Requires Administrator Privileges


227463 Disk Defragmenter Limitations in Windows 2000


back to the top



Keywords: kbhowto kbHOWTOmaster KB318759
Technology: kbwin2000AdvServ kbwin2000AdvServSearch kbwin2000Pro kbwin2000ProSearch kbwin2000Search kbwin2000Serv kbwin2000ServSearch kbWinAdvServSearch