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.
In defrag of my Windows 8.1 have only /A, /C, /D, /E, /H, /K, /L, /M, /O, /T, /U, /V, /X. parameters. The /W /F /I and /B is missing. The /K is too obscure to mee.
Mr. Khanse, I’m posting my query here even if it is irrelevant to the topic of discussion since I couldn’t find any helpful response on the forum. I’m using Windows 8.1 and while most of the apps work totally fine, few apps like fb, twitter, the hindu, espn etc. have trouble connecting to internet via institute proxy. Have checked the app settings to see if proxy settings can be incorporated individually in each app but that didn’t help either. Can you please suggest what could be the issue is and how to solve it? Thank you.
I would like to ring in with this Windows doesn’t defrag files over 64MB. That’s only half correct. What happens is that Windows 7/8 will defrag large files down to 64MB chunks. So if a file is 1GB and is fragmented all over the place, Windows defrag will in fact defrag that file BUT will reduce the file down to about 16 fragments. Microsoft’s reasoning for this is that performance no longer diminishes at this point. I can imagine some circumstances where a file will perform better when defragmented 100% but for most cases, 64MB chunks are good enough.
The research on this matter as lead me to believe that 100% defrag is overkill. An OS will be constantly reading files from all over a disk anyway. Modern drives are large enough that fragmentation is not an issue just as long as you have plenty of free space. Defrag can try to organize files so the most used are closer together but that’s a constantly changing state of affairs. Lets say you listen to podcasts. Each time iTunes downloads a podcast, it will fragment it all over the place. But you will only listen to that podcast ONCE and then delete it. Here’s the thing: All that happens is that file will read once. There’s no need to defrag it but some defrag programs are aggressive and will defrag that file regardless. By the time you’re done with that file, you will have synced your iPod or whatever back to iTunes, it will tell iTunes that the file has been read and it’s no longer needed and it’s deleted. Defrag in this case did nothing but waste resources. For a defrag program to work efficiently, it would have to know which files will be permanent and which files will be temporary. As of this posting, I know of no defrag programs that have a setting to only defrag a file if it is a particular age which would be a more efficient way to defrag than immediately and constantly defragging everyhing.
The worse culprit for this is Diskeeper. It will never ever stop defragging. 24/7 disk churning. I don’t know how that is supposed to be more efficient. I can only think every single positive thing said about Diskeeper online has been from shills. Yes, it only runs when the computer is idle. Sounds great when you put it that way but a computer is idle most of the time. It’s idle between keystrokes.
I have tried other Defrag programs such as PerfectDisk, O&O, Diskeeper, Defraggler, UltimateDefrag, MyDefrag and SmartDefrag. All of them did the same annoying thing: they defragged too much. The default is to take all the files and mush them closely together and order them in some manner that requires the defrag to move around way too many files at each run. The problem with that is the new files written to the disk are pushed to the back. In a way, this is worse than defragging because now the disk has to reach even farther to get that new file when the other files in that collection are closer to the front.
As far as I’m concerned a lot of defrag programs exaggerate the issue of fragmentation and make claims it will prevent crashes which is ridiculous. How exactly would a fragmented file cause a crash? It’s only possible if that file is on a bad sector. I think it’s possible that defrag keeps files from suffering Bit-Rot by moving the files around and ultimately placing the file on a freshly refreshed sector and it could be possible the old sector was getting errors which CRC would correct when read and then placed somewhere else. Who knows? Probably snake oil for the most part. Seems most people will believe/disbelieve anything at random so it doesn’t matter. If defragging your hard drive everyday makes you think you’re helping, go ahead. I can bet you for most people, they wouldn’t be able to tell the difference between a heavily fragmented drive and a one that’s degragged. If you can tell, congratulations, you have probably used a stopwatch.
Windows 7/8 defrag is minimalistic which is great because it defrags just enough to improve performance but doesn’t continue moving files in vain just to make sure everything is close together.
I’ve read why there’s no need to defrag in Linux. It’s because the file system spreads all the files farther apart which reduces the chance that a file will increase in size and would need to be placed around the disk in more than one contiguous path.
Defragging a drive is essential for the smooth functioning of the computer. I usually prefer to use a utility like Ccleaner or Ninja TuneUp to defrag and to remove the junk files from the system.
Can you please show some evidence as to why you run Ninja TuneUp or CCleaner. Without the need these programs can cause more harm then good especially if run just because someone posted that they do it.
If you control yourself and do not install unknown software or any software you absolutely do not need then you also do not need to install CCleaner. I know the product very well and there are situations where it will help but rarely does a system used by a careful user require such a product,
If it did require it then Microsoft would have built it in by now, just like antivirus, antispyware and defrag which as you see has grown more powerful over the years as it improved performance. To repeat if CCleaner had a noticeable performance improvement on most systems then Microsoft would have their version of it included.
My research shows that most systems do best never installing those tools unless you are having issues and someone that truly understands what is going on with your system based on running diagnostic utilities and reading the resulting logs.
Bottom line defrag and CCleaner are unrelated and this is a defrag thread. My fear is people read this and run out and install that stuff. True it rarely if ever creates a problem but it also rarely improves a system that had just the basic email, office and web usage.
My 2 cents. I have been in the it field since 1987 but hey that does not mean anything I say has any more value than someone that started last month. I have experience in real world situations and can troubleshoot better than most but still I am open to hear why what I just said is bunk since I also have no hard data to back it up.
Enjoy your computers……..
i have done the de fragmentation and optimization of disk drive :C ,,but after the process is completed,,now i can not open any functions of WIndows 8,,nothing open,,,PC settings crashes,,mail crashes,,store crashes and it feel like windows 8 is no more on my system altough its showing im on windows 8.1,,plzz help me
The four options you list still are there; just hidden. I used the /W and /B all the time on Windows 8.1, and still use them today on Windows 10. The /F parameter also is there but hidden, and is only useful if your available hard drive space is less than 15% (or, something like that).
I do not know about the /I parameter as I never used it. What it was in Windows 8.1 I don’t know. I never used that one. In Windows 10 there is an /I n parameter for setting time limits on tier optimization.
The /K option is for use in such things as virtual machines and/or other ‘thin-provisioned’ storage arrangements. Most people aren’t going to use that last one.
Do you remember which options you used in the defrag? What you are describing sounds like what I experienced after using Piriform Defraggler. Did you use any defragmenting programs other than Windows Defrag prior to using Defrag in windows? If so, logon using Safe Mode with Command Prompt and run defrag c: /b /w /h /u /v and wait. Then, follow that up with the same except without the /b parameter. If you can fun defrag c: /w /h /u /v from the advanced repair options, you should try that. Of course, you probably already reformatted and reinstalled Windows 8.1 by now, so keep this for future reference.
One correction. Linux does have a few defraggers. One is built-in and requires the command line to set and change the parameters of EXT4 filesystems that instruct the drivers how to handle and work with the filesystem. Another is e4defrag, which is a simple command-line defragger. That defragments file extents on EXT4 filesystems. I use that one after every major upgrade. Btrfs on Linux also has defragmentation methodologies built into the utilities that go with btrfs.
Excuse me, how is what you’re saying a correction? I never said there were no defraggers for Linux, I’ve read that there was no need to defrag a hard drive in Linux. Those are two separate things. Of course there are defraggers for Linux as the file systems are capable of being defragged.
Ninja TuneUp looks like a gigantic bottle of snake oil. And CCleaner doesn’t have a defrag function.
Windows has fairly adequate cleaning and defrag tools built into the OS.
Every product that claims to speed up a PC is lying. The only things that would make a PC go faster would be to make sure there’s no malware running in the background, reduce the amount of things that start up with the PC or a reinstall of the OS.
And that still requires a correction because while most users likely will never need to defragment an EXT4 system on Linux (the OS filesystem handles that fairly well), some still do have fragmentation issues, depending upon the kinds of files stored in the filesystem and the kind of work done on the system, and also depending upon the sizes of the files involved. That is why people have written Linux-based defraggers, including those who write the components to the filesystem, particularly in the case of Btrfs. Even Linux systems can get their files fragmented under certain circumstances. This is especially so if you do a lot of development on a Linux system.
What are you correcting? I never said there were no Linux defraggers. I only brought up Linux because of how files are placed and you’re taking that out of context and making it about something else. This is discussion of Windows defrag and I don’t want to spend my time splitting hairs.