author avatar
    Senior Program Developer


When the PC is used for a long time, files on your hard drive may get fragmented. If those pieces are not checked and cleaned up regularly, your PC will perform slower and slower. Read this article and you will know how to defrag a hard drive in Windows 10 to make PC run more efficiently.

Description of Defragmentation in Windows 10

The files on the hard drive easily get fragmented in Windows 10 if the PC has been used for a long time. If the disk fragments are not cleaned up regularly, the PC will be slower and the lifespan of your hard drive will be shorten greatly. To have your PC run more efficiently and improve its performance, try to defrag those files at least once a week.

Why You Shouldn’t Defrag an SSD

Most users have already replaced the HDD to SSD. But is it necessary to defrag an SSD? There are multiple opinions on this issue. In fact, there is no need to defrag the SSD. There are 3 reasons as below.
  • 1. The read and write speed of each block on an SSD is average. And SSD’s performance basically depends on the internal controller and flash memory. So using built-in defragment tool can’t effectively improve computer’s performance.
  • 2. There’re limited amount of read and write cycles in an SSD. Defragmentation is the process of reallocating the noncontiguous fragments of data and rearranging them, which may shorten SSD’s lifespan. It’s suggested to prevent the unnecessary data erasure.
  • 3. SSD has a unique function TRIM to optimize itself. TRIM can be used to improve the SSD’s performance, which can be regarded as the defragment in HDD.

The Differences of Defragment between HDD and SSD

HDD usually stores data on a rotating disc. When reading data, the head needs to find data on it. If there are too many fragments that are scattered on the hard disk, the seek time will be increased and the work efficiency will also badly decline.

Generally we could adopt a traditional way to defrag a HDD. Using built-in option “Defragment and Optimize Drives” can rearrange the data and have them stored consecutively. In this case, a file can be read completely when the head only moves once and the seek time can also be shorten, which will greatly improve the PC’s performance.

Defrag a hard drive

As for SSD, the process of reading and writing completes via the transmission of electrical signals. Under the command of Controller, the electrically stored data in flash memory is obtained. In theory, the seek time is constant. TRIM usually is used to optimize the SSD and the PC instead of built-in option “Defragment and Optimize Drives” in Windows 10.

Trim represents that once a file is deleted, the system will mark the data blocks. Then SSD will immediately wipe out the data blocks which are no longer used after receiving the command. In this case, SSD will not have to erase the data block and data can be directly written to these data block next time, which will save a lot of time.
All in all, HDD and SSD operate in a different way, so the ways to defragmentation are also various. Next, how to defrag a hard drive in Windows 10 will be introduced below.
Hot Topic - ADsRenee Undeleter – Simple & Powerful Software for Data Recovery

Easy to use Recover data by 3 steps;

Multiple scan modes Fast partition scan, whole partition scan and whole disk scan;

Supported file types Image, video, audio, text, email and so on;

Image creation Create a partition image to read and back up data;

Supported devices SD card, SDHC, SDXC, USB flash drive, hard disk and computer.

Easy to use Recover data by 3 steps;

Multiple scan modes Fast partition/whole partition/whole disk scan;

Supported devices SD card/USB/hard disk.

Free TrialFree TrialFree Trial 800 people have downloaded!

Ways to Defrag Hard Drive in Windows 10

Use Built-in Defragmentation Tool in Windows 10 for HDD

Please note that this way is for HDD only.
Step 1: Type “Defragment and Optimize Drives” in the search box. Press “Enter”.
defragment and optimize drives
Step 2: Select target drive and click “Analyze”.

Tips: It’s suggested to analyze the drive before optimizing it. If the result shows more than 10%, the drive will need optimization.

Step 3: Select target drive and click “Optimize”.

Once the process completes, the current status will show “OK”.

defrag drives in Windows 10

Enable TRIM in Windows 10 for SSD

TRIM also can be enabled in Windows 7/8. Enabling TRIM can optimize an SSD and keep to get the best performance. Following will introduce how to enable TRIM via Command Prompt. This way requires administrator privilege. If it is not available, it’s suggested to create an administrator account at first.
Step 1: Type “cmd” in the search box. Right click “Command Prompt” and select “Run as administrator”.
run command prompt as administrator in start menu
Step 2: In the Command Prompt, type in: fsutil behavior query DisableDeleteNotify. Press “Enter”.
If the result shows DisableDeleteNotify = 0, TRIM will be enabled successfully.
enable TRIM with command prompt
Tips: If you want to disable TRIM, just type fsutil behavior set DisableDeleteNotify 1 in the Command Prompt and press “Enter”.
Defragment can optimize the computer performance, but some users are concerned if the missing data can be restored after defragmentation. As for this issue, some suggestions and useful data recovery tool will be provided for reference.

Possibility of Data Recovery after Defragmentation

Defragmentation is the process of reallocating the noncontiguous fragments of data and rearranging them. So the lost data will get overwritten after defragmentation. It’s suggested not to defrag the drive from which you want to needs to recover data. Besides, to prevent data loss, it would be better to transfer important files or data before defragmentation.
Generally, if you don’t defrag the hard drive or delete files unexpectedly, using data recovery software can recover the missing files before they get overwritten. In addition, you could also try to use data recovery software to recover the files lost during defragmentation.
It’s recommended to use Renee Undeleter. It just takes a few steps to recover missing files!
Tips: Please install Renee Undeleter to partitons which you do not lost data.
  • Fast Partition & Whole Disk Scan
  • Office Documents Preview
  • Memory Card Data Recovery
download software button win
  • Amazing Photo Recovery
  • Formatted Data Recovery
  • Recycle Bin Data Recovery
download software button mac clear2

Step 1: Launch Renee Undeleter and select “Fast Partition Scan” function.

This function supports to recover deleted files due to emptied recycle bin or Shift + Del.

Three Scan modes

Step 2: Choose the partition where you save the deleted files to scan.

If the files were saved in desktop or disk C, please stop using the computer and disconnect it from Internet. Because any Internet surfing operation will create cache which will overwrite your lost files. Then you may lose the chance to recover the data back.
select a drive to scan

Step 3: Select “Fast Scan” and click “Next” to process the scan.

Please note that “Fast Scan” in “Fast Partition Scan” will just scan the 30GB of the free space. If you can not find the target files after scanning, please use ”Deep Scan” in “Fast Partition Scan”. Of course, this scan mode will take more time.
Select fast scan mode in renee undeleter

Step 4: Preview files in the scan result to check the quality when scan is processing.

Files in BMP, GIF, PNG, JPEG, JPG, TIF, DOC, DOCX, HTM, PDF, PPT, PPTX, RAR, XLS, XLSX, ZIP formats could be preview before recovery.
preview before recovery