So... Per Microsoft, SSDs "Do" Need to be Defragged !?!

Rick Ausdahl
Rick Ausdahl Member Posts: 1,722 ✭✭✭
edited November 2024 in English Forum

Given below are links to a few web pages that as someone new to SSDs, I found of interest.  I thought I'd share them in case others new to (or just wondering about) SSDs would find them helpful.  I wonder if they'll hold up over time as true/accurate.

The first two links specifically address the "defrag" question and provide basically the same info, with the first one being an abbreviated version of the second one.  Personally, I think the second one is more helpful, but YMMV.

The last two links are more general, but I still thought they were helpful.

http://www.thewindowsclub.com/defragmentation-of-ssd-windows

http://www.hanselman.com/blog/TheRealAndCompleteStoryDoesWindowsDefragmentYourSSD.aspx

http://www.thewindowsclub.com/disk-defragmentor-storage-optimizer-windows-8

https://www.youtube.com/watch?v=NnBk2IGYerU

Comments

  • Charles
    Charles Member Posts: 238 ✭✭

    Regardless of what Microsoft does or does not do, almost every SSD manufacturer and knowledgeable hardware technicians do not recommend running a de-fragmentation program or procedure on a SSD.  Turn on TRIM unless it's automatic in Windows (it is Mac OS X El Capitan) is all you should have to do.

    In Christ,

    Charles

    2017 27" iMac 5K, Mojave, 10.5" iPad Pro, iPhone 7+, iPhone 8, iOS 12.0, Catalina beta, iPadOS Beta  

  • Rick Ausdahl
    Rick Ausdahl Member Posts: 1,722 ✭✭✭

    Charles said:

    Regardless of what Microsoft does or does not do, almost every SSD manufacturer and knowledgeable hardware technicians do not recommend running a de-fragmentation program or procedure on a SSD.  Turn on TRIM unless it's automatic in Windows (it is Mac OS X El Capitan) is all you should have to do.

    In Christ,

    Charles

    If I've read the first two articles correctly, what strikes me is it's not so much about "us" doing defrags as it is about the fact that "Microsoft" is doing them automatically on a monthly basis, unless System Restore has been turned off, and that they do it in order to prevent the drive from reaching the max file fragmentation point that can result not only in performance issues, but data errors as well.  At least that's what they claim.
  • Dave Hooton
    Dave Hooton MVP Posts: 36,211

    I've turned System Protection/Restore off whether I have an SSD or HDD because it causes fragmentation that often cannot be touched by normal "defragging" and means you have to remove restore points periodically to keep their size (and fragmentation) down.  But I run image copies on a weekly schedule to mitigate any file system issues or bad updates to the OS.

    The "optimise" terminology now used by Windows means that SSD's are "trimmed" rather than blindly "defragged"; which is much more beneficial than the latter because SSD storage is fragmented in the greater interest of longevity ("wear levelling" of blocks) i.e. defragmenting the file system by traditional Logical Block Addresses still means that the underlying storage is fragmented! However, I can understand that MS want to minimise this metadata fragmentation when System Protection is turned on!

    Dave
    ===

    Windows 11 & Android 13

  • DivineCordial
    DivineCordial Member Posts: 168 ✭✭

    Logos 10 | Faithlife Connect Essentials
    27" Intel i9-14900K 64GB DDR5 3x4TB SSD Win11Pro (23H2)
    rMBP13" macOS 10.15.7 i7 (2.9GHz) 8GB DDR3 512SSD
    11" iPadPro (2020) 17.5.1 | iPhone15 ProMax 17.5.1

  • Rick Ausdahl
    Rick Ausdahl Member Posts: 1,722 ✭✭✭

    I've turned System Protection/Restore off whether I have an SSD or HDD because it causes fragmentation that often cannot be touched by normal "defragging" and means you have to remove restore points periodically to keep their size (and fragmentation) down.  But I run image copies on a weekly schedule to mitigate any file system issues or bad updates to the OS.

    The "optimise" terminology now used by Windows means that SSD's are "trimmed" rather than blindly "defragged"; which is much more beneficial than the latter because SSD storage is fragmented in the greater interest of longevity ("wear levelling" of blocks) i.e. defragmenting the file system by traditional Logical Block Addresses still means that the underlying storage is fragmented! However, I can understand that MS want to minimise this metadata fragmentation when System Protection is turned on!

    One thing (a major thing in my view) is that I haven't seen anyone from Microsoft state whether the term "defrag" refers to exactly the same process regardless of the drive type (HDD or SSD).

    There's also a statement in the article from the second link in my original post that I'm curious about--i.e. that System Restore has to be turned on in order for the MS defrag process to take place.  But I've always been under the impression that the purpose of System Restore only applied to OS and program files/databases--not to user data.  So in the case of my laptops which have multiple partitions on a single drive, what exactly will MS defrag if I have System Restore turned on for the OS/Programs partition, but turned off for the data partition?  Will MS defrag just the OS/Programs partition or will it defrag the entire drive.

    I'm also curious about the following two statements taken from the conclusion of the article from my second URL link.  I'd like to see a little clarification of the italicized portions.  (Italics are mine)

    1. No, Windows is not foolishly or blindly running a defrag on your SSD every night, and no, Windows defrag isn't shortening the life of your SSD unnecessarily.
    2. Yes, your SSD's file system sometimes needs a kind of defragmentation and that's handled by Windows, monthly by default, when appropriate.
  • Rick Ausdahl
    Rick Ausdahl Member Posts: 1,722 ✭✭✭

    Interesting link, Divine.  Thanks!

    I'm curious about the following statement from the article, though.

    PerfectDisk’s SSD Optimize eliminates free space fragmentation on the SSD and consolidates partially full blocks of data.

    Aren't those things a traditional defrag will do--i.e. eliminate free space fragmentation and consolidate partially full blocks of data?  I wonder if/how PerfectDisk's process differs from Microsoft's periodic defrag process?

    Seems like every time I think the fog is starting to lift for me a little in regard to these SSDs, a whole new fog-bank rolls in.  [:S]

  • Dave Hooton
    Dave Hooton MVP Posts: 36,211

    There's also a statement in the article from the second link in my original post that I'm curious about--i.e. that System Restore has to be turned on in order for the MS defrag process to take place. 

    So in the case of my laptops which have multiple partitions on a single drive, what exactly will MS defrag if I have System Restore turned on for the OS/Programs partition, but turned off for the data partition?

    This seems to be a matter of terminology. If MS only defrag the System Restore folder on SSD's then Restore has to be "on" for that drive. Otherwise the whole drive is optimised using Trim. This applies to OS and data partitions.

    No, Windows is not foolishly or blindly running a defrag on your SSD every night, and no, Windows defrag isn't shortening the life of your SSD unnecessarily.

    As above, defragging is performed only on System Restore folders.

    Yes, your SSD's file system sometimes needs a kind of defragmentation and that's handled by Windows, monthly by default, when appropriate.

    I think this is a similar statement to the previous one; which overstates the period -  "every night" - to emphasise what is NOT happening.

    Note that I'm reading between the lines somewhat, as one statement is that MS does not defrag SSD's!

    I remove Windows scheduling for "optimising"/"defragmenting" and only use the SSD's toolbox to manually Trim the drive.

    Dave
    ===

    Windows 11 & Android 13

  • JAL
    JAL Member Posts: 625 ✭✭

    See also http://blog.condusiv.com/post/2012/01/21/Setting-the-Record-Straight-Windows-7-Fragmentation-SSDs-and-You.aspx from which I quote.

    "As pointed out in the article, the built-in defragmenter does not have the technology advancement to properly deal with fragmentation and SSDs. The physical placement of data on an SSD doesn’t really matter like it does on regular magnetic HDDs.  With an SSD there is no rotational latency or seek time to contend with.  Many experts assume that fragmentation is no longer a problem, but the application data access speed isn’t just defined in those terms.  Each and every I/O request performed takes a measurable amount of time.  SSD’s are fast, but they are not instantaneous.  Windows NTFS file system does not behave any differently because the underlying storage is an SSD vs. HDD and therefore fragmentation still occurs.  Reducing the unnecessary I/O’s by preventing and eradicating the fragmentation reduces the number of I/O requests and as a result speeds up application data response time and improve the overall lifespan of the SSD.  In essence, this makes for more sequential I/O operations which is generally faster and outperforms random writes.

    In addition, SSD’s require that old data be erased before new data is written over it, rather than just writing over the old information as with HDDs.  This doubles the wear and tear and can cause major issues with the speed performance and lifespan of the SSD.  Most SSD manufactures have very sophisticated wear-leveling technologies to help with this. The principle issue is write speed degradation due to free space fragmentation.  Small free spaces scattered across the SSD causes the NTFS file system to write a file in fragmented pieces to those small available free spaces.  This has the effect of causing more random I/O traffic that is slower than sequential operations."

    __________

    emphasis added

    The initial reference is to an article in PC World (February, 2012). As the blog post is almost four years old the statment regarding the built-in defragmenter may not stand. The explanation that writing over old data "doubles the wear and tear" on a SSD seems over simplified.

    Personally I have a Mac with a small SSD - 120GB available after OEM overprovisioning. I have both OS X and Windows 8 (BootCamp) partitions. I manually overprovision by an additional seven percent. Both operating systems support TRIM for the SSD. I have never defragmented my Windows file system manually. I have on very limited occasion defragmented, consolidating free space, my OS X system drive HFS+ file system. I have consolidated free space on the OS X partition perhaps four times in five years, always with noticeable improvement to responsiveness at the UI level. I have done no benchmarking.

    "The Christian mind is the prerequisite of Christian thinking. And Christian thinking is the prerequisite of Christian action." - Harry Blamires, 1963

  • JAL
    JAL Member Posts: 625 ✭✭

    Here is a primer with a good, illustrated, explanation of how when stored data needs to be changed SSDs work differently than HDDs which simply overwrite old data: Inside SSDs 101

    "The Christian mind is the prerequisite of Christian thinking. And Christian thinking is the prerequisite of Christian action." - Harry Blamires, 1963

  • Rick Ausdahl
    Rick Ausdahl Member Posts: 1,722 ✭✭✭

    I feel I should apologize in advance because I'm probably going to be a pest as my "density" shows itself, but the fact is, I am feeling pretty thick-headed at this point as I try to clarify how terms are being used by various authors/writers and attempt to sort out SSD fact from fallacy.

    I also want to say at the outset that I neither expect, nor want others to do my SSD homework for me.  My initial post in this thread resulted from things I ran across while in the process of doing my own homework and I plan to continue doing it.  But it is nice to have the option of discussing the whole business here.

    So please bear with me as I attempt to get a handle on it all, but at the same time, don't feel obligated to respond to this or any other future SSD related posts I make.  I won't feel the least bit slighted if people have higher priorities than participating in this thread.  Having said all that, while the quotes that follow are taken from one of Dave's previous posts and follow-ups may be addressed to Dave, they're really open to anyone interested (if anyone is).  [;)] 

    There's also a statement in the article from the second link in my original post that I'm curious about--i.e. that System Restore has to be turned on in order for the MS defrag process to take place. 

    So in the case of my laptops which have multiple partitions on a single drive, what exactly will MS defrag if I have System Restore turned on for the OS/Programs partition, but turned off for the data partition?

    This seems to be a matter of terminology. If MS only defrag the System Restore folder on SSD's then Restore has to be "on" for that drive. Otherwise the whole drive is optimised using Trim. This applies to OS and data partitions.

    Dave, your response here suggests to me that you think MS limits it's defragging to just the System Restore folder on SSDs, but from the things I've read, I was not under that impression at all.  While I understood MS would only defrag an SSD if the System Restore feature was turned on, it was also my understanding that if it is turned on, the defragging applies to all files, not just the normal System Restore related files.  May I ask what it is that led you to believe (know?) that MS is only defragging the System Restore folder?

    Also, your use of the term "drive" segues nicely into my effort to clarify terms.  Whether discussing HDDs or SSDs, this term is sometimes used to refer to the entire physical drive, but there are many times when the issue being discussed or the point being made applies equally to a logical drive (a.k.a. partition).  When it comes to HDDs I've got a handle on what applies and when, but with SSDs that's not always the case.

    For example, based on another thread on the forum, I came to understand that if "Trim" is enabled on an SSD, it's enabled for the entire physical drive, so regardless of how many partitions there are on the drive, if Trim is enabled, it will be enabled on all partitions.  And yet, when using Cloning software, if there are multiple partitions on the physical drive, the software I've used reports it's attempts (and success or failure) to enable trim on a partition by partition basis.  I realize the reporting method used by cloning software does not determine what is actually the case regarding how trim is implemented--I'm just using it as an example of how/where confusion can creep in.

    Another example goes back to the fact that one of the articles in my original post says MS will defrag an SSD if System Restore is enabled for the drive.  Based on my past experience with HDDs, I know that if there is more than one partition on a physical drive, Windows presents the option to enable System Restore for each partition individually.  Because I see the same thing with the SSDs I have now installed on two of our laptops, my initial assumption would be that MS will only defrag the drives/partitions that do have System Restore enabled.  However, their concern about meta-data fragmentation leaves me wondering... when it comes to SSDs, if/since the trim option applies automagically to all partitions on the entire physical drive, does MS carry that entire physical drive concept over to it's defragging logic/process and apply it to all partitions even if System Restore is only turned on for some of them?  It seems to me that would be the logical thing for MS to do if they're concerned about the meta-data fragmentation issue, because at least based on our use, we have the potential for far more data files than system files.  It's my impression however, that you think (know?) the defragging will be on a partition by partition basis, depending on whether or not System Restore is turned on for a partition--so if as in my case, a person has partition A for the OS and apps, and partition B for data, and has System Restore turned on only for partition A, that MS will defrag only partition A, not partition B, and that even on partition A, you think the only files MS will defrag are the system files that get backed up by System Restore.  Forgive me if I totally misunderstood you on this scenario. 

    In summary, I think there are a few things that are leaving the waters too muddy for me to be sure what to think.

    • Even though SSDs and HDDs are very different animals, some of the same key terms like drive and partition are used for both even though they may not be implemented in quite the same way or have the same maintenance needs on the two different drive types.
    • With SSDs, some things (like trim) apparently apply to the entire physical drive (i.e. to all partitions), while others (like defrag) do not, or at least may not.
    • The articles I've read so far often use the term "drive" in a generic way, leaving me unsure whether or not the statements being made apply equally to both physical and logical drives.
    • There are conflicting reports as to what should and shouldn't be done to SSDs as well as confusion in regard to what MS is or isn't doing.
    • Regarding some of the things MS is said to be doing, there is confusion as to how often MS does them and what triggers the actions.

    There's more, but I think this might be a good place to take a break.

  • Rick Ausdahl
    Rick Ausdahl Member Posts: 1,722 ✭✭✭

    I remove Windows scheduling for "optimising"/"defragmenting" and only use the SSD's toolbox to manually Trim the drive.

    Hmmm.  The only thing resembling a toolbox that I see for my Crucial drive is Crucial's Storage Executive Client and it does not have a "Trim" option that I can see to manually initiate a trim process.  I suppose I could attempt to accomplish the same thing by manually requesting MS to optimize the partitions.
  • Rick Ausdahl
    Rick Ausdahl Member Posts: 1,722 ✭✭✭

    JAL said:

    Here is a primer with a good, illustrated, explanation of how when stored data needs to be changed SSDs work differently than HDDs which simply overwrite old data: Inside SSDs 101

    Thanks, Jal.  I'm checking it out.
  • DivineCordial
    DivineCordial Member Posts: 168 ✭✭

    [I'm curious about the following statement from the article, though.

    PerfectDisk’s SSD Optimize eliminates free space fragmentation on the SSD and consolidates partially full blocks of data.

    Aren't those things a traditional defrag will do--i.e. eliminate free space fragmentation and consolidate partially full blocks of data?  I wonder if/how PerfectDisk's process differs from Microsoft's periodic defrag process?

    From what I understand is that PerfectDisk's method for SSD optimization is to consolidate partially filled blocks of data so that TRIM can perform on the unused blocks more effectively. This differs from standard defragmentation methods in that normally files are moved and defragmented, whereas PD's SSD Optimize does not defragment individual files or rearrange the data. It simply consolidates partially filled blocks together. So say, for example, instead of having 10 partially filled blocks, these would be consolidated into 5 full blocks and thus freeing the other 5 blocks.

    Also, I understand that in order for a block to be written to, it needs to be first erased if any data is present. Thus, if there are several partially filled blocks, these blocks must be erased and rewritten in order to add any more data to them. Consolidating these partially filled blocks reduces this so that both performance and the longevity of the drive should be improved. Performance in that less blocks need to be erased and rewritten as often. Longevity in that SSDs degrade overtime as they are written to, and since more blocks will be completely available for future use, they don't need to be erased first.

    Logos 10 | Faithlife Connect Essentials
    27" Intel i9-14900K 64GB DDR5 3x4TB SSD Win11Pro (23H2)
    rMBP13" macOS 10.15.7 i7 (2.9GHz) 8GB DDR3 512SSD
    11" iPadPro (2020) 17.5.1 | iPhone15 ProMax 17.5.1

  • Rick Ausdahl
    Rick Ausdahl Member Posts: 1,722 ✭✭✭

    Thanks, Divine.  It sounds like either Windows needs an update to provide a task similar to Perfect Disk's or that all SSDs should have a similar process either built into their controllers or provided as a toolbox option.

    Right now I have System Restore turned on for each partition and allocated just 1% of the partition's space on the two SSDs I've installed so far.  I did it to address Microsoft's concern regarding problems caused by excess fragmentation of meta-data if the drives are never defragmented, but I'm thinking about turning it back off and waiting to see if any problems actually develop.

  • Dave Hooton
    Dave Hooton MVP Posts: 36,211

    May I ask what it is that led you to believe (know?) that MS is only defragging the System Restore folder?

     It's my impression however, that you think (know?) the defragging will be on a partition by partition basis, depending on whether or not System Restore is turned on for a partition

    As I said, reading between the lines of the ambivalent statements about what MS is doing! But have a look at the Task Scheduler for Defrag

    It is disabled for my HDD in Windows 10 because I prefer to use a third party program, but note the defrag options (explained below)

    Surprisingly, /O is preferred to /D - traditional defrag. Whilst it is performed on all drives (/C) there is also the option /E to omit specific volumes/drives.

    Check this out for your SSD!

    Dave
    ===

    Windows 11 & Android 13

  • Don Awalt
    Don Awalt Member Posts: 3,552 ✭✭✭

    I think what Dave shows immediately above my post backs up what Scott Hanselman says in this blog post:

    http://www.hanselman.com/blog/TheRealAndCompleteStoryDoesWindowsDefragmentYourSSD.aspx

     In short, some level of work on SSDs is needed, it's only doing it about once a month even though it runs more often, it's not doing anything stupid w.r.t SSDs that any newbie would know is wrong (/O backs that up). That's good enough for me.

    I will add I used to work with Scott - he is incredibly thorough and brilliant - and he explains here how he did his homework to find out. While no one is perfect, I am going with that and leaving it as Microsoft set it up.

  • Rick Ausdahl
    Rick Ausdahl Member Posts: 1,722 ✭✭✭

    Thanks for the reply, Dave.

    I've been playing around a little with three things:

    1. System Restore
    2. The schedule option provided by Optimize Drives
    3. The Defrag task in the Task Scheduler. 

    Currently, on my Toshiba with the Crucial MX200 500GB drive, I have System Restore turned off for all partitions, the schedule for Optimize Drives set to "Daily", and the Defrag task in Task Scheduler enabled (set to ready) but without any triggers to actually kick it off.  (See visuals below.)

    So far with these settings, absolutely no drive maintenance has kicked off automatically--not even the Trim procedure which is set to be done daily.  As the Optimize Drives and Defrag Task show in the visuals below, the only drive maintenance performed has been the Trim procedure I initiated manually last night from the Optimize Drives panel.

    Regarding the Defrag options listed in your Command Prompt window, I'm not surprised that /o would be the preferred option, as when that one is selected, MS will simply choose the preferred maintenance option (trim or traditional defrag) depending on the drive type.  At least that's my current understanding, but I suppose that might change at any moment as I stumble across new info.

     

    OOPS!  I forgot to include the History report available in Task Scheduler for the Defrag task, but it showed only one maintenance event for it, and it was for the Trim process I ran manually last night. 

  • Rick Ausdahl
    Rick Ausdahl Member Posts: 1,722 ✭✭✭

    Don Awalt said:

    I think what Dave shows immediately above my post backs up what Scott Hanselman says in this blog post:

    http://www.hanselman.com/blog/TheRealAndCompleteStoryDoesWindowsDefragmentYourSSD.aspx

     In short, some level of work on SSDs is needed, it's only doing it about once a month even though it runs more often, it's not doing anything stupid w.r.t SSDs that any newbie would know is wrong (/O backs that up). That's good enough for me.

    I will add I used to work with Scott - he is incredibly thorough and brilliant - and he explains here how he did his homework to find out. While no one is perfect, I am going with that and leaving it as Microsoft set it up.

    Don, thank you for joining the conversation!

    The link you provided is one of the links in my initial post and is one of the more complete/thorough I've found so far regarding maintenance of SSDs.  While it's not the most recent article I've seen, it's definitely one of the more recent, and because it seems reasonable the tech experts have more information and a better understanding of SSDs now than they did 3 to 4 years ago, I can't help but give more recent articles and discussions a little more weight than those from say 2010-2013, provided of course that they are well researched, which Scott's article seems to be.

    It sure would be nice though, if MS and the drive manufacturers would get together and make a joint statement, EVEN if there is some disagreement amongst them.  At least we'd know what they agree on, what they don't, and hopefully why, to help us all make more informed decisions on our maintenance approaches.