New
#31
Scott Hanselman is a Microsoft employee and has been discussing this topic matter with Microsoft developers in order to convey these facts accurately and in non-developer speak - English. Together they have compiled the material at the link below. Please have a look and decide if you still feel this is a software error or failure to run disk optimizer.
Here's a snippet;
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.
As far as Retrim is concerned, this command should run on the schedule specified in the dfrgui UI. Retrim is necessary because of the way TRIM is processed in the file systems. Due to the varying performance of hardware responding to TRIM, TRIM is processed asynchronously by the file system. When a file is deleted or space is otherwise freed, the file system queues the trim request to be processed. To limit the peek resource usage this queue may only grow to a maximum number of trim requests. If the queue is of max size, incoming TRIM requests may be dropped. This is okay because we will periodically come through and do a Retrim with Storage Optimizer. The Retrim is done at a granularity that should avoid hitting the maximum TRIM request queue size where TRIMs are dropped.
The real and complete story - Does Windows defragment your SSD? - Scott Hanselman
BTW, the blog that follows this article is enlightening if you have the time.
I have changed one of the conditions in the task scheduler, I removed the check for 'Stop if the computer switches to battery power. I leave my laptop idle while powered on a daily basis and I would expect long enough to trim my SSD.
Samsung 970 evo 500GB NVMe. I've looked around several Samsung sites and can't locate anything definitive.
Thanks, that does agree with the information I've read so far, mostly.
This test looks interesting if I wasn't using my SSD on a daily basis. Check this line in the description;
The test is destructive and therefore the disk cannot be the boot drive. I did see another Trim test that was non-destructive, I'll try to locate it again.
Thanks, I'll keep looking when time permits, however; the info above from Microsoft makes me think I already have the answer. Have a look and let me know if you think it looks legit. Cheers,
- - - Updated - - -
Thanks, I did untick the Stop if the computer switches to battery power.
@W10 Tweaker
did you ever figure this out? I found this thread due to the same issue. I have disabled scheduled optimization on all my mechanical hard disks as most of them are hard/long/giant archive drives. aka 10tb plex drives. however I left the SSD which I would have expected to be trimmed on the predetermined schedule during maintenance and its not. 20 someodd days later I always end up trimming it myself. The defrag scheduled task is intact and says it was run successfully.
for some reason its not touching my ssd.
To be honest, I haven't been that diligent in continuing to monitor and log this issue, too many other distractions in life. If you read the entire thread and some of the attached links, you may be able to draw your own conclusion on how/when the Trim process actually happens or not.
From my observations and research I've concluded that the entire subject of Trim, like many other Microsoft issues, is not as clear as one might expect. Somewhere in my reading it was suggested that the defrag schedule (trim for SSD's) is more accurately a verification schedule where-by the OS verifies the disk state.
One would think the OS would initiate a Trim activity if during the verification process it identifies a disk state outside of specific parameters otherwise what would be the point of the OS verifying the trim state?
I have observed that (C:) on my SSD does appear to be optimized after 28-30 days, sometimes. I only use my SSD for OS and apps not data, therefore I'm not certain it requires to be trimmed more often than every 28-30 days.
If you're really curious and interested in learning more on this topic, I'd suggest you study and log your own PC behaviors and present the facts for discussions. Set the defrag schedule to weekly, don't run any manual trim commands, and log your observations for 60-90 days.
I'm still fascinated that (C:) and (L:) are trimmed independently when they're both on the same SSD.
BTW, the last run entry of 2020-0202 9:46 on (C:) did appear in the Task Scheduler. I wish there was a log file history other than the manual one I didn't continue with.
Another interesting item is the "Needs Optimization" in the Current Status for (L:) .
Why would Windows report that (L:) needs optimization when it hasn't been used? Is this a result of the dynamic state of (C:) which has impacted the contiguous state of (L:)?
So if Windows believes (L:) needs optimization and the defrag utility is set to weekly, same as (C:), why would the OS not initiate a Trim activity?
thank you for the reply, and yes i did read the entire thread. As you noted, its almost as if ones own conclusions must be drawn, which i find hard to stomach. That shouldnt be the case.
That was/is my plan; to let it sit for over a month and see if it registers any activity. As also noted, my mechanical drives were automatically being handled when I did have them enabled, but the time to do one single disk of that size (and i have 9) was just unrealistic. Especially as often as I'm using my pc, thus as infrequent as it would begin doing so.
Will post back with what I see some time from now then :P
Just to add to the mix, I own an Intel 660p NVME SSD, it is partitioned as one whole drive and the OS (Win10 Pro) is installed there.
These screen grabs are from the Intel SSD toolbox app.
As you can see Intel recommends running TRIM once a week even though there is conflicting information depending on where you look, some say once a month others weekly, i have even seen 6 monthly as a figure because otherwise you damage your SSD (this might be old info based on first gen drives).
I am assuming that Intel know whats best for it's own products so I have disabled Windows Defrag from running under any schedule and just use the Intel toolbox to run TRIM and the Sandisk app's TRIM function for my secondary SATA SSD, a Sandisk 3D Ultra.
The Intel drive is trimmed once per week since it is the Windows drive and sees the most activity and that is what Intel advise, the Sandisk is a game and application drive so gets trimmed once per month at most and quite often less than that since the only real write operations are game patches/ updates and game saves, most of its time is spent being read from.
The third drive is a SATA HDD for general file storage and disk images, it rarely has more than maybe 40% in use and has not been defragged in over 2 years and I have yet to notice any slow down.
Now all this is just for info, I'm not suggesting anyone does the same. I'm also not saying that Windows built in defrag/ optimiser is no good.
I do however find the range of opinions on when to TRIM and defrag drives conflicting at best and downright confusing at worst, so I will continue to use the manufacturers guidelines.
Even if you have it set for weekly, Trim only happens monthly.
This is normal. See defrag - Microsoft Docs under the sub-heading 'Scheduled task'
Denis