To defragment a volume

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 the Defragmentation display.

3.

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

Note

To open Disk Defragmenter, click Start, point to All Programs, point to Accessories, point to System Tools, and then click Disk Defragmenter

You must be logged on as an administrator or a member of the Administrators group in order to complete this procedure. If your computer is connected to a network, network policy settings may also prevent you from completing this procedure. 

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 interrupt or temporarily stop defragmenting a volume, click Stop or Pause, respectively.

If you start Disk Defragmenter while performing a backup, Disk Defragmenter stops.

Using a command line

1.

Open Command Prompt

2.

Type defrag volume [/v]

ArgumentDescription

volume

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

/v

Displays the complete analysis and defragmentation reports.

Note

To open 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:

defrag volume /v >filename.txt

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

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.

Related Topics

Fsutil: dirty

Fsutil

Chkdsk

Chkdsk

Defrag

Analysis and defragmentation displays and reports

Using the Microsoft Management Console

Using administrative tools in Microsoft Management Console

Analyze a volume



© 2016 Microsoft Corporation. All rights reserved. Contact Us |Terms of Use |Trademarks |Privacy & Cookies