Friday, February 13, 2009

Vista Defrag: Nice Utility - No Feedback

The defrag utility in Windows XP was a useful utility that provided a text report on fragmentation statistics as well as a graphical representation of the hard drive showing fragmentation.

Vista has none of that. For some reason, the developers removed all the reporting and set defrag as a background process. Admittedly, it does a good job of keeping the system relatively cleaned up.

However, sometimes as an admin, I just gotta know what's up with the volume. Command line to the rescue!

Open a command prompt in administrative mode (right click and choose Run as administrator and then type defrag /?

Description:  Locates and consolidates fragmented files on local volumes to improve system performance.

Syntax:  defrag.exe <volume> -a [-v]
defrag.exe <volume> [{-r | -w}] [-f] [-v]
defrag.exe       -c [{-r | -w}] [-f] [-v]

Parameters:

Value                 Description

<volume>              Specifies the drive letter or mount point path of the volume to  be defragmented or analyzed.

-c                        De fragments all volumes on this computer.

-a                        Performs fragmentation analysis only.

-r                        Performs partial defragmentation (default). Attempts to consolidate only fragments smaller than 64MB.

-w                       Performs full defragmentation. Attempts to consolidate all file fragments, regardless of their size.

-f                        Forces defragmentation of the volume when free space is low.

-v                        Specifies verbose mode. The defragmentation and analysis output is more detailed.

-?                        Displays this help information.

Below are defrag.exe examples:

defrag.exe d: (defrag the D: drive)

defrag.exe d:\vol\mountpoint -w -f (defrag the mountpoint while consolidation all file fragments regardless of size and if volume space is low, forces it to defrag)

defrag.exe d: -a -v (run analysis on the D: drive and set verbose mode for detailed output)

defrag.exe -c -v (defrag all volumes on your Computer and set verbose mode for detailed output

No comments: