Defragment a volume

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2

To defragment a volume

  • Using the Windows interface

  • Using a command line

Using the Windows interface

  1. Open Disk Defragmenter.

  2. Click the volume that you want to defragment, and then click Defragment.

    After the defragmentation is complete, Disk Defragmenter displays the results in Estimated disk usage after defragmentation.

  3. Click View Report to view the Defragmentation Report, which displays detailed information about the volume you defragmented.

Notes

  • To perform this procedure, you must be a member of the Administrators group on the local computer, or you must have been delegated the appropriate authority. If the computer is joined to a domain, members of the Domain Admins group might be able to perform this procedure. As a security best practice, consider using Run as to perform this procedure.

  • To open Disk Defragmenter, click Start, point to All programs, point to Accessories, point to System Tools, and then click Disk Defragmenter.

  • You should analyze volumes before defragmenting them. This tells you whether you need to take the time to defragment them.

  • A volume must have at least 15% free space for Disk Defragmenter to completely and adequately defragment it. Disk Defragmenter uses this space as a sorting area for file fragments. If a volume has less than 15% free space, Disk Defragmenter will only partially defragment it. To increase the free space on a volume, delete unneeded files or move them to another disk.

  • You cannot defragment volumes that the file system has marked as dirty, which indicates possible corruption. You must run chkdsk on a dirty volume before you can defragment it. You can determine if a volume is dirty by using the fsutil dirty query command. For more information about chkdsk and fsutil dirty, see Related Topics.

  • The time that Disk Defragmenter takes to defragment a volume depends on several factors, including the size of the volume, the number and size of files on the volume, the percentage of fragmentation in the volume, and available system resources.

  • You can defragment only local file system volumes, and you can run only one instance of Disk Defragmenter at a time.

  • To stop or temporarily interrupt defragmenting a volume, click Stop or Pause, respectively.

  • If you start Disk Defragmenter while performing a backup on the same volume, Disk Defragmenter stops.

  • Running the defrag command and Disk Defragmenter are mutually exclusive. If you are using Disk Defragmenter to defragment a volume and you run the defrag command at a command prompt, the defrag command fails. Conversely, if you run the defrag command, and open Disk Defragmenter, the defragmentation options in Disk Defragmenter are unavailable.

Using a command line

  1. Open Command Prompt.

  2. Type defragvolume [/v]

    Value Description

    volume

    The drive letter or a mount point of the volume to be defragmented.

    /v

    Displays the complete analysis and defragmentation reports.

Notes

  • To perform this procedure, you must be a member of the Administrators group on the local computer, or you must have been delegated the appropriate authority. If the computer is joined to a domain, members of the Domain Admins group might be able to perform this procedure. As a security best practice, consider using Run as to perform this procedure.

  • To open a command prompt, click Start, point to All programs, point to Accessories, and then click Command prompt.

  • To view the complete syntax for this command, type defrag /?

  • A volume must have at least 15% free space for defrag to completely and adequately defragment it. Defrag uses this space as a sorting area for file fragments. If a volume has less than 15% free space, defrag will only partially defragment it. To increase the free space on a volume, delete unneeded files or move them to another disk.

  • You cannot defragment volumes that the file system has marked as dirty, which indicates possible corruption. You must run chkdsk on a dirty volume before you can defragment it. You can determine if a volume is dirty by using the fsutil dirty query command. For more information about chkdsk and fsutil dirty, see Related Topics.

  • While defrag is analyzing and defragmenting a volume, it displays a blinking cursor. When defrag is finished analyzing and defragmenting the volume, it displays the analysis report, the defragmentation report, or both reports, and then exits to the command prompt.

  • By default, defrag displays a summary of both the analysis and defragmentation reports if you do not specify the /a or /v parameters.

  • You can send the reports to a text file by typing >filename.txt, where filename.txt is a file name you specify. For example:

    defragvolume**/v** >filename.txt

  • To stop the defragmentation process, at the command prompt, press CTRL+C.

  • If you run defrag while performing a backup on the same volume, defrag stops.

  • Running the defrag command and Disk Defragmenter are mutually exclusive. If you are using Disk Defragmenter to defragment a volume and you run the defrag command at a command prompt, the defrag command fails. Conversely, if you run the defrag command, and open Disk Defragmenter, the defragmentation options in Disk Defragmenter are unavailable.

Information about functional differences

  • Your server might function differently based on the version and edition of the operating system that is installed, your account permissions, and your menu settings. For more information, see Viewing Help on the Web.

See Also

Concepts

Working with MMC console files
Analyze a volume
Analysis and defragmentation reports
Defrag
chkdsk
Fsutil
Fsutil: dirty