In this article we explain what defrag is and why it is generally a bad idea to run it on an SSD.

But that is a very simple answer to a much more nuanced truth that most websites and forums have  wrong.  Keep skimming through this article if you want to understand that Defragging and Optmizing an SSD are both very good things, when left to Microsoft.

What Does Defrag Do?

Defragmenting a spinning hard disk moves the thousands of file parts into sequential order so that disk read heads do not waste time, electricity and wear skipping through your spinning disk to find all the pieces.

Should I Defrag my SSD?

Dont Disable Windows Disk Optimization DefragSolid State Disks (SSD’s) are literally just memory chips and as such have no read or write heads so there is no delay pulling data from different parts of the “drive”.

Crucial, one of the worlds largest manufacturers of SSD’s explains it this way:

Defragging ensures that large files are stored in one continuous area of a hard disk drive so that the file can be read in one go. Mechanical drives have a relatively long seek time of approximately 15ms … This really adds up when reading lots of different files split into lots of different fragments.

 

However, this isn’t an issue with SSDs because the seek time are about 0.1ms. You won’t really notice the benefit of defragged files.  SOURCE

However this leaves three questions:

1 – Why Is Defragging an SSD a Bad Idea?

Running a defragmenting utility on an a solid state disk is bad idea because SSD’s wear out with use, and defrag moves a lot of files.  Given that there is virtually no performance increase from defragmenting SSD, there is almost nothing but downside to doing it… so don’t 😉

2 – Does Windows 10 / 11 Defrag SSD’s Automatically?

Mostly no.  Windows 10 and Windows 11 still have a defragment utility built in but it is now smart enough to flag SSD’s and disable defrag.

However, once a month Windows automatically considers partially defragmenting an SSD if there is exceptional fragmentation that is approaching the ‘maximum fragmentation threshold’.  After that threshold is reached the “meta data” for the file fragments exceeds what the SSD can handle causing the SSD to stop reading and writing.  This is a bad thing so Microsoft will carefully defrag the rare potentially problematic files.

3 – What Does Windows 11 / 10 SSD Optimization Do?

When a file is deleted on an SSD, the memory cells (yes, the physical cells inside the memory chips) are simply flagged as available to be overwritten, but the data still exists.  Unlike old spinning disks, SSD’s cannot write data into their memory cells if something is already in that space.

SSD’s run a command named “Trim” to actively delete the data in the memory cells that are flagged as garbage.

Think of Trim as popping bubbles to make the space available again.  Without the Trim command, your SSD would just keep filling up until it was 100% maxed out.

Back in 2008 and 2009 the better SSD’s did not wait for a software tool to Trim off the garbage; they had “auto trim” running right on the SSD hardware controller.  Today virtually all SSD’s have auto-trim built in so the junk data gets removed quickly.

windows 10 11 optimize drivesHowever, if you look at Windows 11 and Windows 10 you will find a the old disk utility that used to do very little more than defrag.  Today, if Windows detects an SSD the ANALYZE button becomes grayed out because that relates to defrag and users should not defrag and SSD.  But there is an Optimize button and that seems to confuse people.

The Optimize button in the Windows Optimize Drives  utility, simply runs another Trim command to ensure all of the junk is gone.  If you care about the technical detail, this is cleverly called a “retrim” command.

And this may lead you to wonder, how an SSD could screw up its own trimming.  Well, it turns out that SSD manufacturers are very concerned about performance and their controllers can only handle so many commands at once.  If the SSD is busy and a pile of Trim commands are sent to the SSD (i.e. because you deleted a bunch of files), it may max out it’s buffer and drop some of those Trim commands.

That is very bad because unless the memory cells are flushed with a Trim command, they can not be reused.  So over a long period of time, your SSD could be increasingly consumed by old data that did not actually get deleted.

Windows Disk Optimization uses the retrim command slowly so it does not max out the command buffer.

Summary of Defrag, Disk Optimization, Trim & Retrim

For all these reasons it is important that:

  1. you do NOT run defrag on your SSDs, BUT
  2. you do NOT disable Windows Disk Optimization

The moral of the story, is just leave Windows defrag at its default settings.

If you have any questions, just leave us a comment below and we will do our best to get back to you.

 


 


5 Comments

Rob Hill · November 7, 2023 at 9:28 am

Yes, really agree with this – you should ALMOST never defrag your SSD, but there are cases when defragging an SSD is a good idea

JefferySot · September 6, 2023 at 9:04 am

No doubt. Great information on defraging SSD’s

windaddyindia · May 22, 2023 at 7:15 pm

Yes, you have correctly told

Ian Matthews · January 30, 2023 at 6:11 pm

Hi Jon;

The GUI reports a full defrag, but it is actually only a partial. Microsoft is careful to not over use the SSD and burn out the cells.

Thanks for your comments and thanks for checking in with us 🙂

James · June 19, 2022 at 12:18 pm

I have a multi-boot system with Windows 10 on an SSD and Windows XP on an SSD. I use Windows 10 trim function to manually trim my Windows 10 and XP drives? I’ve been doing this for about a year or more now and so far it seems to be working OK.

Oh, and I also have a regular SATA hard drive in it with Windows 7 on it and I disabled the defrag function on that and only run it manually when needed.

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *