How to Defrag Your Windows Hard Drive

How to Defrag Your Windows Hard Drive

Due to the difference in technology, HDDs are inherently slower than their SSD counterparts, and their performance decreases over time as you store more and more data on them. This can be attributed to data fragmentation during the writing process. However, there is a simple fix for it called defragmentation. In this article, we will go over a few simple methods to help you defrag your Windows hard drive and get a significant performance boost.

What Is Defragmentation?

To understand what defragmentation is, you need to know how a hard drive works. Think of the latter as a train where the coaches store and carry data. Every time you add more data to your hard drive, it’s broken down into smaller pieces or fragments, and a new coach is added to the train to store that data. These coaches are added in a sequential manner.

However, whenever you delete a file, the coach containing that particular file is emptied but not removed from the train completely, which creates an empty space. As a hard drive reads and writes data, more such spaces are created over time.

Now, during the process of storing more data, the hard drive fills up the empty coaches with some fragments of data and creates new coaches for the remaining pieces. This results in data being scattered all across the hard drive. Even though it seems efficient that those empty spaces are finally being used, that’s not the case.

The issue here is that whenever data fragments are stored farther away from each other, it takes a while for your computer to recollect it all before it can be presented to you again. This slows down the overall reading speed of that hard drive. This is another reason why hard drive-based computers tend to slow down when your storage is almost full. The process of reversing this breakdown and reorganizing the data on the hard drive is called defragmentation.

These days Windows automatically defrags mechanical hard drives. However, it only works for drives that are physically connected to your motherboard. So, if you have an old or external HDD, it’s always a good idea to defragment it yourself for a smoother performance.

How To Defragment Your Hard Disk in Windows 10 and 11

Now that we know what defragmentation means, we can begin with the steps to do it manually on your PC.

1. Use the Disk Optimization Tool

  1. Open the disk optimization tool – search for the “Defragment and Optimize Drives” program in Windows Search.
Open Disk Defragmentation Utility Windows
  1. Select your hard drive from the list of available drives and click Analyze. Note that if you have an SSD, this option will be unavailable.
Analyze Hard Drive
  1. Check the percentage of fragmented files in the results.
Hard Drive Fragmenting

Note: There’s no hard and fast rule regarding how fragmented your drive should be before you can defrag it. However, you should try to maintain the fragmentation level below 5% so that the defragmentation process doesn’t take too long.

  1. Click Optimize if you want to defragment your drive. It’s preferable to perform this action when you don’t need to use your computer for anything else, to allow Windows to defragment the hard drive properly.
Optimize Drives

When Windows is finished with the process, the Optimize Drives program should show your drive as 0% fragmented.

6 Ways to Check Hard Disk Health in Windows

2. Schedule Optimization

You can put this whole defragmentation process on an automated schedule from the same location.

  1. Look for the “Scheduled optimization” section, and click on “Change settings.”
Change Schedule Settings
  1. From the “Optimization schedule” drop-down menu, set the frequency to Weekly or Monthly, and click on Choose.
Set Defragmentation Schedule
  1. Check the drives that you want to schedule defragmentation for and click on OK.
Select Drives
  1. Click OK once again to save the changes.

3. Use the Command Line

  1. Press Win + X and choose “Windows Terminal (Admin)” from the pop-up menu.
Open Windows Terminal
  1. To defrag that drive, use the following command, replacing X with your drive letter:
defrag X
Defragmentation By Windows Terminal

Wait for the defragmentation process to complete.

Degagmentation Command Windows Terminal

If you want to defrag your whole system except for your main drive, use this command instead: defrag /E X:. Here, X is the letter of the drive you want to exclude.

8 Ways to Customize Windows Terminal

4. Use a Third-Party Defragging Tool

Instead of using the inbuilt defragging tool, you can also use third-party defragmentation tools like MyDefrag or Auslogics Disk Defrag to achieve the same results.

  1. Download and install Auslogics’ Disk Defrag tool on your PC.
  2. Launch Disk Defrag. On the home screen, select your storage drive and click on Defrag.
Select Drive And Start Defragmentation
  1. Depending on your drive size, it can take a while to defragment your HDD.
Defragmenting In Progress
  1. Once the process is complete, you will get a message that says “Defragmentation Complete.”
Disk Fragmentation Complete
  1. Close Disk Defrag.