The built-in Windows Disk Defragmenter has been much improved upon, and more so in Windows 11/10, and is considered to be much better than its predecessors. The defrag engine and the manageability of fragmentation have been improved. The Disk Defragmenter runs as a low-priority task in the background without affecting the computer’s performance. It runs only when the machine is idle! It uses the Task Scheduler to keep the hard disk defragmented automatically. This automated defragmentation does not affect the performance of Windows 11/10/8/7/Vista.
Disk Defragmenter or Optimize Drives Tool in Windows 11/10
Now, by default, the defrag tool only defragments files smaller than 64 MB, for according to Microsoft’s benchmarks, fragments of this size, which already consist of at least 16000 contiguous clusters, have a negligible impact on performance. This means that games and large media files are effectively left as they are! So, if you still want to defrag files larger than 64 MB, you need to use the -w parameter mentioned below to defragment files of all sizes.
Defragmentation became even more comprehensive – many files that could not be re-located in Windows Vista or earlier versions can now be optimally replaced. In particular, much work was done to make various NTFS metadata files movable. This ability to relocate NTFS metadata files also benefits volume shrink since it enables the system to pack all files and file system metadata more closely and free up space “at the end,” which can be reclaimed if required.
In Windows 7, Microsoft turned off defragmentation for Solid State Disks. In Windows 11/10/8, however, since the tool has undergone a change into a general disk optimization tool, you will see it enabled by default for SSDs, too. You can read more about the Improved Disk Defragmenter and Storage Optimizer in Windows 11/10.
If you use a Solid State Drive, you may want to read this post on Defragmentation and SSD.
The Disk Defragmenter process starts according to a schedule that you can adjust. You can open the Disk Defragmenter in Windows 11/10/by right-clicking on a Drive icon, selecting Properties, and clicking the Tools tab.
Here, you can change settings by clicking on the Change settings button and opting to run scheduled scans daily, weekly, or monthly. You can also choose to defragment “now” by clicking on Analyze or Optimize.
Some Points To Remember:
- Disk Defragmenter does not defragment files in the Recycle Bin. It is best to run Disk Cleaner first and empty the Recycle Bin before defragmenting.
- Disk Defragmenter will also not defragment files that are in use. It is best to try to shut down as many processes as possible and then defragment.
- Disk Defragmenter does not defragment the following files: Bootsect DOS, Safeboot fs, Safeboot CSV, Safeboot RSV, Hiberfil sys, Memory dump, and the Windows page file. However, using the -b parameter mentioned below will optimize the boot files.
Read: How to increase Hard Drive speed & performance in Windows 10.
Disk defragmenter Command line options
There are various command-line options to exercise control over the defragmentation process.
To defrag a specific drive, say Drive C, open a command prompt and type:
defrag c:
- -r This is the default setting and defragments file fragments that are less than 64 MB.
- -a Analyze the selected drive/volume & display a summary report consisting of analysis and defragmentation reports.
- -c Defragments all volumes on the computer. Don’t specify a drive letter while using this.
- -w Perform FULL defragmentation of files of ALL sizes.
- -f Forced defragmentation even when less free space on the drive is being defragmented. A volume must have at least 15 % free space before the Disk Defragmenter can completely defragment it.
- -i This makes Defrag run in the background & operate only if the computer is idle, like when running as a scheduled task.
- -v Displays complete reports.
- -b It optimizes boot files and applications only.
The only indication you will get is a blinking cursor. This means that the process is going. Press Ctrl + C in the command window to interrupt the defragmentation process.
You can read more about Defrag Options & Command line switches here.
Disk defragmenter does not run
If you cannot defragment or cannot run the defragment utility in Windows or if a drive or volume has been marked as having errors, run chdsk by entering
chkdsk c: /f
at any command prompt, where c is the drive letter. You can then run Defrag after Chkdsk has repaired the file system. If you still face problems, see this post on Disk defragmenter could not start or Failed to initialize.
Related: How to defragment Hard Drive using Batch file.
In Windows 11/10/8, while the default defragger is good enough for most people, some prefer to use Free Defragmentation Software. You may want to have a look at these, too.
Do you know about the Hidden Partitions displayed in Disk Defragmenter Tool?
Can you run Disk Defragmenter on Solid State Drives?
You can, but you should not. Most SSDs come with an in-house tool that can manage the space allocation and optimize it independently using TRIM. SSDs are entirely different from regular storage, and running Disk Defragmenter often may result in a short life span. We highly recommend you use the OEM software to manage the SSDs.
Can SSD work without TRIM?
The SSD TRIM command identifies invalid data and instructs the SSD to disregard it during garbage collection. Without TRIM, the SSD is unaware of which data blocks are obsolete and unusable. Consequently, it must undertake additional work, known as “garbage collection,” to locate and remove these blocks before writing new data.