Windows Disk Defragmenter
Encyclopedia
Disk Defragmenter is a utility
in Microsoft Windows
designed to increase access speed by rearranging files
stored on a disk
to occupy contiguous storage locations, a technique called defragmentation
. Defragmenting a disk minimizes head travel, which reduces the time it takes to read files from and write files to the disk. Beginning with Windows XP
, Disk Defragmenter also reduces system startup times.
s that those machines used. Microsoft
's MS-DOS
did not include a utility to defragment floppy disks.
Versions of PC-DOS and MS-DOS through 6.0 did not include software to defragment hard disks. Several third party software developers marketed defragmenters to fill this gap. MS-DOS 6.0 introduced Defrag. Windows NT, however, did not offer a Defrag utility, so Symantec
was suggested as a possible source of the utility.
Initial releases of Windows NT
lacked a defragmentation tool. Versions through Windows NT 3.51
did not have an application programming interface
for moving data clusters on hard disks. Executive Software, later renamed Diskeeper Corporation
, released Diskeeper
defragmentation software for Windows NT 3.51, which shipped with a customized version of the NT kernel and file system drivers that could move clusters.
Microsoft included file system control (FSCTL) commands to move clusters in the Windows NT 4.0
kernel, which worked for both NTFS
and FAT32 partitions. However, Windows NT 4.0 did not provide a graphical or command-line user interface.
, Windows 98
and Windows Me
. It could be scheduled using a Maintenance Wizard and supported command line switches. This version had the limitation that if the contents of the drive changed during defragmentation, it rescanned the drive and restarted the process from where it left off.
The Disk Defragmenter in Windows 2000
was a stripped-down licensed version of Diskeeper, licensed from Diskeeper Corporation. It uses the following techniques:
metadata files can also be defragmented. A command-line tool, defrag.exe, has been included, providing access to the defragmenter from cmd.exe
and Task Scheduler
.
, Disk Defragmenter includes an option to automatically run at scheduled times using Task Scheduler and uses low CPU priority and the newly introduced low priority I/O algorithm so that it can continue to defrag using reduced resources (less CPU and disk read/write activity) when the computer is in use. The user interface has been simplified, with the color graph and progress indicator being removed entirely.
If the fragments of a file are over 64 MB in size, the file is not defragmented if using the GUI; Microsoft has stated that this is because there is no discernible performance benefit since the time seeking such large chunks of data is negligible compared to the time required to read them. The result, however, is that Disk Defragmenter does not require a certain amount of free space in order to successfully defrag a volume, unlike performing a full defragmentation which requires at least 15% of free space on the volume. The command line utility, Defrag.exe, offers more control over the defragmentation process, such as performing a full defragmentation by consolidating all file fragments regardless of size. This utility can be used to defragment specific volumes or to just analyze volumes as the defragmenter would in Windows XP
.
In Windows Vista if the MFT is spread into multiple fragments, the defrag engine can combine the MFT fragments during defragmentation.
Disk Defragmenter is maintained by Microsoft's Core File Services (CFS) team. The Windows Vista version has been updated in Windows Vista SP1 to include the improvements made in Windows Server 2008. The most notable of these improvements is that the ability to select which volumes are to be defragged has been added back.
Notably, the Windows Vista defragmenter is much more effective than the version included with XP.
.
drive support by visually identifying the storage type of each volume, and by adding the option to optimize them using TRIM
. This replaces the Defragment option for solid-state drives. The name of the utility is changed to "Defragment and Optimize Drives".
In addition, the Windows 2000 version has the following limitations which were removed in Windows XP:
Utility software
Utility software is system software designed to help analyze, configure, optimize or maintain a computer. A single piece of utility software is usually called a utility or tool....
in Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...
designed to increase access speed by rearranging files
Computer file
A computer file is a block of arbitrary information, or resource for storing information, which is available to a computer program and is usually based on some kind of durable storage. A file is durable in the sense that it remains available for programs to use after the current program has finished...
stored on a disk
Hard disk
A hard disk drive is a non-volatile, random access digital magnetic data storage device. It features rotating rigid platters on a motor-driven spindle within a protective enclosure. Data is magnetically read from and written to the platter by read/write heads that float on a film of air above the...
to occupy contiguous storage locations, a technique called defragmentation
Defragmentation
In the maintenance of file systems, defragmentation is a process that reduces the amount of fragmentation. It does this by physically organizing the contents of the mass storage device used to store files into the smallest number of contiguous regions . It also attempts to create larger regions of...
. Defragmenting a disk minimizes head travel, which reduces the time it takes to read files from and write files to the disk. Beginning with Windows XP
Windows XP
Windows XP is an operating system produced by Microsoft for use on personal computers, including home and business desktops, laptops and media centers. First released to computer manufacturers on August 24, 2001, it is the second most popular version of Windows, based on installed user base...
, Disk Defragmenter also reduces system startup times.
Early history
As early as the end of 1982, the IBM PC DOS operating system that shipped with early IBM Personal Computers included a Disk Volume Organization Optimizer to defragment the 5¼-inch floppy diskFloppy disk
A floppy disk is a disk storage medium composed of a disk of thin and flexible magnetic storage medium, sealed in a rectangular plastic carrier lined with fabric that removes dust particles...
s that those machines used. Microsoft
Microsoft
Microsoft Corporation is an American public multinational corporation headquartered in Redmond, Washington, USA that develops, manufactures, licenses, and supports a wide range of products and services predominantly related to computing through its various product divisions...
's MS-DOS
MS-DOS
MS-DOS is an operating system for x86-based personal computers. It was the most commonly used member of the DOS family of operating systems, and was the main operating system for IBM PC compatible personal computers during the 1980s to the mid 1990s, until it was gradually superseded by operating...
did not include a utility to defragment floppy disks.
Versions of PC-DOS and MS-DOS through 6.0 did not include software to defragment hard disks. Several third party software developers marketed defragmenters to fill this gap. MS-DOS 6.0 introduced Defrag. Windows NT, however, did not offer a Defrag utility, so Symantec
Symantec
Symantec Corporation is the largest maker of security software for computers. The company is headquartered in Mountain View, California, and is a Fortune 500 company and a member of the S&P 500 stock market index.-History:...
was suggested as a possible source of the utility.
Initial releases of Windows NT
Windows NT
Windows NT is a family of operating systems produced by Microsoft, the first version of which was released in July 1993. It was a powerful high-level-language-based, processor-independent, multiprocessing, multiuser operating system with features comparable to Unix. It was intended to complement...
lacked a defragmentation tool. Versions through Windows NT 3.51
Windows NT 3.51
Windows NT 3.51 is the third release of Microsoft's Windows NT line of operating systems. It was released on 30 May 1995, nine months after Windows NT 3.5. The release provided two notable feature improvements; firstly NT 3.51 was the first of a short-lived outing of Microsoft Windows on the...
did not have an application programming interface
Application programming interface
An application programming interface is a source code based specification intended to be used as an interface by software components to communicate with each other...
for moving data clusters on hard disks. Executive Software, later renamed Diskeeper Corporation
Diskeeper Corporation
Diskeeper Corporation is the name of a software company based in Burbank, California, founded in 1981. The company's current name is derived from its flagship product, Diskeeper, a file system defragmentation software package for Microsoft Windows and VAX...
, released Diskeeper
Diskeeper
-Further reading:#...
defragmentation software for Windows NT 3.51, which shipped with a customized version of the NT kernel and file system drivers that could move clusters.
Microsoft included file system control (FSCTL) commands to move clusters in the Windows NT 4.0
Windows NT 4.0
Windows NT 4.0 is a preemptive, graphical and business-oriented operating system designed to work with either uniprocessor or symmetric multi-processor computers. It was the next release of Microsoft's Windows NT line of operating systems and was released to manufacturing on 31 July 1996...
kernel, which worked for both NTFS
NTFS
NTFS is the standard file system of Windows NT, including its later versions Windows 2000, Windows XP, Windows Server 2003, Windows Server 2008, Windows Vista, and Windows 7....
and FAT32 partitions. However, Windows NT 4.0 did not provide a graphical or command-line user interface.
Introduction
Disk Defragmenter also shipped as part of Windows 95Windows 95
Windows 95 is a consumer-oriented graphical user interface-based operating system. It was released on August 24, 1995 by Microsoft, and was a significant progression from the company's previous Windows products...
, Windows 98
Windows 98
Windows 98 is a graphical operating system by Microsoft. It is the second major release in the Windows 9x line of operating systems. It was released to manufacturing on 15 May 1998 and to retail on 25 June 1998. Windows 98 is the successor to Windows 95. Like its predecessor, it is a hybrid...
and Windows Me
Windows Me
Windows Millennium Edition, or Windows Me , is a graphical operating system released on September 14, 2000 by Microsoft, and was the last operating system released in the Windows 9x series. Support for Windows Me ended on July 11, 2006....
. It could be scheduled using a Maintenance Wizard and supported command line switches. This version had the limitation that if the contents of the drive changed during defragmentation, it rescanned the drive and restarted the process from where it left off.
The Disk Defragmenter in Windows 2000
Windows 2000
Windows 2000 is a line of operating systems produced by Microsoft for use on personal computers, business desktops, laptops, and servers. Windows 2000 was released to manufacturing on 15 December 1999 and launched to retail on 17 February 2000. It is the successor to Windows NT 4.0, and is the...
was a stripped-down licensed version of Diskeeper, licensed from Diskeeper Corporation. It uses the following techniques:
- Moving all the index or directory information to one spot. Moving this spot into the center of the data, i.e. one third of the way in, so that average head travel to data is halved compared to having directory information at the front.
- Moving infrequently used files further from the directory area.
- Obeying a user-provided table of file descriptions to emphasize or ignore.
- Making files contiguous so that they can be read without unnecessary seeking.
Windows XP and Windows Server 2003
Windows Disk Defragmenter was updated to alleviate some restrictions. It no longer relies on the Windows NT Cache Manager, which prevented the defragmenter from moving pieces of a file that cross a 256KB boundary within the file. NTFSNTFS
NTFS is the standard file system of Windows NT, including its later versions Windows 2000, Windows XP, Windows Server 2003, Windows Server 2008, Windows Vista, and Windows 7....
metadata files can also be defragmented. A command-line tool, defrag.exe, has been included, providing access to the defragmenter from cmd.exe
Cmd.exe
Command Prompt is the Microsoft-supplied command-line interpreter on OS/2, Windows CE and on Windows NT-based operating systems...
and Task Scheduler
Task Scheduler
Task Scheduler is a component of Microsoft Windows that provides the ability to schedule the launch of programs or scripts at pre-defined times or after specified time intervals. It was first introduced in the Windows 95 Plus! pack as System Agent but was renamed to Task Scheduler in Windows 98...
.
Windows Vista and Windows Server 2008
In Windows VistaWindows Vista
Windows Vista is an operating system released in several variations developed by Microsoft for use on personal computers, including home and business desktops, laptops, tablet PCs, and media center PCs...
, Disk Defragmenter includes an option to automatically run at scheduled times using Task Scheduler and uses low CPU priority and the newly introduced low priority I/O algorithm so that it can continue to defrag using reduced resources (less CPU and disk read/write activity) when the computer is in use. The user interface has been simplified, with the color graph and progress indicator being removed entirely.
If the fragments of a file are over 64 MB in size, the file is not defragmented if using the GUI; Microsoft has stated that this is because there is no discernible performance benefit since the time seeking such large chunks of data is negligible compared to the time required to read them. The result, however, is that Disk Defragmenter does not require a certain amount of free space in order to successfully defrag a volume, unlike performing a full defragmentation which requires at least 15% of free space on the volume. The command line utility, Defrag.exe, offers more control over the defragmentation process, such as performing a full defragmentation by consolidating all file fragments regardless of size. This utility can be used to defragment specific volumes or to just analyze volumes as the defragmenter would in Windows XP
Windows XP
Windows XP is an operating system produced by Microsoft for use on personal computers, including home and business desktops, laptops and media centers. First released to computer manufacturers on August 24, 2001, it is the second most popular version of Windows, based on installed user base...
.
In Windows Vista if the MFT is spread into multiple fragments, the defrag engine can combine the MFT fragments during defragmentation.
Disk Defragmenter is maintained by Microsoft's Core File Services (CFS) team. The Windows Vista version has been updated in Windows Vista SP1 to include the improvements made in Windows Server 2008. The most notable of these improvements is that the ability to select which volumes are to be defragged has been added back.
Notably, the Windows Vista defragmenter is much more effective than the version included with XP.
Windows 7
Windows 7 is different from the other versions as you can follow the defragmentation, and the percentage that has been completed. That method gives you an estimate on when the defragmentation will be complete. However, this utility will not defragment a solid-state driveSolid-state drive
A solid-state drive , sometimes called a solid-state disk or electronic disk, is a data storage device that uses solid-state memory to store persistent data with the intention of providing access in the same manner of a traditional block i/o hard disk drive...
.
Windows 8
Windows 8 improves solid-state driveSolid-state drive
A solid-state drive , sometimes called a solid-state disk or electronic disk, is a data storage device that uses solid-state memory to store persistent data with the intention of providing access in the same manner of a traditional block i/o hard disk drive...
drive support by visually identifying the storage type of each volume, and by adding the option to optimize them using TRIM
Trim
Trim may refer to:* Cutting small pieces off something** Book trimming, a stage of the publishing process** Editing*** Editing a posting style in online discourse** Pruning, trimming as a form of pruning often used on trees-Places:...
. This replaces the Defragment option for solid-state drives. The name of the utility is changed to "Defragment and Optimize Drives".
Limitations
In Windows 2000 and later operating systems, Disk Defragmenter has the following limitations:- It does not defragment files residing in the Recycle Bin or files that are in use. In particular, this includes the registry, page file and hibernation file.
- Prior to the Windows Vista release, only one volume could be analyzed or defragmented at a time and only one instance could run.
- Only local volumes can be defragmented, network volumes are not supported.
- The GUI version prior to Windows Vista cannot be scheduled, however the command line utility since Windows XP and later can be scheduled.
- Unlike previous versions, the GUI version in Windows Vista does not display a map of disk fragmentation, nor does it display progress during defragmentation.
In addition, the Windows 2000 version has the following limitations which were removed in Windows XP:
- Defragmenting NTFSNTFSNTFS is the standard file system of Windows NT, including its later versions Windows 2000, Windows XP, Windows Server 2003, Windows Server 2008, Windows Vista, and Windows 7....
volumes with cluster sizes larger than 4 kilobytes (KB) is not possible. - It is not possible to perform fine-grained movement of uncompressed NTFS file data in Windows 2000. Moving a single file cluster also moves the 4 KB part of the file that contains the cluster.
- EFSEncrypting File SystemThe Encrypting File System on Microsoft Windows is a feature introduced in version 3.0 of NTFS that provides filesystem-level encryption...
encrypted files are not defragmented.
See also
- DefragmentationDefragmentationIn the maintenance of file systems, defragmentation is a process that reduces the amount of fragmentation. It does this by physically organizing the contents of the mass storage device used to store files into the smallest number of contiguous regions . It also attempts to create larger regions of...
- File system fragmentationFile system fragmentationIn computing, file system fragmentation, sometimes called file system aging, is the inability of a file system to lay out related data sequentially , an inherent phenomenon in storage-backed file systems that allow in-place modification of their contents. It is a special case of data fragmentation...
- List of defragmentation software