Unfortunately most of the answers in this thread are not useful, because they are simply perpetuating myths based on assumptions.
Myth 1: An SSD must never be defragmented because it will wear out the drive. Even in the most extreme scenario where every cell in a drive is being rewritten, doing this once a month would use 10% of the rated write endurance per month for the drive. In a realistic scenario the amount written leads to a basically insignificant level of wear.
Myth 2: Windows will not defrag your SSD. The optimise drive feature in windows runs about once per month automatically if you have system restore on that drive. This includes defragging. You don't need to be doing it manually. It will be defragging your SSD. We know this because it can be directly observed, and Microsoft has clearly documented and confirmed that it does.
Myth 3: An SSD does not benefit from defragging. Latency may be low, but it is not zero. A fragmented drive will have lower performance. That is why Windows defrags it...
The issues are discussed in this blog post with direct quotes from the MS storage team:
https://www.hanselman.com/blog/TheRealAndCompleteStoryDoesWindowsDefragmentYourSSD.aspx
Storage Optimizer will defrag an SSD once a month if volume snapshots are enabled. This is by design and necessary due to slow volsnap copy on write performance on fragmented SSD volumes. It’s also somewhat of a misconception that fragmentation is not a problem on SSDs. If an SSD gets too fragmented you can hit maximum file fragmentation (when the metadata can’t represent any more file fragments) which will result in errors when you try to write/extend a file. Furthermore, more file fragments means more metadata to process while reading/writing a file, which can lead to slower performance.
This documentation provides some details on how the optimise drive function operates:
https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/defrag
When run from the scheduled task,
defrag uses the below policy guidelines for SSDs:
- Traditional optimization processes. Includes traditional defragmentation, for example moving files to make them reasonably contiguous and retrim. This is done once per month. However, if both traditional defragmentation and retrim are skipped, then analysis isn't run.
- If you manually run traditional defragmentation on a SSD, between your normally scheduled runs, the next scheduled task run performs analysis and retrim, but skips traditional defragmentation on that SSD.
Given the above, I think it is very unlikely that pressing the optimise drive button once a month caused your drive to fail. As already suggested above, it is more likely that something was wrong with the drive and that led you to trying the optimise function.
However, for your new drive, you don't need to hit that button, because chances are Windows is already doing it (including a once per month defrag).