Digging Deep into Windows 7 Defrag

digging deep into windows 7 defrag

The common wisdom has always been that one should always defrag. In fact, the more you use your computer, and the older your computer becomes, the more frequently one should defragment their hard drive. One of the very few improvements in Windows Vista is the sheduled defrag. Straight out of the box, normally on a Wednesday night, Vista would automatically defragment your hard drive.

Next comes Windows 7, and it has the same scheduled defrag as Vista, but with a twist. The twist has to do with SSD or Solid State Drives. Microsoft recognized the fact that SSD’s were the future. Solid state drives are a quantum leap in computer storage. Unlike common hard drives, SSD’s do not have rapidly spinning platters, and tiny little heads that read the data from these rotating platters. Instead, SSD’s behave much more like the chip that stores photos in your camera. For all of this, SSD’s are more reliable, faster, and use less energy than their mechanical brothers. SSD’s are awesome, and their only drawback is price. Even today, they are significantly more expensive than regular hard drives, but just like everything else, the gap between SSD’s and HDD’s is decreasing.

Microsoft must have foreseen this outcome. There is one golden rule about SSD’s. Never, ever defragment an SSD. Although files on an SSD do indeed get fragmented, there is no little head running around trying to assemble all the pieces. An SSD drive can access a fragmented file just as fast as a contiguous (defragmented) file. Another documented issue with SSD’s is their life span. The more you read and write to the drive, the shorter the life span. Hence, a very read/write intensive process like a defrag is never recommended for an SSD.

So Windows 7 only defrags what it believes to be a normal rotating drive. In other words, Windows 7 is designed to never defrag an SSD. So that’s the good news. Here at PC Pitstop, since all of our products including OverDrive and PC Matic are cloud products, this gives us an unprecedented view on issues such as these. It took us many months and close to a 1/4 million computers, but here is the scoop on Windows 7 and defragmentation.

If you have an SSD and Windows 7, you will quickly discover than Windows 7 really has no idea that you have an SSD. If you click on properties or look at the drive, you will quickly find that Windows 7 is treating your SSD just like a regular hard drive. We worked very closely with Microsoft on this project and what we learned is that Microsoft has developed a method to ask the disk whether it is an SSD or not. I won’t go into the technical details, but the bottom line is that a LOT of the SSD makers are not following this protocol.

During this time, PC Pitstop developed its own SSD detection algorithm. On all of 1/4 million test machines, it worked all the time. When we showed Microsoft our results, they revealed that they had a secondary way of detecting SSD’s in Windows 7. Windows 7 runs a simple benchmark on the drive and if it is faster than 8 MB/sec, Window 7 deems it an SSD. Here’s some good news, we ran this test on over 5,000 SSD’s and only one SSD ran slower than 8 MB/sec. You can replicate the exact test by running this on the command line in administrator mode.

winsat disk /ran /read /drive c

There are two problems with this implementation in Windows 7 and also we assume in Windows 8.

1. The flaw in Windows 7’s logic is that there are a lot of normal hard drives that return greater than 8 MB/sec on this benchmark. We looked at well over 200,000 hard drives and roughly 15% of these drives had a positive benchmark score and hence Windows 7 thinks they are an SSD. This means that Windows 7 is NOT defragging a lot of hard drives that need to be defragmented. Some of the drives were severely fragmented, which is no surprise since they never had been defragmented. So if you have a Windows 7 computer, there is a 15% chance that your computer has become severely slow due to excessive fragmentation. You can run a manual defrag and fix the problem, but the scheduled scan will never work since the drive passed the SSD test. If you want a scheduler, we of course recommend PC Matic, which has better SSD detection and a better scheduler than Windows.

2. Which brings us to the problem with Windows 7. If you are like me, you want to make sure that Windows is not defragmenting your brand new SSD drive. If you look at the Windows 7 interface, it actually says that scheduled defragmntation has been enabled!

This does NOT mean that your SSD will be defragmented by the Windows Scheduler.

We worked with Microsoft on this and they informed us that just because scheduled defragmentation is enabled does NOT mean it will defrag your SSD. Apparently, right before the scheduled defragmentation is run, Windows 7 does one last check to make sure it is not an SSD. We ran some tests and confirmed this result, but did they have to make it so counterintuitive?

The BOTTOM Line

HDD SSD
XP Apply SSD Tweaks such as TRIM
Vista Disable Scheduled defrag and apply tweaks such as TRIM
Win 7 Make sure to defrag regularly. Win 7 scheduler may not work.


Stop Responding to Threats.
Prevent Them.

Want to get monthly tips & tricks?

Subscribe to our newsletter to get cybersecurity tips & tricks and stay up to date with the constantly evolving world of cybersecurity.

Related Articles